WordPress.org

Make WordPress Core

Opened 6 weeks ago

Last modified 3 weeks ago

#50849 new defect (bug)

Incorrect action passed to hooks when updating plugin/theme by uploading ZIP file

Reported by: desrosj Owned by:
Milestone: 5.5.2 Priority: normal
Severity: normal Version: 5.5
Component: Upgrade/Install Keywords: has-patch needs-testing
Focuses: Cc:

Description

When a plugin or theme is being upgraded or downgraded by uploading a new zip file as added in #9757, the action passed in $hook_extra to the upgrader_process_complete action hook is always install, regardless of the action being taken.

Attachments (1)

50849.diff (1.6 KB) - added by desrosj 6 weeks ago.

Download all attachments as: .zip

Change History (8)

@desrosj
6 weeks ago

#1 @desrosj
6 weeks ago

  • Milestone changed from Awaiting Review to 5.5.1

It seems the upgrader_process_complete hook is run twice: once when the zip file is uploaded, and again when the actual overwrite takes place after clicking the proceed button.

50849.diff is fixing the second but not the first. I think, ideally, the hook should not fire when uploading a file to update a plugin or theme as the process is no actually complete.

If the decision is to continue firing it in both spots, then $hook_extra should pass along more information as to where the process is at.

#2 @desrosj
5 weeks ago

  • Version changed from trunk to 5.5

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


4 weeks ago

#4 @johnbillion
4 weeks ago

  • Keywords needs-testing added

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


3 weeks ago

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


3 weeks ago

#7 @desrosj
3 weeks ago

  • Milestone changed from 5.5.1 to 5.5.2

With 5.5.1 being a shorter cycle, punting this so it can receive proper attention.

Note: See TracTickets for help on using tickets.