Making WordPress.org

Opened 4 weeks ago

Last modified 3 weeks ago

#7963 new defect (bug)

Code reference source blocks

Reported by: skithund's profile skithund Owned by:
Milestone: Priority: normal
Component: Developer Hub Keywords:
Cc:

Description

After WordPress 6.8 release most of the devhub code reference source blocks for functions broke.

Source code snippets are from correct file, but wrong line numbers. Also links to Trac and GitHub are linking to wrong lines/line numbers due to this.

Examples of very broken ones, or just "off by couple of lines".
https://developer.wordpress.org/reference/functions/load_theme_textdomain/
https://developer.wordpress.org/reference/functions/wp_get_attachment_metadata/
https://developer.wordpress.org/reference/functions/image_get_intermediate_size/

Change History (3)

#1 @dd32
3 weeks ago

#7964 was marked as a duplicate.

#2 @dd32
3 weeks ago

The line number references seem to match the offsets for WP 6.6, my guess is that similar to #7964 that the import was not complete.

#3 @dd32
3 weeks ago

As noted in #7964 the 6.8 update appears to have been broken somehow, resulting in incomplete data.

After I've imported the 6.8 updates to devhub in #7964, I've now re-run the code caching process which has populated a bunch of functions, but not all of the ones mentioned here.

For others, I ran this after using wp parser import above.

wp @developer shell
> update_option( 'wp_parser_root_import_dir', '/tmp/wp-6.8/src' );
> DevHub_Parser::cache_source_code();
> delete_option( 'wp_parser_root_import_dir' );

It appears that some files aren't being parsed.

In the devhub parse, several files have no data extracted, such as wp-includes/media.php and wp-includes\l10n.php.

As noted in https://github.com/WordPress/phpdoc-parser/issues/246 some files are hitting a fatal error in the parser we're using, so I'm guessing that's these files.

The line number references seem to match the offsets for WP 6.6,

We don't automatically delete file/function/class references on developer.w.org, which is a bug in of itself, but this has caused the functions to become stale as the 6.7+6.8 imports haven't updated their line numbers.

https://developer.wordpress.org/reference/functions/load_theme_textdomain/
https://developer.wordpress.org/reference/functions/image_get_intermediate_size/

To resolve this; we'll need to figure out how to get the PHPDoc parser to be able to parse those files. I'll put some notes in https://github.com/WordPress/phpdoc-parser/issues/246

Note: See TracTickets for help on using tickets.