- 🇺🇸United States jim.shreds
Running into this on a fresh 9.5.3 install while running upgrade_d7_block import within the --tag=Configuration and --execute-dependencies workflow.
error now on line 113
Error: Call to a member function getLabel() on null in /app/web/core/modules/layout_builder/src/Plugin/Derivative/FieldBlockDeriver.php on line 113 #0 /app/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\layout_builder\Plugin\Derivative\FieldBlockDeriver->getDerivativeDefinitions(Array)
- 🇺🇸United States kdmdrupal
I have hit this issue as well when running drush cim for Drupal 9.5.2 to verify migration process steps.
[warning] Undefined array key "body" FieldBlockDeriver.php:102
Error: Call to a member function getLabel() on null in /web/core/modules/layout_builder/src/Plugin/Derivative/FieldBlockDeriver.php on line 113 #0 /web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\layout_builder\Plugin\Derivative\FieldBlockDeriver->getDerivativeDefinitions()
We have been developing and trying to apply our changes. Any suggestions?
- 🇺🇸United States kdmdrupal
Freddy I got the patch to work for 9.5.2 via composer update --lock [painful because it remove Drupal 9.5.2 core and then I had to run command again to install 9.5.2 back]. The drush cim worked afters and our changes were applied. Some errors, but it was due missing components which need to be imported into migration verification sandbox.
NOTE: I would of git apply but the layout_builder didn't have the directory/class for were the patch was being applied.
I will update our Drupal repo to the last version of 9.5.x and run again to make sure all goes smooth next time.
Thank you again for your assistance.
- Status changed to RTBC
over 1 year ago 8:30am 7 April 2023 - 🇳🇱Netherlands spokje
Ok, going for broke here...
Looking at #156 💬 Workaround for "Call to a member function getLabel() after enabling layout_builder" Fixed where @longwave states:
As this appears to be a common point of failure for a number of users, I think it is OK to add protection here to avoid a fatal error at this point, even if we don't currently know root cause (or there could be multiple root causes).
and seeing that patch #153 💬 Workaround for "Call to a member function getLabel() after enabling layout_builder" Fixed seems to provide such a fatal CLUNK avoidance for many people and the code does look like it does, I'm going to mark this RTBC.
- 🇺🇸United States tim.plunkett Philadelphia
Would have been nice if any of the people commenting here had helped to work on 🐛 Prevent leftover fields from causing errors like "Call to a member function getLabel() after enabling layout_builder" Active instead.
- last update
over 1 year ago 29,283 pass - last update
over 1 year ago 29,300 pass - last update
over 1 year ago 29,302 pass - last update
over 1 year ago 29,300 pass - last update
over 1 year ago 29,343 pass - last update
over 1 year ago 29,361 pass - last update
over 1 year ago 29,366 pass - last update
over 1 year ago 29,367 pass - 🇬🇧United Kingdom longwave UK
Discussed this with @catch. Given that numerous people have hit this issue since Drupal 8.5, and after several years we don't have a real fix for it, we think that committing this workaround that at least prevents a fatal error is the pragmatic thing to do. I tried to credit everyone who either helped with any aspect of the actual bug, or reported that the fix worked for them.
Committed and pushed 4b2afe955d to 10.1.x and ba543b96b2 to 10.0.x and b05f3fa775 to 9.5.x. Thanks!
-
longwave →
committed ba543b96 on 10.0.x
Issue #2985882 by tim.plunkett, Mirakolous, ravi.shankar, ayush9598,...
-
longwave →
committed ba543b96 on 10.0.x
-
longwave →
committed 4b2afe95 on 10.1.x
Issue #2985882 by tim.plunkett, Mirakolous, ravi.shankar, ayush9598,...
-
longwave →
committed 4b2afe95 on 10.1.x
- Status changed to Fixed
over 1 year ago 1:40pm 2 May 2023 -
longwave →
committed b05f3fa7 on 9.5.x
Issue #2985882 by tim.plunkett, Mirakolous, ravi.shankar, ayush9598,...
-
longwave →
committed b05f3fa7 on 9.5.x
- 🇬🇧United Kingdom catch
We should also explore #2940755-54: block_content block derivatives do not scale to thousands of block_content entities → , not directly related to the cause of the bug but would have prevented this being a site down issue and an improvement for various other reasons.
Automatically closed - issue fixed for 2 weeks with no activity.