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.
When using the Address module with commerceguys/intl v0.7.3 the system gives an error on installation of Open Social.
Error: Access level to Drupal\address\Repository\CountryRepository::getDefaultLocale() must
be public (as in class CommerceGuys\Intl\Country\CountryRepository) in
/var/www/html/modules/contrib/address/src/Repository/CountryRepository.php, line 16
This is due to the fact that the access level of getDefaultLocale() method in the LocalResolverTrait has been changed to public: https://github.com/commerceguys/intl/commit/1a394eaa338f71c67af9bd1a00f4...
This trait is used in CommerceGuys\Intl\Country\CountryRepository which is extended in Drupal\address\Repository\CountryRepository.
This method should be made public in Drupal\address\Repository\CountryRepository as well.
Comment | File | Size | Author |
---|---|---|---|
#11 | address-public-defaultlocale-2822309-11.patch | 500 bytes | di3gopa |
#2 | address-2822309.patch | 652 bytes | jaapjan |
Comments
Comment #2
jaapjan CreditAttribution: jaapjan as a volunteer and for Open Social commentedComment #4
bojanz CreditAttribution: bojanz at Centarro commentedImproved the fix and committed, thanks!
I'll tag RC3 within the next 24h.
Comment #5
keboca CreditAttribution: keboca as a volunteer commentedGood catch! #2 works just fine! thanks @jaapjan & @bojanz
Comment #6
FlutterStack CreditAttribution: FlutterStack at Azri Solutions commentedGood catch! #2 works just fine! thanks @jaapjan & @bojanz
Comment #7
Polly CreditAttribution: Polly commentedBeginner question: On linux I am hoping to use this patch following this tutorial. I am unsure from which directory I should apply this patch. I tried:
How do I apply this patch?
Or do I understand correctly that I should soon be able to pick up this fix running composer drupal-update (I've just tried with no luck)?
Comment #8
ilya.no CreditAttribution: ilya.no as a volunteer and at Skilld commented@Polly, instead of
cd vendor/commerceguys/
you should navigate to module's directory, i.e.cd modules/address
.Comment #9
Polly CreditAttribution: Polly commented@ilya.no Thank you very much. The patch worked for me.
Comment #10
di3gopa CreditAttribution: di3gopa at Rootstack commentedI can Confirm that the patch works.
Comment #11
di3gopa CreditAttribution: di3gopa at Rootstack commentedAttaching a patch that works with 1.0-beta3 in case someone needs it.
Comment #12
alexrayu CreditAttribution: alexrayu commentedSubscribing. Appreciate #11.
Comment #13
bojanz CreditAttribution: bojanz at Centarro commentedWhy? There is no reason for anyone to patch an older Address version. Use the latest code.
Comment #14
dpalmer CreditAttribution: dpalmer commentedGetting this error on the 8.x-1.0-rc3. I don't even see this getDefaultLocale function in the src/Repository/CountryRepository.php to patch it...
I tried the dev branch and same issue.
What am I doing wrong?
Comment #15
bojanz CreditAttribution: bojanz at Centarro commented@dpalmer You probably tried to update Address outside of Composer, and now your library versions are out of sync. "composer update drupal/address --with-dependencies" is the only way.
Comment #16
dpalmer CreditAttribution: dpalmer commented@bojanz ah thanks, that did the trick!