On Drupal 8.8.5
When I upgrade the Entity Construction Kit (ECK) module from 8.x-1.0-beta1 to 8.x-1.0-beta2
I get multipuls of the following error message:
User depreciated function:
You are using the 'entity' variable in your eck-entity template.
You should use 'content' instead.
The 'entity' variable will be removed before the release of 8.x-1.0-beta1 in Drupal\eck\ArrayDepreciationWrapper->offsetExists()
(line 45 of modules/contrib/eck/src/ArrayDepreciationWrapper.php).
this also has
(line 80 of modules/contrib/eck/src/ArrayDepreciationWrapper.php).
I have tried putting it on my test system with Drupal 8.9.0 and I am getting the same error.
Which template file is it looking at? ( Where is the template file?)
How do I fix this so I dont get this error going forward?
Thank you
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3153909-5.patch | 623 bytes | matroskeen |
Comments
Comment #2
legolasboTake a look at issue #3007181. That error was introduced there to warn people that are still using the deprecated 'entity' key in their templates/preprocess functions. You should be using the 'content' key instead.
Comment #3
thuthuka commentedHi legolasbo
Thanks for the pointer to the issue https://www.drupal.org/project/eck/issues/3007181
Just for any one else who ends up here:
The eck template that should be under
modules/contrib/eck/templates/eck-entity.html.twig
may contain
needs to be changed to
In my case the "Bricks Default" module requires eck (Entity Construction Kit)
and this was already set in the template under
modules/contrib/bricks/templates/eck-entity--brick.html.twig
and contained
and I had to change it to
Comment #4
legolasbo@Thuthuka,
I'd like to recommend that you open an issue for the "Bricks Default" module to change their template.
Comment #5
matroskeenThe deprecation message says "The 'entity' variable will be removed before the release of 8.x-1.0-beta1", but we're already at beta2, so it should be safe to remove it already...
Let's do it here ;)
Comment #7
matroskeenCommitted to 8.x-1.x.
I don't think there is anything else to do here.
Thanks!
Comment #9
hongpong commentedIf anyone lands here: if you have "User deprecated function: You are using the 'entity' variable in your eck-entity template. You should use 'content' instead."
Just noting inside any function in the theme doing preprocess_eck_entity(&$variables) that may be $variables['entity'] and should be updated to $variables['content'] to resolve this, as well as any references like {{ entity }} above in the twig files.