Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#50291 closed defect (bug) (fixed)

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

Reported by: azaozz's profile azaozz Owned by: azaozz's profile 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 5 years ago.
50291.1.diff (2.3 KB) - added by pbiron 5 years 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
5 years ago

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

@azaozz
5 years ago

#2 @azaozz
5 years 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
5 years ago

  • Keywords has-patch added

#4 @pbiron
5 years 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
5 years ago

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

#5 @pbiron
5 years ago

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

#6 @desrosj
5 years 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
5 years ago

  • Keywords commit added

#8 @azaozz
5 years 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.