CommentFileSizeAuthor
#53 3143958-53-subprofile-support-10.3.x.patch35.88 KBkavya n n
#51 3143958-51-subprofile-support-10.2.x.patch57.61 KBsivakarthik229
#50 3143958-subprofile-support-10.2.x.patch57.6 KBsivakarthik229
#48 3143958-subprofile-support-10.1.x.patch58.9 KBramprassad
#47 3143958-47-subprofile-support-10.0.x.patch58.93 KBramprassad
#46 lightning-n3143958-12-95x.patch2.32 KBdamienmckenna
#44 3143958-44-subprofile-support-9.5.x.patch59.22 KBmanikandank03
#40 3143958-40-subprofile-support-9.5.x.patch58.97 KBniels de ruijter
#39 3143958-39-subprofile-support-9.5.x.patch59.29 KBniels de ruijter
#37 3143958-33-subprofile-support-9.4.x.patch37.61 KBmei2020
#33 3143958-33-subprofile-support-9.5.x.patch58.43 KBs_leu
#25 3143958-25-subprofile-support-9.3.x.patch60.02 KBsunlix
#15 3143958-15-subprofile-support-9.1.x.patch56.93 KBphenaproxima
#14 3143958-14-subprofile-support-9.2.x.patch58.5 KBphenaproxima
#13 3143958-13-subprofile-support-9.2.x.patch58.5 KBphenaproxima
#12 3143958-12-change-profile-config-sync-9.1.x.patch2.24 KBphenaproxima
#11 3143958-11-subprofile-support-8.9.x.patch57.39 KBphenaproxima
#10 3143958-10-change-profile-config-sync-9.1.x.patch2.24 KBphenaproxima
#9 3143958-9-change-profile-config-sync-9.1.x.patch2.14 KBphenaproxima
#8 3143958-8-change-profile-config-sync-9.1.x.patch812 bytesphenaproxima
#7 3143958-7-media_entity_instagram_source_field_check.patch1.21 KBphenaproxima
#6 3143958-6-subprofile-support-9.1.x.patch57.84 KBphenaproxima
#5 3143958-5-subprofile-support-9.1.x.patch56.45 KBphenaproxima
#4 3143958-4-subprofile-support-9.1.x.patch58.37 KBphenaproxima
#2 9.0.x-suppress_theme_function_error.patch934 byteskatherined

Issue fork lightning-3143958

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

katherined created an issue. See original summary.

katherined’s picture

Status: Active » Needs review
StatusFileSize
new934 bytes
katherined’s picture

Status: Needs review » Active
phenaproxima’s picture

StatusFileSize
new58.37 KB
phenaproxima’s picture

StatusFileSize
new56.45 KB

Note to self...

This is a variant of the previous patch which modifies ModuleExtensionList so that, when it scans for extensions, it includes all profiles, not just the active one and its parents.

This is needed because when a subprofile is installed, it and all of its ancestors are added to core.extension. When the "base profile" key is removed from a subprofile -- either the active one, or any of the ones in the ancestry -- suddenly some or all the ancestors cannot be found, which breaks a lot of things (like the status report page, or the update system). Because to Drupal, these are effectively installed modules which, as far as the extension system can tell, do not exist.

So this gets around that the only way that seems truly safe: by treating all profiles as modules.

phenaproxima’s picture

StatusFileSize
new57.84 KB

Here's yet another variant of the patch, but a bit cleaner. It's similar to what I did in #5, except that it doesn't bring all profiles into the module space; just the ancestors of the current profile (if an ancestry chain is defined), or all currently installed profiles (which Drupal treats as modules anyway). This should allow subprofiles to smoothly decouple themselves from Lightning, without Drupal suddenly freaking out about missing extensions when the base profile key is removed.

phenaproxima’s picture

phenaproxima’s picture

Here's a patch that modifies ConfigImportSubscriber so that the profile can be changed from Lightning to something else during a config sync. This is to make it easier to uninstall Lightning.

phenaproxima’s picture

This should fix additional problems that cropped up in testing. It only applies on top of the sub-profile patch in #6.

phenaproxima’s picture

Same thing as #9 but it deals with Headless Lightning too.

phenaproxima’s picture

StatusFileSize
new57.39 KB

Reroll of #6 for 8.9.x.

phenaproxima’s picture

phenaproxima’s picture

StatusFileSize
new58.5 KB
phenaproxima’s picture

StatusFileSize
new58.5 KB
phenaproxima’s picture

StatusFileSize
new56.93 KB
jurriaanroelofs’s picture

Hello @phenaproxima,

For me the lightning 5.1.7 build is failing with this error message:

Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2020-12-15/3143958-6-subprofile-support-9.1.x.patch

                                                                                                                      
  [Exception]                                                                                                         
  Cannot apply patch [subprofile support] 1356276 - Allow profiles to define a base/parent profile and load them in   
  the correct order / 2914389 - Allow profiles to exclude dependencies of their parent (https://www.drupal.org/files  
  /issues/2020-12-15/3143958-6-subprofile-support-9.1.x.patch)!   

I see you have created an updated version of the patch in this thread, but it's not committed to 5.1.x yet:

https://git.drupalcode.org/project/lightning/-/blob/5.1.x/composer.json#L97

Would updating this line solve the problem?

phenaproxima’s picture

Thanks for pointing that out, @JurriaanRoelofs. I had rerolled the patch in preparation for 9.1.10, but missed the actual release! I just rolled Lightning 5.1.8 to fix this.

jurriaanroelofs’s picture

@phenaproxima Thanks for the quick fix!

abhinand gokhala k’s picture

This patch #14 is not working for Drupal 9.2

loopy1492’s picture

Patch #14 is also not working for Drupal 9.3.

I unignored docroot/core so I could get a list of what worked and what did not...

Successful:

modified: docroot/core/includes/install.core.inc
modified: docroot/core/includes/install.inc
modified: docroot/core/lib/Drupal/Core/Config/ConfigInstaller.php
modified: docroot/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php
modified: docroot/core/lib/Drupal/Core/Config/InstallStorage.php
modified: docroot/core/lib/Drupal/Core/EventSubscriber/ConfigImportSubscriber.php
modified: docroot/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
modified: docroot/core/lib/Drupal/Core/Extension/ModuleExtensionList.php
modified: docroot/core/lib/Drupal/Core/Extension/ModuleInstaller.php
modified: docroot/core/lib/Drupal/Core/Extension/ProfileExtensionList.php
modified: docroot/core/modules/system/src/Form/ModulesUninstallForm.php
modified: docroot/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php
modified: docroot/core/tests/Drupal/Tests/Core/Database/DatabaseTest.php
modified: docroot/core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php

Rejected:

docroot/core/core.services.yml.rej
docroot/core/includes/install.inc.rej
docroot/core/lib/Drupal/Core/Config/ConfigInstaller.php.rej
docroot/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php.rej
docroot/core/lib/Drupal/Core/Config/InstallStorage.php.rej
docroot/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php.rej
docroot/core/lib/Drupal/Core/Installer/InstallerProfileExtensionList.php
docroot/core/modules/config/tests/src/Functional/ConfigImportBaseInstallProfileTest.php
docroot/core/modules/system/src/Form/ModulesUninstallForm.php.rej
docroot/core/profiles/testing_inherited/
docroot/core/profiles/testing_subsubprofile/
docroot/core/tests/Drupal/KernelTests/Core/Extension/ProfileExtensionListTest.php

gaurav_manerkar’s picture

@phenaproxima Can you please roll out a patch for 9.3

jurriaanroelofs’s picture

@gaurav.manerkar this project is abandoned so that won't happen.

What we've done instead is to fork Lightning and hardcode it to use Drupal 9.2.
You can make your own fork and do the same, or do something else like updating or removing faulty patches.
You can also simply use our Lightning fork which is fixed to Drupal 9.2: https://github.com/dxpr/lightning

(You can install it and update to 9.3 afterwards without problems)

gaurav_manerkar’s picture

Hi,

We are not using lightning anymore. Lightning uninstall command had applied the patch to composer.json file. The patch is not getting applied to 9.3

rajab natshah’s picture

sunlix’s picture

StatusFileSize
new60.02 KB

I spend some time to get the 9.2 patch compatible with 9.3 incl. the deprecation warnings by the test suite.
I hope this is useful for all who are on the migrating path to drop lightning with the current Drupal core version.

gaurav_manerkar’s picture

Hi,

What is the purpose of this patch?

chop’s picture

Issue summary: View changes
chop’s picture

Issue summary: View changes

This patch causes the following error in Drupal 9.3.6

Fatal error: Cannot redeclare Drupal\Core\Config\ConfigInstaller::$profileList in docroot/core/lib/Drupal/Core/Config/ConfigInstaller.php on line 68

The patch adds a duplicate Drupal\Core\Config\ConfigInstaller::$profileList property.

Is this patch even needed anymore? Should it be re-rolled or is it not needed?

chop’s picture

Amending my statement above. I just found out that we've applied two patches that add Drupal\Core\Config\ConfigInstaller::$profileList. They may even be from this same issue. Apologies. Clearly we have some problems of our own here.

chop’s picture

After running drush pm:uninstall lightning as instructed in Uninstalling Lightning the acquia/lightning patches were clashing with the same patches included in our root project. This caused the following error in Drupal when we ran things like drush updatedb or drush config:import.

Fatal error: Cannot redeclare Drupal\Core\Config\ConfigInstaller::$profileList in docroot/core/lib/Drupal/Core/Config/ConfigInstaller.php on line 68

Adding the following lines to the composer.json extras section fixed a problem. It was caused by double-patching of the ConfigInstaller.php

        "patches-ignore": {
            "drupal/lightning_core": {
                "drupal/core": {
                    "2869592 - Disabled update module shouldn't produce a status report warning": "https://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch"
                }
            },
            "acquia/lightning": {
                "drupal/core": {
                    "2869592 - Disabled update module shouldn't produce a status report warning": "https://www.drupal.org/files/issues/2020-02-07/2869592-remove-update-warning-34.patch",
                    "[subprofile support] 1356276 - Allow profiles to define a base/parent profile and load them in the correct order / 2914389 - Allow profiles to exclude dependencies of their parent": "https://www.drupal.org/files/issues/2021-05-20/3143958-14-subprofile-support-9.2.x.patch",
                    "REMOVE: 2031261 - Fix SQLite variable limit": "https://www.drupal.org/files/issues/2021-02-07/2031261-137.patch",
                    "REMOVE: Allow installation profile to be changed from Lightning during config sync": "https://www.drupal.org/files/issues/2021-01-21/3143958-12-change-profile-config-sync-9.1.x.patch"
                }
            }
        }

Hopefully this helps anyone else who runs into a similar problem. After we get this build to Production we'll be removing the acquia/lightning package altogether. Until then the patches-ignore is needed.

Raghav kumar’s picture

Hi Team,

Looking for patch for Drupal 9.4.0 and above:
"9.3[subprofile support] 1356276 - Allow profiles to define a base/parent profile and load them in the correct order / 2914389 - Allow profiles to exclude dependencies of their parent": "https://www.drupal.org/files/issues/2022-01-17/3143958-25-subprofile-support-9.3.x.patch"

lecabori’s picture

Hi guys,
I need some help here. I was trying to upgrade to Drupal 9.4.1 (from v9.3.12) but the update produced this error:

Cannot apply patch #3143958: get the 9.2 patch compatible with 9.3 incl. the deprecation warnings by the test suite (https://www.drupal.org/files/issues/2022-01-17/3143958-25-subprofile-sup...)!

I then tried to remove the patch and this new error was issued:

Cannot apply patch REMOVE: Allow installation profile to be changed from Lightning during config sync (https://www.drupal.org/files/issues/2021-01-21/3143958-12-change-profile...)!

If I remove the above then this:

Cannot apply patch [subprofile support] 1356276 - Allow profiles to define a base/parent profile and load them in the correct order / 2914389 - Allow profiles to exclude dependencies of their parent (https://www.drupal.org/files/issues/2021
-05-20/3143958-14-subprofile-support-9.2.x.patch)!

s_leu’s picture

Status: Active » Needs review
StatusFileSize
new58.43 KB

Here's a re-roll applying on 9.4.x and 9.5.x (so far)

kssundar’s picture

9.5.x patch gets applied correctly on 9.4.5. But when installing the profile (drush si -vvv), I get the below error:

Undefined variable $parser install.inc:1138

Error: Call to a member function parse() on null in install_profile_info() (line 1138 of /var/www/html/local.drupals.com/docroot/core/includes/install.inc)

Full stacktrace below:

[warning] Undefined variable $parser install.inc:1138 [1.79 sec, 21.64 MB]
 [error]  Error: Call to a member function parse() on null in install_profile_info() (line 1138 of /var/www/html/local.drupals.com/docroot/core/includes/install.inc) #0 /var/www/html/local.drupals.com/docroot/core/includes/install.core.inc(1533): install_profile_info()
#1 /var/www/html/local.drupals.com/docroot/core/includes/install.core.inc(464): install_load_profile()
#2 /var/www/html/local.drupals.com/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php(204): install_begin_request()
#3 /var/www/html/local.drupals.com/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php(83): Drush\Commands\core\SiteInstallCommands->determineProfile()
#4 [internal function]: Drush\Commands\core\SiteInstallCommands->install()
#5 /var/www/html/local.drupals.com/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array()
#6 /var/www/html/local.drupals.com/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#7 /var/www/html/local.drupals.com/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#8 /var/www/html/local.drupals.com/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process()
#9 /var/www/html/local.drupals.com/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#10 /var/www/html/local.drupals.com/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run()
#11 /var/www/html/local.drupals.com/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#12 /var/www/html/local.drupals.com/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#13 /var/www/html/local.drupals.com/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run()
#14 /var/www/html/local.drupals.com/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
#15 /var/www/html/local.drupals.com/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run()
#16 /var/www/html/local.drupals.com/vendor/drush/drush/drush(4): require('...')
#17 {main}. [1.79 sec, 21.77 MB] 
Error: Call to a member function parse() on null in /var/www/html/local.drupals.com/docroot/core/includes/install.inc on line 1138 #0 /var/www/html/local.drupals.com/docroot/core/includes/install.core.inc(1533): install_profile_info()
#1 /var/www/html/local.drupals.com/docroot/core/includes/install.core.inc(464): install_load_profile()
#2 /var/www/html/local.drupals.com/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php(204): install_begin_request()
#3 /var/www/html/local.drupals.com/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php(83): Drush\Commands\core\SiteInstallCommands->determineProfile()
#4 [internal function]: Drush\Commands\core\SiteInstallCommands->install()
#5 /var/www/html/local.drupals.com/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array()
#6 /var/www/html/local.drupals.com/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#7 /var/www/html/local.drupals.com/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#8 /var/www/html/local.drupals.com/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process()
#9 /var/www/html/local.drupals.com/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#10 /var/www/html/local.drupals.com/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run()
#11 /var/www/html/local.drupals.com/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#12 /var/www/html/local.drupals.com/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#13 /var/www/html/local.drupals.com/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run()
#14 /var/www/html/local.drupals.com/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
#15 /var/www/html/local.drupals.com/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run()
#16 /var/www/html/local.drupals.com/vendor/drush/drush/drush(4): require('...')
#17 {main}
Error: Call to a member function parse() on null in install_profile_info() (line 1138 of /var/www/html/local.drupals.com/docroot/core/includes/install.inc).
 [warning] Drush command terminated abnormally. [1.79 sec, 21.79 MB]
debasish147’s picture

@s_leu, I think below two services needs to be add in patch before using $parser and $profile_path in install_profile_info() method, so that it won't give undefined variable error and code will work correctly during profile installation.

$profile_path = \Drupal::service('extension.list.profile')->getPath($profile);
/** @var \Drupal\Core\Extension\InfoParserInterface $parser */
 $parser = \Drupal::service('info_parser');
Raghav kumar’s picture

I applied the 9.5.x patch with Drupal Core:9.4.8: https://www.drupal.org/files/issues/2022-07-13/3143958-33-subprofile-sup...
After patched applied I am still getting the below error

[warning] Undefined variable $parser install.inc:1138

 [error]  Error: Call to a member function parse() on null in install_profile_info() (line 1138 of /mnt/tmp/local.prod/source/docroot/core/includes/install.inc) #0 /mnt/tmp/local.prod/source/docroot/core/includes/install.core.inc(1533): install_profile_info()
#1 /mnt/tmp/local.prod/source/docroot/core/includes/install.core.inc(464): install_load_profile()
#2 /mnt/tmp/local.prod/source/docroot/core/includes/install.core.inc(116): install_begin_request()
#3 /mnt/tmp/local.prod/source/vendor/drush/drush/includes/drush.inc(129): install_drupal()
#4 /mnt/tmp/local.prod/source/vendor/drush/drush/includes/drush.inc(113): drush_call_user_func_array()
#5 /mnt/tmp/local.prod/source/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php(152): drush_op()
#6 [internal function]: Drush\Commands\core\SiteInstallCommands->install()
#7 /mnt/tmp/local.prod/source/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array()
#8 /mnt/tmp/local.prod/source/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#9 /mnt/tmp/local.prod/source/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#10 /mnt/tmp/local.prod/source/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process()
#11 /mnt/tmp/local.prod/source/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#12 /mnt/tmp/local.prod/source/vendor/symfony/console/Application.php(1039): Symfony\Component\Console\Command\Command->run()
#13 /mnt/tmp/local.prod/source/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand()
#14 /mnt/tmp/local.prod/source/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#15 /mnt/tmp/local.prod/source/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run()
#16 /mnt/tmp/local.prod/source/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
#17 /mnt/tmp/local.prod/source/vendor/drush/drush/drush.php(77): Drush\Runtime\Runtime->run()
#18 /mnt/tmp/local.prod/source/vendor/drush/drush/drush(4): require('...')
#19 /mnt/tmp/local.prod/source/vendor/bin/drush(120): include('...')
#20 {main}. 
mei2020’s picture

StatusFileSize
new37.61 KB

re-rolled 9.5 patch with https://www.drupal.org/project/lightning/issues/3143958#comment-14655703, if it is helpful for anyone.

mrP’s picture

Is there a patch working for Drupal 9.5.1? Thanks!

niels de ruijter’s picture

StatusFileSize
new59.29 KB

Re-rolled to patch for 9.5.x.

niels de ruijter’s picture

Issue summary: View changes
StatusFileSize
new58.97 KB

Removed unnecessary comment change in patch that was preventing the patch from applying to 9.5.1 & 9.5.2.
Still applies on 9.5.x.

niels de ruijter’s picture

Issue summary: View changes
uberengineer’s picture

Unfortunately doesn't apply to drupal/core 9.5.4

manikandank03’s picture

I am also facing the same issue in drupal/core 9.5.4, patch #40 not applying

manikandank03’s picture

StatusFileSize
new59.22 KB

Re-rolled patch to support the latest Drupal core 9.5.5

hande-itconsulting’s picture

Isso ainda é necessário no 9.5.9? Continuo recebendo erro nessa versão, ao executar composer update.

damienmckenna’s picture

ramprassad’s picture

StatusFileSize
new58.93 KB

Re-rolled the #44 patch to support the latest Drupal core 10.x

ramprassad’s picture

StatusFileSize
new58.9 KB

Re-rolled the #44 patch to support the latest Drupal core 10.1.x

m.managoudis made their first commit to this issue’s fork.

sivakarthik229’s picture

StatusFileSize
new57.6 KB

Re-rolled the #48 patch to support the latest Drupal core 10.2.x

sivakarthik229’s picture

StatusFileSize
new57.61 KB

Fixes drush command error for the patch present in #50

manikandank03’s picture

Thanks sivakarthik229,

The patch #51 works fine with latest Drupal 10.2.2 with PHP 8.2

kavya n n’s picture

StatusFileSize
new35.88 KB

Re-rolling the patch for 10.3.x