WordPress.org

Make WordPress Core

Opened 7 months ago

Last modified 5 months ago

#52796 new defect (bug)

Disable auto updates flag logic is reversed

Reported by: TimothyBlynJacobs Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 5.5
Component: Upgrade/Install Keywords: needs-patch
Focuses: Cc:

Description

#50824 introduced support for a disable_autoupdate flag to prevent an auto update from going thru, even if the user had opted into updates for that package via the UI.

https://github.com/WordPress/wordpress-develop/blob/380d0445e84861ac0e634701d746b82634790f6f/src/wp-admin/includes/class-wp-automatic-updater.php#L177

It looks like, however, that the logic is reversed. If disable_autoupdate is set to a truthy value so it passed the ! empty check, that value will then be assigned to $update directly. Which would end up enabling auto updates for that package, even if the user hadn't opted in.

I think the fix would either be to negate the value of $item->disable_autoupdate, or perhaps more simply, set it to false.

Change History (3)

#1 @SergeyBiryukov
7 months ago

  • Milestone changed from Awaiting Review to 5.8

This ticket was mentioned in Slack in #core-auto-updates by afragen. View the logs.


7 months ago

#3 @JeffPaul
5 months ago

  • Milestone changed from 5.8 to Future Release

With 5.8 Beta 1 next week and no patch/PR on this ticket, I'm going to punt this to Future Release. Once a patch/PR is available this ticket can be added back to a numbered milestone.

Note: See TracTickets for help on using tickets.