Make WordPress Core

Opened 4 months ago

Last modified 4 months ago

#62212 new defect (bug)

If you update a plugin from the details modal, it no longer updates the main page

Reported by: siliconforks's profile siliconforks Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.5
Component: Plugins Keywords:
Focuses: Cc:

Description

If you visit the "Plugins" page in the admin section and there is a plugin update available, the following text will be displayed:

There is a new version of [the plugin's name] available. View version [the plugin's latest version] details or update now.

If you click the "View version ... details" link, a modal dialog box (using an iframe) will be displayed with a button to perform the update.

Before WordPress 6.5, this button was labeled "Install Update Now". If you clicked the button, the modal would close, the text on the main page would change to "Updating..." and then finally this text would change to "Updated!" when the update was completed.

In WordPress 6.5 and later, the button is labeled "Update Now" (and has a different appearance). If you click the button, the modal does not close, but the text on the button changes to "Updating..." and then finally "Updated!" If you close the modal, you will see that the main page has not changed at all: the plugin still displays the old version with the same "There is a new version of [the plugin's name] available..." text. You have to manually reload the page in order to see that the plugin has been updated to the new version.

Is this behavior intentional? Probably the change in the button label and appearance was intentional (but that's not very important). Keeping the modal open during the update might be intentional (although I preferred the old behavior). But failing to update the main page seems like a bug, or at least a significant regression in functionality compared to earlier versions.

Change History (1)

#1 @siliconforks
4 months ago

Note that the old JavaScript code for handling the click on the "Install Update Now" button was never removed - it is still present in 6.5 and later (including the latest trunk version), even though the code never gets executed any more.

https://github.com/WordPress/wordpress-develop/blob/6e7acb0103ce64bcd0b66d22cb0efb6249028004/src/js/_enqueues/wp/updates.js#L3212

That is just dead code now, since the plugin_update_from_iframe ID no longer exists.

Note: See TracTickets for help on using tickets.