WordPress.org

Make WordPress Core

Opened 2 months ago

Closed 2 months ago

#50291 closed defect (bug) (fixed)

Plugins & Themes Auto-Updates: state of the link on the themes screen is not updated

Reported by: azaozz Owned by: azaozz
Milestone: 5.5 Priority: normal
Severity: normal Version: 5.5
Component: Security Keywords: has-patch commit
Focuses: Cc:

Description

As reported by @desrosj at https://core.trac.wordpress.org/ticket/50052#comment:38

  • Click on Theme Details for a theme.
  • Click "Enable auto-updates".
  • Auto-updates are correctly enabled.
  • Close that theme's overlay.
  • Click on Theme Details for the same theme and note that it says "Enable auto-updates" again.
  • Refresh the page and view that theme again to see auto-updates is correctly enabled.

Attachments (2)

50291.diff (1.8 KB) - added by azaozz 2 months ago.
50291.1.diff (2.3 KB) - added by pbiron 2 months ago.
same as 50291.diff, but uses a yoda condition in the wp-auto-update-setting-changed callback

Download all attachments as: .zip

Change History (10)

#1 @azaozz
2 months ago

Happens because the autoupdate state is not set/changed after successfully saving the setting.

@azaozz
2 months ago

#2 @azaozz
2 months ago

In 50291.diff: Change the state of the auto-update link after the new setting has been saved. This works similarly to updateTheme and deleteTheme, uses a custom event in the AJAX response to communicate the new state.

#3 @azaozz
2 months ago

  • Keywords has-patch added

#4 @pbiron
2 months ago

The incorrect behavior can also be seen by, instead of closing and reopening the modal, navigating to the next/prev theme and then navigating back.

The patch seems to fix the problem. I've got one minor change, will upload a new patch in a minute.

@pbiron
2 months ago

same as 50291.diff, but uses a yoda condition in the wp-auto-update-setting-changed callback

#5 @pbiron
2 months ago

@desrosj can you please confirm that 50291.1.diff fixes the problem for you?

#6 @desrosj
2 months ago

@pbiron It does! Confirmed closing and reopening the theme's details overlay as well as navigating with the arrows to the next theme and back. I did not reviewed the contents of the patch, just tested.

#7 @pbiron
2 months ago

  • Keywords commit added

#8 @azaozz
2 months ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In 47883:

Plugins and Themes Auto-Updates: update the state of the auto-update link on the themes screen after successfully saving the setting.

Props desrosj, pbiron, azaozz.
Fixes #50291.

Note: See TracTickets for help on using tickets.