During drush rr ctools_registry_files_alter() starts the process, which receives warning "Attempt to read property "language"

Created on 3 June 2022, over 2 years ago
Updated 23 August 2023, over 1 year ago

Conditions:
Contrib modules enabled:

- ctools;
- bean;
- entity;
- panelizer;
- panels;
- entity;

Version php8.0.

Steps to reproduce:
Run drush rr command.
We see warnings- in console:
[warning]
Attempt to read property "language" on null common.inc:7950
[warning]
Attempt to read property "language" on null node.module:707
Please see screenshot console.png.
During investigation I found, that problem was on php7.4 ( hidden notice), but on php8.0 we have Warnings(see above). It arises after call registry_rebuild() in drush_registry_rebuild() on the DRUSH_BOOTSTRAP_DRUPAL_DATABASE level after bootstrap_invoke_all('registry_rebuild'). Then call function drupal_alter('registry_files', $files, $modules) . There is global variable $language is empty. Please see screenshot with call stack on this level (please see screenshot DRUSH_BOOTSTRAP_DRUPAL_DATABASE.png).
But after drush_bootstrap_to_phase(DRUSH_BOOTSTRAP_DRUPAL_FULL) on DRUSH_BOOTSTRAP_DRUPAL_FULL and call registry_rebuild() global variable $language is object of stdClass(please see screenshot DRUSH_BOOTSTRAP_DRUPAL_FULL.png).
So I suggest to add check in ctools_registry_files_alter():

  if (drupal_get_bootstrap_phase() < DRUPAL_BOOTSTRAP_FULL) {
    return;
  }
🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇧🇾Belarus alena_stanul

Live updates comments and jobs are added and updated live.
  • PHP 8.0

    The issue particularly affects sites running on PHP version 8.0.0 or later.

  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024