Closed (fixed)
Project:
Drupal core
Version:
8.2.x-dev
Component:
install system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Nov 2015 at 17:17 UTC
Updated:
25 Oct 2016 at 11:14 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
nils.destoop commentedI can confirm this issue. It's occurring when you have a module set in dependencies, and the module doesn't exist.
When a module is not existing. This should be added to the requirements array that is returned in drupal_check_profile.
Comment #3
no_angel commentedCan you please provide the steps to reproduce the issue.
Comment #4
nils.destoop commentedUse profile in attachment. This will trigger an error (the menu module doesn't exist)
Comment #5
nils.destoop commentedComment #6
cilefen commentedThis seems like a drush issue.
Comment #7
no_angel commentedMaybe similar to: https://www.drupal.org/node/1971072?https://www.drupal.org/node/1971072#comment-10687236 thanks @zuuperman
Comment #8
nils.destoop commentedIt's not a drush issue. I also had this error when installing via the browser.
Comment #9
cilefen commented@zuuperman The issue summary reads "via drush". Can you update it please?
Comment #10
nils.destoop commentedNever noticed the drush in description. Seems like another issue then, because he is also having it with copies of minimal / standard.
Comment #11
pfrenssenIt would be better to throw an exception with a helpful message, something like this.
Comment #12
pfrenssenComment #14
sandervd commentedThe path in #11 does indeed makes it a lot more obvious what the problem is...
Comment #15
sqndr commented+1 for the error message!
Comment #16
nlisgo commentedComment #17
nlisgo commentedGoing to see if I can recreate the issue in a test and I will expect an error message.
Comment #18
nlisgo commentedI have a test only patch and a patch which incorporates the code from #11 with the minor adjustment of using the InstallerException.
Comment #19
nlisgo commentedComment #20
nlisgo commentedI have placed the tests in the wrong location. I will prepare the patches again
Comment #21
nlisgo commentedComment #22
nlisgo commentedComment #26
nlisgo commentedGood news that the test only failed and the test+fix passed testing. I will do more work on this to improve the Exception and perhaps create a new Exception for this which extends InstallerException.
Comment #27
neclimdulNice work! I'm quite a fan of clear exceptions and like your idea.
Since this is the only thing you are testing, the @expectedException and @expectedExceptionMessage annotations in the docblock make more sense. https://phpunit.de/manual/current/en/appendixes.annotations.html#appendi...
Comment #28
nlisgo commentedThanks for the feedback @neclimdul, I wasn't even aware of the annotations. It works perfectly.
I am attaching a screenshot of the message that is display to the end user when they encounter this issue as well as the new patch for review.
Credit due to @mariancalinro who helped review my patch in person at Dev Days.
Comment #29
nlisgo commentedComment #30
nlisgo commentedComment #31
malcomio commentedWith the patch applied, the installer UI will only list a single missing dependency at a time, even if there are many dependencies.
It would be better to list all the missing dependencies, the way that Drupal 7 did.
Comment #32
jhedstromThis would be possible by first verifying all dependencies (similar to how config finds missing dependencies), and then throwing an exception (or using an assertion) listing all of them.
Comment #34
aleevasI'm attaching a screenshot of the message that is display to the end user when they encounter this issue as well as the new patch for review.
Comment #36
andypostI think the idea is to have more then one dependent module so exception will list them all
Comment #37
gaydabura commentedComment #39
dagmarIt seems interdiff from #37 is not quite real. I applied the changes from interdiff #37 in patch #34.
Comment #41
dagmarThis should fix the remaining test.
Comment #42
andypostLooks good to go
Comment #45
br0kenComment #46
nlisgo commentedI'm going to review this patch.
Comment #47
nlisgo commentedThis looks good to me. I've read through the code and cannot spot anything that would raise concern.
This is a major improvement on the approach initially proposed which throws an Exception when the first missing dependency is detected. It now displays all missing dependencies along side all other requirement problems.

Comment #48
ifrikJust changing the issue tag for consistency. Don't credit me for that.
Comment #49
alimac commentedComment #50
alimac commentedComment #51
neclimdulwhy?
Enough for what? There's an @see where I can probably figure it out but the comment should tell us what does the keys existence actually tell us?
Is there a reason to use array_key_exists instead of
isset($module_list[$module])? i.e. does the code care about a set null value for some reason?Comment #52
br0ken$module_listwill definitely contain...". And@seeannotation available as well.Comment #53
neclimdul1) No, why did you change the spacing on the documentation but not change the documentation.
2) I did. that doesn't tell me that "enough" is. what does its existence mean?
3) then use isset instead of array_key_exists and don't be rude.
Comment #54
br0ken@seereference there. Execution of(new ExtensionDiscovery())->scan()will return an array of\Drupal\Core\Extension\Extension.array_key_existsand not going to do this now.Bringing it back to RTBC since no blockers here.
P.S. I'm sorry.
Comment #55
neclimdulI don't agree that this is RTBC and that's generally the reviewers role in core issues.
1) That's what I figured. Border is not a documentation problem though. It'd be fine to use that in new docs but lets leave the old one's alone. Smaller patch for committer to review and more likely to go in quickly and keeps the blame history more concise.
2) Right, I could follow it. But why would we rely on that when we could just tell people the existence of the key tells us the module doesn't exist and we don't want to run the registration code when that's the case. That's will be a lot more useful to future developers looking at this. Also, I missed it in my first review but we require FQDN on @see annotations.
3) Cool, it is being added in this patch which is why I reviewed it. The actual fix for the issue even ;). Drupal avoids array_key_exists unless its absolutely necessary for various reasons and will be a red flag for most maintainers so lets not use it here.
Comment #56
andypostRTBC++
I worried only about
there was array_key_exists() for reason
Last time I debugged this key was in array but value was NULL
Comment #57
neclimdulCool! NULL is not a valid extension so if there where NULL values in the array isset is actually fixing an additional bug.
Comment #58
nlisgo commentedI support the changes too. Thanks for weighing in @neclimdul.
Comment #59
br0ken@andypost, @neclimdul
NULLis impossible there sincescan()method of\Drupal\Core\Extension\ExtensionDiscoveryhas only one return from it -return $this->process($files);. So, if you follow to theprocess()method, you'll see that there is triggering thegetName()method for each extension... So, fatal error will be earlier than you'll seeNULL.Let's finish with this. RTBC+
Comment #61
catchCommitted/pushed to 8.3.x, thanks!
This looks fine for a patch release, so setting 'to be ported' against 8.2.x for cherry-pick once 8.2.0 is out.
Comment #63
catchCherry-picked to 8.2.x