Opened 10 years ago
Last modified 6 years ago
#30497 reopened defect (bug)
Impossible to change upgrader skin when Language_Pack_Upgrader is instanciated via Language_Pack_Upgrader::async_upgrade()
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Upgrade/Install | Keywords: | needs-patch |
Focuses: | Cc: |
Description
WP-CLI uses its own upgrader skin class (WP_CLI\UpgraderSkin) to remove HTML from the strings that are displayed to the users.
But it is not possible to change the upgrader skin when Language_Pack_Upgrader is instanciated via Language_Pack_Upgrader::async_upgrade() resulting in the problem described in the issue below:
https://github.com/wp-cli/wp-cli/issues/1501
The attached patch implements a possible solution for this adding a filter to change the upgrader skin class name. I'm not sure if this is the best way to fix this or if we should refactor this method and the way it is called to add the upgrader skin class as a parameter.
Attachments (1)
Change History (7)
#1
@
10 years ago
- Keywords 2nd-opinion added
- Milestone changed from Awaiting Review to Future Release
#2
@
9 years ago
- Resolution set to invalid
- Status changed from new to closed
@danielbachhuber and I can't reproduce anymore the WP-CLI issue that led me to open this ticket (https://github.com/wp-cli/wp-cli/issues/1501#issuecomment-240537508). It seems that this was fixed somehow on WP core so I'm closing this ticket.
#4
@
6 years ago
- Resolution invalid deleted
- Status changed from closed to reopened
I can still reproduce this:
wordpress$ wp core update --minor Updating to version 5.1.1 (fi)... Using cached file '/home/tessanekakontti/.wp-cli/cache/core/wordpress-5.1.1-fi.zip'... Puretaan päivitystä... <p>Joihinkin käännöksiin on saatavilla päivityksiä. Malta vielä muutama hetki, niin päivitämme nekin.</p> <div class="update-messages lp-show-latest"><h2>Päivitetään käännöksiä: WordPress (sv_SE)…</h2><p>Ladataan käännöstä osoitteesta <span class="code">https://downloads.wordpress.org/translation/core/5.1.1/sv_SE.zip</span>…</p> <p>Puretaan päivitystä…</p> <p>Asennetaan viimeisintä versiota…</p> <p>Poistetaan käännöksen vanhaa versiota.</p> <p>Käännöksen päivitys onnistui.</p> </div><script type="text/javascript"> (function( wp ) { if ( wp && wp.updates && wp.updates.decrementCount ) wp.updates.decrementCount( "translation" ); } })( window.wp ); </script> Success: WordPress updated successfully. wordpress$ wp core update --minor Success: WordPress is at the latest minor release. wordpress$ cp -ra /data/backups/data/wordpress/htdocs . wordpress$ wp core update --minor Updating to version 5.1.1 (fi)... Using cached file '/home/tessanekakontti/.wp-cli/cache/core/wordpress-5.1.1-fi.zip'... Puretaan päivitystä... <p>Joihinkin käännöksiin on saatavilla päivityksiä. Malta vielä muutama hetki, niin päivitämme nekin.</p> <div class="update-messages lp-show-latest"><h2>Päivitetään käännöksiä: WordPress (sv_SE)…</h2><p>Ladataan käännöstä osoitteesta <span class="code">https://downloads.wordpress.org/translation/core/5.1.1/sv_SE.zip</span>…</p> <p>Puretaan päivitystä…</p> <p>Asennetaan viimeisintä versiota…</p> <p>Poistetaan käännöksen vanhaa versiota.</p> <p>Käännöksen päivitys onnistui.</p> </div><script type="text/javascript"> (function( wp ) { if ( wp && wp.updates && wp.updates.decrementCount ) wp.updates.decrementCount( "translation" ); } })( window.wp ); </script>Success: WordPress updated successfully.
I'd prefer to use dependency injection here and add a method to
Language_Pack_Upgrader
which sets the language pack upgrader skin class. Thoughts?