Closed (duplicate)
Project:
Drupal core
Version:
10.1.x-dev
Component:
extension system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Jun 2016 at 08:58 UTC
Updated:
23 Dec 2022 at 14:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mpotter commentedHere is a patch that applies to 8.2.x. The only conflict from the previous issue thread patch was the comments added to ExtensionDiscovery.
Still need to add the tests using the virtual file system. But marking this for Review to see how the other Drupal automated tests work.
Comment #3
naveenvalechafix the patch with some changes.converted teh test to kernel test base
KernelTestBase will not remain in simpletest after 8.2.x #2734663: Update deprecation message for old KernelTestBase in simpletest :( so Moving to unit tests
Comment #5
abhishek-anand commentedComment #6
abhishek-anand commentedSome minor corrections.
Comment #7
mpotter commentedStarting to try and use this patch for a real distro and running into an issue.
If you try to enable modules in the base_profile in the main profile info.yml file, it seems to fail. When I look at my settings.php file, it isn't writeable so the code in the install.core.inc file wasn't able to take the base_profile from the info.yml and add the profile_directories line to the settings.php.
Comment #8
mpotter commentedTracked part of the problem down to drupal_check_profile() which loops through the dependencies and calls getPath on each one. At this early point of the profile install, nothing has been added to settings.php so the profile_directories haven't been added for the base profile. So if you reference a module within the base profile in the main profile.info.yml it will cause the error:
If I manually add the profile_directories array to settings.php then it gets past this error.
Comment #9
das-peter commented@mpotter just posted a patch which should solve this: #1356276-158: Allow profiles to define a base/parent profile
Comment #10
mpotter commentedThe patch in #158 of the parent issue #1356276: Allow profiles to define a base/parent profile is great for solving the overall profile inheritance issue. But the purpose of this issue is to split off the code that just sets the profile_directories via $settings into a simple issue that can easily be tested and applied to 8.2.x.
I have re-rolled the patch from #5 that has the new vfStream test (thanks abhishek-anand!!) and have removed the code that writes to the settings.php using the base_profile key. That kind of code needs to stay in the larger parent issue.
I think this is now nice and clean. We have a really straight-forward way to add additional paths to the settings for profile_directories. This code will be needed by the larger parent issue for inheriting profiles. We have a good test for it. Let's try to get this RTBC'd and into 8.2.x so we can focus effort on the larger parent issue.
Edited: To be really clear...all we are doing in this patch is implementing what the existing function setProfileDirectoriesFromSettings() implies that it should be doing.
Comment #11
mpotter commentedComment #12
jhedstromThis is looking good. Quite straightforward approach, and the added test illustrates the behavior.
A few tiny issues:
Nit: one of the
@params is missing, and they both need short descriptions.Can you add a code comment here to clarify why this is unset? It isn't immediately obvious I don't think.
Similar to above, this needs
@paramdescriptions, and also a short one-liner description at the top of the docblock.Comment #13
mpotter commentedThe new approach I just posted to #1356276: Allow profiles to define a base/parent profile no longer actually uses this method. Will keep this open for a while longer but I think we've got a cleaner method now in the original issue.
Comment #27
smustgrave commentedThis appears to be a duplicate of https://www.drupal.org/project/drupal/issues/3266057 which is way further along. Closing this one out and moving credit over.