Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Description
When running database updates via drupal console the following notice occurs:
Notice: Undefined variable: profile in /var/www/drupal/docroot/core/modules/system/system.module on line 1054
How to reproduce
drupal update:execute
Comment | File | Size | Author |
---|---|---|---|
#2 | drupal-undefined_variable_profile-2939062-2.patch | 536 bytes | stefanos.petrakis@gmail.com |
Comments
Comment #2
stefanos.petrakis@gmail.comAnd a patch for this.
Comment #3
borisson_Are we sure we need to fix this in core? Shouldn't this be fixed in drupal console?
Comment #4
stefanos.petrakis@gmail.comThis is a core issue IMO, since the
_system_rebuild_module_data()
function (https://github.com/drupal/drupal/blob/8.5.x/core/modules/system/system.m...) is not instantiating an expected variable as it should.However, it looks that this was deprecated in 8.5.0 (missed that part) and is therefore fixed (https://www.drupal.org/node/2709919).
Comment #5
borisson_Does #4 mean that we can close this issue?
Comment #6
stefanos.petrakis@gmail.comIt is still relevant for 8.4.x, therefore, IMO still an open issue. (till 8.4.x reaches end of life).
Comment #7
stefanos.petrakis@gmail.comCorrection, still relevant for both 8.5.x and 8.4.x (checked the codes of latest dev versions)
Comment #8
cilefen CreditAttribution: cilefen as a volunteer commentedBecause I keep hearing things like #6, I would like to call attention to the release cycle overview. Under current policy, the prior minor release is end-of-life on the day a new minor is released. But note:
Comment #9
stefanos.petrakis@gmail.comCorrection to #6: 8.4.x has reached end of life. The submitted patch still applies to 8.4.x
This issue will remain relevant till the end-of-life of 8.5.x (September 5, 2018).
Comment #10
joachim CreditAttribution: joachim as a volunteer commented> This is a core issue IMO, since the _system_rebuild_module_data() function (https://github.com/drupal/drupal/blob/8.5.x/core/modules/system/system.m...) is not instantiating an expected variable as it should.
Has this maybe already been fixed?
I've looked at both 8.5.x and 8.4.x, and in both cases, _system_rebuild_module_data() has this right near the top, about 5 lines in:
Comment #11
cilefen CreditAttribution: cilefen as a volunteer commented@joachim: In 8.6.x,
_system_rebuild_module_data()
was deprecated and replaced with a call to\Drupal::service('extension.list.module')->reset()->getList()
in #2208429: Extension System, Part III: ExtensionList, ModuleExtensionList and ProfileExtensionList.Comment #12
joachim CreditAttribution: joachim as a volunteer commentedSure, but in 8.4.x and 8.5.x, I can't see the problem that this issue is about.
Comment #13
cilefen CreditAttribution: cilefen as a volunteer commented@joachim I totally agree. $profile is already set to something in that function before this occurs, so of course it is defined in scope.
To be sure, I just executed all the updates from 8.4.x to 8.5.x and there is not a notice.
If we can get steps to reproduce this, let's reopen it. But since this function is deprecated, we shouldn't spend too much effort on it.
Thanks all!