WordPress.org

Make WordPress Core

#46997 closed defect (bug) (fixed)

Theme update links show in Customizer and don't work

Reported by: desrosj Owned by: desrosj
Milestone: 5.2.2 Priority: normal
Severity: normal Version:
Component: Customize Keywords: has-patch has-screenshots commit dev-reviewed
Focuses: multisite Cc:

Description

When using the Customizer on a multisite install and browsing themes, a link to update shows but produces a JavaScript error when clicked.

TypeError: wp.updates is undefined

Installing themes for multisite was officially disabled in [38887]. An update notice shows on the Theme Details view but the link is omitted. The same approach should be used here.

Looks like the thumbnail preview checks that there is an update, but not for the presence of update information, so the link always shows.

Attachments (8)

46997.diff (1009 bytes) - added by desrosj 20 months ago.
multisite-with-update-detail-view.png (366.3 KB) - added by desrosj 20 months ago.
multisite-with-update-thumbnail.png (247.2 KB) - added by desrosj 20 months ago.
single-site-with-update-detail-view.png (404.5 KB) - added by desrosj 20 months ago.
update-now-button-gone-single-site.png (256.2 KB) - added by earnjam 19 months ago.
46997.2.diff (1.0 KB) - added by mukesh27 18 months ago.
Updated patch.
46997.3.diff (1001 bytes) - added by garrett-eclipse 18 months ago.
Minor Refresh to convert printf to multi-line function and moved translator comments inside.
46997.4.diff (1.0 KB) - added by earnjam 18 months ago.
Small CS fix for 46997.3.diff

Download all attachments as: .zip

Change History (23)

@desrosj
20 months ago

#1 @desrosj
19 months ago

  • Keywords needs-testing added

#2 @earnjam
19 months ago

46997.diff gets rid of the Update Now link on single site too when viewing all of the themes in the Customizer in thumbnail view. See screenshot above

#3 @desrosj
19 months ago

  • Keywords needs-refresh added
  • Milestone changed from 5.2.1 to 5.2.2
  • Owner set to desrosj
  • Status changed from new to assigned

Going to punt this one so it can get a refresh and more testing.

#4 @mukesh27
18 months ago

@desrosj, As tested by @earnjam i got same error for 46997.diff patch.

data.update variable does not got any value for single installation or in multisite installation.

Instead of that can we check if current site is multisite or not in /wp-includes/customize/class-wp-customize-theme-control.php then it will resolve above issue for me.

Check below attached patch.

@mukesh27
18 months ago

Updated patch.

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


18 months ago

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


18 months ago

#7 @audrasjb
18 months ago

@desrosj @earnjam
46997.2.diff looks good on my side. Could we expect a peer review (we need two committers since we are in RC workflow) for tomorrow so this ticket coul ship with 5.2.2 RC2?

@garrett-eclipse
18 months ago

Minor Refresh to convert printf to multi-line function and moved translator comments inside.

#8 @garrett-eclipse
18 months ago

  • Keywords needs-refresh removed

Reviewing I made a minor refresh in 46997.3.diff to make the printf a multi-line function and moved it's translator comment inside

@earnjam
18 months ago

Small CS fix for 46997.3.diff

#9 @earnjam
18 months ago

Looks like the later patches solved the issue of still allowing updating theme from the customizer in single site. In 46997.4.diff I just made a small CS fix to 46997.3.diff.

I think this is ready to go, but I'm not a committer, so we need @desrosj and one more to sign off on it.

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


18 months ago

#11 @desrosj
18 months ago

  • Keywords commit dev-feedback added; needs-testing removed

This looks good! Going to commit this to trunk now.

Marking dev-feedback for a second review before backporting.

#12 @azaozz
18 months ago

  • Keywords dev-feedback removed

46997.4.diff looks good here.

#13 @desrosj
18 months ago

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

In 45527:

Customize: Remove “Update” link for themes on multisite installs.

In [38887], installing themes in the Customizer was disabled for multisite installs. However, an update link continues to be displayed when a theme update is available. Clicking the link causes a JavaScript error.

This removes that update link because updates cannot actually be performed in the Customizer in this situation.

Props desrosj, earnjam, mukesh27, audrasjb, garrett-eclipse.
Fixes #46997.

#14 @desrosj
18 months ago

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

Thanks, @azaozz! Reopening for backporting to 5.2.

#15 @desrosj
18 months ago

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

In 45528:

Customize: Remove “Update” link for themes on multisite installs.

In [38887], installing themes in the Customizer was disabled for multisite installs. However, an update link continues to be displayed when a theme update is available. Clicking the link causes a JavaScript error.

This removes that update link because updates cannot actually be performed in the Customizer in this situation.

Reviewed by desrosj and azaozz.
Merges [45527] to the 5.2 branch.

Props desrosj, earnjam, mukesh27, audrasjb, garrett-eclipse.
Fixes #46997.

Note: See TracTickets for help on using tickets.