After upgrading to Drupal 10.2, my website won't work anymore because getDescription signature of ConfigEntityDescriptionTrait is not compatible with EntityDisplayModeBase class
Edit: Erratum, the issue is only on 10.2. Composer installed 10.2-alpha instead of 10..1.7 for no good reason.
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | 3408813-lightning_core-fatal_error-27.patch | 880 bytes | mariaannuar |
| #21 | lightning-core-config-entity-description.patch | 985 bytes | drupalam |
| #9 | 3408813_fatal_type_declaration.patch | 551 bytes | goldfit |
Issue fork lightning_core-3408813
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
arnaud-brugnon commentedHere's a fix
Comment #4
arnaud-brugnon commentedComment #6
viren18febs commentedI have resolved the issue & added patch, please review.
Comment #7
ckhaliloMust add string as Type of function getDescription()
public function getDescription() :string {
You can simply add (string) in return
return (string) $this->getThirdPartySetting('lightning_core', 'description');
Environment
- PHP8.2
- D10.2
Comment #8
goldfitI have resolved the issue with the provided changes.
Comment #9
goldfitPatch without the header informations :)
Comment #10
siddharthjain commentedThe patch shared in #9 applies smoothly. Thanks for the patch @Goldfit
Comment #11
tommasorandazzo+1 to patch in #9.
Comment #12
tommasorandazzoComment #13
tommasorandazzoComment #14
alina.basarabeanu commentedWe came across the same error after upgrading to Drupal core 10.2.
The patch provided by #9 fixed the issue.
Please add this to a new stable release.
Comment #15
ananthakrishnan.kr commentedAfter upgrading to Drupal core 10.2 we also came across the same error.
Patch #9 fixed the issue.
Comment #16
manikandank03 commentedI am also facing the same issue after upgrade Drupal 10.2.2 with PHP 8.2 and tried this patch #9, the issue fixed now and site was working fine.
Comment #17
samlerner commentedThe patch in #9 worked for me as well, upgrading to 10.2 with PHP 8.1. Thanks!
Comment #20
rajeshreeputraCreated MR for quick merge.
Comment #21
drupalam commentedI ran into this issue with the `lightning_core` module following an upgrade of Drupal from version 10.1.8 to 10.3.1. Unfortunately, patch number 9 was ineffective for me because I needed to fix both functions in the `ConfigEntityDescriptionTrait.php` file. The patch provided below resolved the problem and I will create a Merge Request to make it permanent.
Comment #23
baluertlComment #24
baluertlIt is now tested, +1 for RTBC. Even
$ drush en lightning_coreresults in an exception which makes the entire site unusable.Unfortunately, the main repo still believes
8.x-5.xas the default branch. However, a newer version of this module has already been released from another branch with a higher version number (6.x). This confusion caused both merge requests here still target the “legacy”8.x-5.xbranch. Only users opening the MR are allowed to re-target to the correct development HEAD – I did not find an option on GitLab GUI to do so.Also, marking as a blocker of #3369498: Automated Drupal 11 compatibility fixes for lightning_core + enable GitLab CI.
Comment #25
baluertlComment #26
puregin commented@drupalam, sorry to be weighing in on this late in the game, but we have in
core/lib/Drupal/Core/Entity/EntityDescriptionInterface.phpthe following:It seems that
setDescription()returns$this(an EntityDescriptionInterface), so trying to coerce the result to a string as in #21 is going to give a type error, unless I'm missing something.Comment #27
mariaannuar commented@puregin was correct! Here’s a solution to this
Comment #28
rafal.sereda commentedHi - just a double confirmation note from my side, that the 2 comments above are correct. #20 worked for me, #27 should work too, the #21 results with an error when saving new View Mode.
Comment #29
kreynen commentedLate to this party, but I just ran into this upgrading a D9 site. #27 worked for me on 10.5.1. Always grateful when fixes are so easy to find. THANKS!
Comment #32
balsamab6f1efec608edb87c3838e55855678b6cad873c3