Make WordPress Core

Opened 3 years ago

Closed 2 weeks ago

Last modified 2 weeks ago

#52796 closed defect (bug) (fixed)

Disable auto updates flag logic is reversed

Reported by: timothyblynjacobs's profile TimothyBlynJacobs Owned by: timothyblynjacobs's profile TimothyBlynJacobs
Milestone: 6.6 Priority: normal
Severity: normal Version: 5.5
Component: Upgrade/Install Keywords: has-patch
Focuses: Cc:


#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.

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 (9)

#1 @SergeyBiryukov
3 years ago

  • Milestone changed from Awaiting Review to 5.8

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

3 years ago

#3 @JeffPaul
3 years 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.

#4 @lopo
20 months ago

@TimothyBlynJacobs do you know any plugin which currently has that flag set?

This ticket was mentioned in PR #4102 on WordPress/wordpress-develop by @amisiewicz.

16 months ago

  • Keywords has-patch added; needs-patch removed

Straight forward fix (as suggested in the ticket description)

Trac ticket:

#6 @benbornschein
3 weeks ago

Why is this still not fixed? The flag is in its current state useless.

#7 @TimothyBlynJacobs
2 weeks ago

  • Milestone changed from Future Release to 6.6
  • Owner set to TimothyBlynJacobs
  • Status changed from new to accepted

#8 @TimothyBlynJacobs
2 weeks ago

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

In 58285:

Upgrade: Fix the disable_autoupdate flag logic.

In #50824 support was added for a package to include a disable_autoupdate flag to indicate that the plugin/theme should not be auto-updated even if a user had opted-in via the WP-Admin UI. However, the logic implementing the flag was inverted.

This commit repairs the logic. If a package has disable_autoupdate set, then it should not be auto-updated.

Props amisiewicz.
Fixes #52796.

@TimothyBlynJacobs commented on PR #4102:

2 weeks ago

Merged in 58285. Thanks for the patch!

Note: See TracTickets for help on using tickets.