WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 4 months ago

#51892 closed defect (bug) (fixed)

Fix core_update_footer() for new Updates API

Reported by: afragen Owned by: SergeyBiryukov
Milestone: 5.6 Priority: normal
Severity: normal Version: 5.6
Component: Upgrade/Install Keywords: has-patch has-screenshots commit dev-reviewed
Focuses: Cc:

Description (last modified by afragen)

Fixes a regression in 5.6 with the changes in the new Updates API #meta5511.

The admin footer no longer displays the 'You are using a development version (%1$s). Cool! ... message when using the WP_AUTO_UPDATE_CORE constant set to update to beta or rc when the user is on a development version.

Attachments (6)

before.png (20.3 KB) - added by afragen 4 months ago.
after.png (36.6 KB) - added by afragen 4 months ago.
51892.diff (511 bytes) - added by afragen 4 months ago.
51892.2.diff (528 bytes) - added by SergeyBiryukov 4 months ago.
Minor refresh to simplify the logic
51892-2.diff (424 bytes) - added by afragen 4 months ago.
test for $cur->version, replacing test for $cur->url
51892.3.diff (1.0 KB) - added by pbiron 4 months ago.

Download all attachments as: .zip

Change History (23)

@afragen
4 months ago

@afragen
4 months ago

@afragen
4 months ago

#1 @afragen
4 months ago

  • Description modified (diff)

#2 @afragen
4 months ago

  • Milestone changed from 5.6 to 5.6.1
  • Version set to 5.6

#3 @SergeyBiryukov
4 months ago

  • Milestone changed from 5.6.1 to 5.6
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

Thanks for the patch!

Since this is a regression and an easy fix, I think this is a good candidate for 5.6. Related: #51822.

Last edited 4 months ago by SergeyBiryukov (previous) (diff)

@SergeyBiryukov
4 months ago

Minor refresh to simplify the logic

#4 @SergeyBiryukov
4 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 49708:

Upgrade/Install: Display "You are using a development version" message in the admin footer for Beta or RC versions.

This ensures that the message is displayed when the WP_AUTO_UPDATE_CORE constant is set to beta or rc and the user is on a development version.

Props afragen.
Fixes #51892.

#5 @SergeyBiryukov
4 months ago

  • Keywords commit added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backporting to the 5.6 branch after a second committer's review.

#6 @azaozz
4 months ago

  • Keywords dev-reviewed added; dev-feedback removed

[49708] looks good here, +1 to add to the 5.6 branch.

#7 @SergeyBiryukov
4 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 49711:

Upgrade/Install: Display "You are using a development version" message in the admin footer for Beta or RC versions.

This ensures that the message is displayed when the WP_AUTO_UPDATE_CORE constant is set to beta or rc and the user is on a development version.

Props afragen.
Reviewed by azaozz, SergeyBiryukov.
Merges [49708] to the 5.6 branch.
Fixes #51892.

This ticket was mentioned in Slack in #core by pbiron. View the logs.


4 months ago

#9 @afragen
4 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

@afragen
4 months ago

test for $cur->version, replacing test for $cur->url

#10 @hellofromTonya
4 months ago

  • Keywords commit dev-reviewed removed

Removing for the re-opened issue.

@pbiron
4 months ago

#11 @pbiron
4 months ago

For the context behind 51892.3.diff see this slack thread.

#12 @audrasjb
4 months ago

Patch for alpha/beta/RC looks good to me.

For reference, it addresses the issue raised today in this thread in #core-auto-updates Slack channel.

#13 @SergeyBiryukov
4 months ago

To summarize the Slack thread linked above, if get_preferred_from_update_core() gets an empty response from get_core_updates(), it returns an object with 'response' => 'latest' and no other properties, so checking $cur->version without making sure it exists can cause a PHP warning.

Checking $wp_version instead would be more consistent with core_upgrade_preamble(), see [49709] / #51822.

Additionally, $cur->url is unused since [8595] and can be safely removed.

#14 @SergeyBiryukov
4 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 49736:

Upgrade/Install: Check $wp_version global for displaying "You are using a development version" message in the admin footer.

This brings some consistency with the same check in core_upgrade_preamble() and avoids a PHP warning if $cur->version is not set.

Additionally, remove the check for $cur->url property, unused since [8595].

Follow-up to [49708], [49709].

Props pbiron, afragen, audrasjb.
Fixes #51892.

#15 @SergeyBiryukov
4 months ago

  • Keywords commit dev-feedback added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backporting to the 5.6 branch after a second committer's review.

#16 @azaozz
4 months ago

  • Keywords dev-reviewed added; dev-feedback removed

[49736] looks good here, +1 to merge to the 5.6 branch.

#17 @SergeyBiryukov
4 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 49743:

Upgrade/Install: Check $wp_version global for displaying "You are using a development version" message in the admin footer.

This brings some consistency with the same check in core_upgrade_preamble() and avoids a PHP warning if $cur->version is not set.

Additionally, remove the check for $cur->url property, unused since [8595].

Follow-up to [49708], [49709].

Props pbiron, afragen, audrasjb.
Reviewed by azaozz, SergeyBiryukov.
Merges [49736] to the 5.6 branch.
Fixes #51892.

Note: See TracTickets for help on using tickets.