Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.Starting in Drupal 8, installation profiles can live under subdirectories under profiles/. These might commonly be profiles/contrib or profiles/custom. Provision doesn't currently recurse into subdirs when searching for profiles, and so these are missed.
A good example of a platform that does this is Thunder.
Original bug report by SocialNicheGuru:
I am not sure if this is only my install
I import a platform
The sites were imported
I imported the databases
But the only profile in the profiles directory that can be read is standard
I have openatrium in the profiles directory with 'chmod -R 777 openatrium' and the system does not read the folder at all.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | provision-profiles_subdir-2650290-16.patch | 13.13 KB | ergonlogic |











Comments
Comment #2
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedComment #3
helmo CreditAttribution: helmo at Initfour websolutions commentedSo if you go to the 'Packages' tab of your platform and select type=installation profile, you do not see openatrium?
I just tried... added openatrium to an existing platform, ran verify, and it was found.
The log of your platform's verify task might contain clues ... it reports on the number of found modules. Search for "Found install profile standard".
Comment #4
colanIn my case, I had a profile in /profiles/custom/, not simply at /profiles. It seems like the code in _provision_find_profiles() is only looking at the top level. So I'm guessing that's the problem found above.
This function needs to be rewritten to account for the convention of putting profiles in contrib and custom subdirectories, just like the convention for doing this with modules/.
We should probably be using file_scan_directory() here instead.
Comment #5
colanMoving to proper queue.
Comment #6
ergonlogicThrough Drupal 7 (at least) profiles can't be placed in subdirectories: https://api.drupal.org/api/drupal/includes%21install.core.inc/function/i....
I think the original report has more to do with how a site import determines the proper profile. In http://api.aegirproject.org/api/Provision/platform%21drupal%21import_7.i..., we default to 'standard' is the 'install_profile' variable isn't set. Perhaps that was causing this issue?
Comment #7
colanI'm not sure about 7, but I have /profiles/custom/... working fine in Drupal 8 outside of Aegir. Want me to open a new issue for this so we can set this one back?
Comment #8
ergonlogicWe should probably try to untangle that code, and move _provision_find_profiles() to the version-specific engines.
In D8, this is done on line 420 of core/includes/install.core.inc:
Comment #9
dman CreditAttribution: dman at Sparks Interactive commentedThanks for the explanation as to why this is in #6 ergonlogic
It's slightly new behaviour, yes, but the assumption it would would work also makes sense.
This is hitting us, as we start building things with
https://github.com/drupal-composer/drupal-project
and
https://github.com/acquia/lightning-project
The composer-based build, for consistency(?) reasons, wants to place the things of type 'drupal-project' into the folder 'profiles/contrib' by default
(Tweaking our composer.json to not do that provides a work-around https://github.com/drupal-composer/drupal-project/blob/8.x/composer.json... )
Is already there an issue here in provision that's already allowing recursive searches within the /profiles dir?
Comment #10
memtkmcc CreditAttribution: memtkmcc at Omega8.cc commented@dman For drupal-composer specific issue, check #2736801: Support Composer for platform builds
Comment #11
GrimreaperHello,
Here is a patch that add the custom and contrib sub dir. I refactored the detection function to have 'required' and 'optional' profiles directories.
Thanks for the review.
Comment #12
ergonlogicThanks for the patch, @Grimreaper.
I'm not sure this is the right approach, since we'd be hard-coding
contribandcustomin this case.For example, in _provision_drupal_find_modules() we use drush_scan_directory() to recursively scan for files ending in
.module. I think we could do something similar for profiles. This is a little more complicated in D8, since we no longer require a.profile(see theminimalandtestingprofiles.) However, profiles'.info.ymlwill contain:type: profile.I think the best bet here is to begin by moving _provision_find_profiles() into
packages_6.incandpackages_7.inc, and stripping out the D8-specific stuff. Similary, move it topackages_8.incstripping out the legacy stuff. Then we can start re-factoring the D8 code more aggressively.Comment #13
ergonlogicUpdated the issue description, since we'd hijacked it pretty thoroughly.
Comment #14
ergonlogicI've begun refactoring as I described above in the dev/2650290 branch. While profiles in subdirectories are now found, packages within those profiles are not.
Comment #15
ergonlogicSimilarly, themes in profiles under subdirectories are also skipped. It looks like _provision_drupal_search_paths() (and maybe also _provision_find_packages() and _provision_drupal_find_modules()) should get similar treatment. That is, split out into the version-specific package includes, and re-factored from there.
Comment #16
ergonlogicHere's a consolidated patch of the various commits I've made to the dev/2650290 branch.
Comment #17
helmo CreditAttribution: helmo at Initfour websolutions commentedSeems to be working OK, I have it on my feature/quick-review branch now.
Let's try to get this in before #2841435: [meta] 3.10 release (bugfix/patches)
Comment #18
colanCode looks good, but haven't had a chance to try it.
Comment #19
helmo CreditAttribution: helmo at Initfour websolutions commentedMerged