Problem/Motivation
Installing a module or a theme using the UI, it tries to determine it's a theme by checking for a file that ends in *.module.
/**
* Implements Drupal\Core\Updater\UpdaterInterface::canUpdateDirectory().
*/
static function canUpdateDirectory($directory) {
// This is a lousy test, but don't know how else to confirm it is a theme.
if (file_scan_directory($directory, '/.*\.module$/')) {
return FALSE;
}
return TRUE;
}
This is inadequate, the module page_manager doesn't have that file so it ends up in the theme directory.
Proposed resolution
Find the info.yml file and read the type.
Remaining tasks
Write patch to fix this issue.
- Write tests to prove this is broken/won't happen again.
User interface changes
N/A
API changes
N/A
Comments
Comment #1
joelpittetHere's one fix that works.
Comment #2
joelpittetComment #3
joelpittetThis one is a bit better and removes the @todo that was there.
Comment #4
joelpittetNeeds this patch to test #2042447-58: Install a module user interface does not install modules (or themes)
Comment #6
vj commented@joelpittet: This patch works but requires this #2042447-58: Install a module user interface does not install modules (or themes)
Tried omega theme to upload it moved to themes folder
then tried a custom module without .module file and it moved to modules folder.
Note* : Still error exists which i have mentioned in #2042447-60.
Comment #7
joelpittet@Vj yes it does, but I need someone to help with the batch API related changes in that one. I'd like this to go in regardless as it's a somewhat separate issue.
Comment #8
alexpottComment #9
joelpittetComment #10
joelpittetComment #12
tim.plunkettThis is shared code and there is a base class. how about a protected static function getExtensionInfo($directory) ?
Can this be rewritten to one line?
@covers is only for phpunit, and doesn't use () or .
public function
Comment #13
star-szrComment #14
joelpittetThanks @tim.plunkett.
Comment #15
tim.plunkettHas test coverage, fix looks good!
Comment #16
catchha!
Committed/pushed to 8.0.x, thanks!