PHP Warning when exporting config

Created on 17 July 2024, 9 months ago
Updated 11 September 2024, 7 months ago

Problem/Motivation

Hi,

I am doing the update from core 10.2.7 to 10.3.1 and config profile 1.1.0 to 2.0.0-beta1 on a project.

After updating the codebase and executing drush updb, I have exported the config to update my custom profile config.

During drush cex execution, I got the following line like 780 times:

[warning] foreach() argument must be of type array|object, null given ConfigProfileSubscriber.php:163

Proposed resolution

Looking at the lines in the file:

    $blacklistProperty = $this->profileInfo['blacklist_property'];
    foreach ($blacklistProperty as $blacklistItem) {

I guess this was due to the transition with blacklist_property feature introduced in the 2.0.x branch.

Maybe a missing hook_update to ensure existing websites get the new config entry.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇷France Grimreaper France 🇫🇷

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Grimreaper
  • 🇫🇷France Grimreaper France 🇫🇷
  • 🇫🇷France Grimreaper France 🇫🇷

    I will try to provide an update hook.

  • Assigned to Grimreaper
  • 🇫🇷France Grimreaper France 🇫🇷
  • Issue was unassigned.
  • Status changed to Needs review 9 months ago
  • 🇫🇷France Grimreaper France 🇫🇷
  • Pipeline finished with Success
    9 months ago
    Total: 161s
    #226642
  • Status changed to RTBC 9 months ago
  • 🇮🇳India riddhi.addweb

    When I applied the patch, I didn't see any errors only warnings were displayed and it was same for without patch, in that only warnings were displayed.

    FILE: /var/www/html/web/drupal10_3/web/modules/contrib/config_profile/src/EventSubscriber/ConfigProfileSubscriber.php
    ---------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------
     143 | WARNING | The use of function fnmatch() is discouraged
    ---------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/web/drupal10_3/web/modules/contrib/config_profile/README.md
    -------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    -------------------------------------------------------------------------------
      3 | WARNING | Line exceeds 80 characters; contains 104 characters
     14 | WARNING | Line exceeds 80 characters; contains 110 characters
    -------------------------------------------------------------------------------
    
    
  • Thank you for the contribution
    PR has been merged to 2.0.x
    It will be rolled out in next release.

  • Pipeline finished with Skipped
    8 months ago
    #266489
  • Status changed to Fixed 8 months ago
  • 🇫🇷France Grimreaper France 🇫🇷

    Thanks @naveenvalecha

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024