Closed (fixed)
Project:
Drupal core
Version:
8.8.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Sep 2017 at 06:31 UTC
Updated:
1 Mar 2020 at 09:57 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
claudiu.cristeaComment #3
claudiu.cristeaRenamed
::getArchiver()to a more meaningful::getArchiverByFile(). Replaced a reference to the deprecated function.Comment #4
claudiu.cristeaComment #5
claudiu.cristeaComment #8
claudiu.cristeaComment #9
claudiu.cristeaRerolled. Fixed version, added deprecated error triggers, CR and others.
Comment #10
fenstratThis looks good, as does the CR. Manually verified all instances of
archiver_get_extensions()andarchiver_get_archiverare gone.Comment #12
alexpottMisspelt.
I'm not sure that this is worth having in the API. We replace this with
\Drupal::service('plugin.manager.archiver')->getInstance(['filepath' => $filepath])and make it the caller's responsibility to have a real path. Since looking at update_manager_file_get() which provides the path for the only real usage in core I think this will return paths that will work with\Drupal::service('plugin.manager.archiver')->getInstance(['filepath' => $filepath])Comment #13
andypostThere's 8 usages in contrib http://grep.xnddx.ru/search?text=archiver_get_archiver and all of it targeted for local file.
2 of them using to make "realpath" conversion before calling the function.
I think it needs to change docs of
getInstance()to point thatfilepathis required key in configuration to instantiate plugin (probably needs follow-up)Re-rolled and and trying to implement #12
As
getInstance()supposed to work on local files only I'm sure it just needs to be documented somehowComment #14
andypostAlso it needs deprecation test and update change record
Comment #15
berdirThese need to do the "NULL dance". optional argument, if (!$file_system), then fetch from \Drupal::service() and do a @trigger_error().
Comment #16
vacho commentedSolved "NULL dance" for ArchiverManager::construct()
Comment #17
vacho commentedUpload interdiff
Comment #18
vacho commentedComment #19
alexpottIs this needed? I can't see where it is used.
Comment #20
YurkinPark commentedNote fixed
Comment #21
andypostAdd test and clean-up messages
Comment #22
andypostvalid path
Comment #25
andypostFix codestyle & uncomment test
Still can't figure why tests fails
Comment #26
andypostsadly missed that
Comment #29
andypoststill applies
Comment #31
mile238.8.x now.
Otherwise LGTM.
Comment #32
naveenvalechaAddressed #31
We're doing the change in the constructor in a form. However, forms are internal but in the recent issues I have worked on we preserve the BC so that the contrib that extends it doesn't break. So I looked at its usage http://grep.xnddx.ru/search?text=UpdateManagerInstall&filename= and it's not used in contrib apart from portfolio_theme module which committed the drupal core in the repo. Also, there are few other modules which are altering the module so we're good with respect to this change.
Comment #33
kim.pepperSince we have the create() pattern here, I think it's fine to not do a trigger_error for the additional parameter.
Comment #34
larowlanreview credits
Comment #36
larowlanCommitted fc301d8 and pushed to 8.8.x. Thanks!
published change record
Comment #38
dwwNote: y'all broke the Update Manager's ability to install from .zip files with this change.
#3101299: Install module from .zip URL fails
// Archivers can only work on local pathsThis comment in archiver_get_archiver() was trying to say that \ZipArchive::open() can't handle file streams at all. We absolutely need the call to
realpath(), which is now gone.I don't understand why the new service doesn't do this for you automatically, and we force the callers to have to worry about this.
But if we're forcing callers to worry about it, we failed to properly do this in
update_manager_file_get(). It's still returning paths like:temporary://update-cache-edd502a3/pathauto-8.x-1.6.zipI'll be the first to admit that update.module's tests are sorely lacking in all sorts of ways.
Obviously, way too late to revert this now, so I guess we'll just fix it at #3101299 and backport the fix.
I'd greatly appreciate it if any of you who were involved here would be willing to help out over there, especially with input on where/how to add tests for this so we don't break it again.
Thanks!
-Derek
Comment #39
dwwp.s. For now, I edited the CR to match what the final patch here did, and to include the warning about callers needing to use realpath():
https://www.drupal.org/node/2999951/revisions/view/11422137/11767365