Opened 3 years ago
Closed 2 years ago
#6394 closed defect (bug) (worksforme)
Fix GitHub edit link on WP-CLI handbook
Reported by: | danielbachhuber | Owned by: | dd32 |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Make (Get Involved) / P2 | Keywords: | has-patch |
Cc: |
Description
The WP-CLI handbook currently points to the master
branch, when it should point to the main
branch (https://share.cleanshot.com/4VjE91)
Here's the corresponding code needing to be updated: https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-cli/inc/class-handbook.php#L113
Attachments (1)
Change History (10)
This ticket was mentioned in Slack in #meta by danielbachhuber. View the logs.
3 years ago
#3
@
3 years ago
- Owner set to dd32
- Resolution set to fixed
- Status changed from new to closed
In 11951:
#4
@
3 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Well that doesn't seem to have worked..
For reference, this is about https://make.wordpress.org/cli/handbook/
#5
@
2 years ago
similar branch name switched here: https://github.com/WordPress/wporg-developer/pull/141
#6
@
2 years ago
I think the cause is that action_wporg_cli_manifest_import()
cron callback never updates the wporg_cli_markdown_source
meta key when it changes. So the original URL is always used. To fix that, we could write a script to update them all, or some code to automatically update them when the cron runs.
Is there a tangible problem here, though? It seems like GitHub automatically redirects any links. If that's the case, then IMO it'd be better to focus our time on things with a bigger impact.
#7
@
2 years ago
Is there a tangible problem here, though? It seems like GitHub automatically redirects any links.
There was some context where the link was broken and didn't redirect.
However, clicking the Edit link on the top of the Handbook page seems to redirect as expected.
To fix that, we could write a script to update them all, or some code to automatically update them when the cron runs.
Could we simply filter the output value for make.wordpress.org/cli
?
It seems like GitHub automatically redirects any links. If that's the case, then IMO it'd be better to focus our time on things with a bigger impact.
I think this is one of those paper cut issues where, until it gets fixed, it will be reported again and again.
#8
@
2 years ago
I think the cause is that action_wporg_cli_manifest_import() cron callback never updates the wporg_cli_markdown_source meta key when it changes.
I've fixed this as a once-off wp shell job, I don't think this kind of thing happens enough to warrant fixing this specific handbook importer.
$ wp shell --url=https://make.wordpress.org/cli/handbook wp> global $wpdb; wp> $ids = $wpdb->get_results( "SELECT `post_id`, REPLACE( `meta_value`, '/blob/master/', '/blob/main/' ) as value FROM `$wpdb->postmeta` WHERE `meta_key` = 'wporg_cli_markdown_source' AND `meta_value` LIKE '%/blob/master/%'" ); array(70) { .... wp> foreach ( $ids as $row ) { update_post_meta( $row->post_id, 'wporg_cli_markdown_source', $row->value ); }
Patch per Daniel's description