WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#29425 closed defect (bug) (fixed)

Plugin update: Translation update fails with "Invalid Data provided"

Reported by: pavelevap Owned by: dd32
Milestone: 4.0 Priority: highest omg bbq
Severity: blocker Version: 3.7
Component: I18N Keywords: has-patch commit dev-reviewed
Focuses: Cc:

Description

When updating plugin from Plugins screen, there is following message: "Invalid Data provided." during automatic language packs update. When updating the same plugin through Dashboard - Updates, then everything works.

Attachments (3)

29425.patch (750 bytes) - added by ocean90 5 years ago.
29425.diff (1.4 KB) - added by dd32 5 years ago.
29425.2.diff (709 bytes) - added by DrewAPicture 5 years ago.
typo

Download all attachments as: .zip

Change History (12)

#1 @SergeyBiryukov
5 years ago

Might be related to #29230.

@ocean90
5 years ago

#2 @ocean90
5 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.0

The message comes from Plugin_Upgrader::deactivate_plugin_before_upgrade() where $plugin['plugin'] is empty.

29425.patch goes the same, drastic way as [29621].

#3 @ocean90
5 years ago

  • Version changed from trunk to 3.7

#4 @ocean90
5 years ago

  • Summary changed from Language updates problem from Plugins page to Plugin update: Translation update fails with "Invalid Data provided"

#5 @nacin
5 years ago

  • Priority changed from normal to highest omg bbq
  • Severity changed from normal to blocker

#6 @dd32
5 years ago

Four filters are used:

  • upgrader_source_selection handled by [29621]
  • upgrader_pre_install handled by 29425.patch
  • upgrader_clear_destination used to delete old plugins prior to plugin install. Should be cleared too IMHO.
  • upgrader_post_install used for parent theme installs. No idea if this will cause issues, but might as well clear it too?

@dd32
5 years ago

#7 @dd32
5 years ago

upgrader_pre_install handled by 29425.patch​

All testing shows that this is indeed a problem, and the patch indeed does fix it. I can't find anything wrong with it.

upgrader_clear_destination used to delete old plugins prior to plugin install.

This one isn't triggered as 'clear_destination' is set to false in the Translation update call.

upgrader_post_install used for parent theme installs. No idea if this will cause issues, but might as well clear it too?

The Theme_Upgrader::check_parent_theme_filter method gets called for the Translation update, but it passes in the event the parent theme has been installed, Ideally this shouldn't be run, as although it degrades gracefully for me, I can't say it'll always be so.

When you take the above into account with someone using a customer upgrader in a premium theme or similar, we can't trust anything hooked to these filters, so we should just blow them all away IMHO. 29425.diff does just that.

Version 0, edited 5 years ago by dd32 (next)

#8 @nacin
5 years ago

  • Keywords commit dev-reviewed added

#9 @dd32
5 years ago

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

In 29685:

Language Pack Upgrader: Remove ALL pre-existing filters before performing a translation update these filters may act in an unexpected way during the upgrade process.
See #29230. Fixes #29425.

@DrewAPicture
5 years ago

typo

Note: See TracTickets for help on using tickets.