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.
Problem/Motivation
In a multilingual custom installation profile, our profile installation, fails during the translations import with the following error:
PHP Fatal error: Call to a member function getId() on null in ...modules/contrib/address/src/Repository/CountryRepository.php on line 104.
Proposed resolution
Added an if statement and a default return value.
Remaining tasks
It needs further review.
Comment | File | Size | Author |
---|---|---|---|
#2 | address-multilingual-profile-install-error-2689279-D8.patch | 642 bytes | hostdog |
Comments
Comment #2
hostdog CreditAttribution: hostdog commentedComment #3
bojanz CreditAttribution: bojanz commentedThis seems to be a core bug, see: #2684873: ConfigurableLanguageManager::getConfigOverrideLanguage() returns NULL.
Comment #4
hostdog CreditAttribution: hostdog commentedThank you bojanz for the info.
Comment #5
GrimreaperHello,
I have the same problem but only when using "drush site-install".
If I have my language.entity.fr.yml in the config/install directory of my install profile, it works. But if I put it into mydistrib_core module it fails only using CLI, in the web UI it works.
Thanks @bojanz for pointing to the core issue.
Comment #7
bojanz CreditAttribution: bojanz commentedPushed a workaround based on the one added to Commerce.
Comment #9
kenorb CreditAttribution: kenorb commented