Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#29425 closed defect (bug) (fixed)

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

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

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 12 years ago.
29425.diff​ (1.4 KB ) - added by dd32 12 years ago.
29425.2.diff​ (709 bytes ) - added by DrewAPicture 12 years ago.
typo

Download all attachments as: .zip

Change History (12)

#1 @SergeyBiryukov
12 years ago

Might be related to #29230.

@ocean90
12 years ago

#2 @ocean90
12 years ago

  • Keywords has-patch added
  • Milestone Awaiting Review → 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
12 years ago

  • Version trunk → 3.7

#4 @ocean90
12 years ago

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

#5 @nacin
12 years ago

  • Priority normal → highest omg bbq
  • Severity normal → blocker

#6 @dd32
12 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
12 years ago

#7 @dd32
12 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 custom 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.

Last edited 12 years ago by dd32 (previous) (diff)

#8 @nacin
12 years ago

  • Keywords commit dev-reviewed added

#9 @dd32
12 years ago

  • Owner set to dd32
  • Resolution → fixed
  • Status new → 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
12 years ago

typo

Note: See TracTickets for help on using tickets.