The current_entity property was removed in 3.0

Created on 19 January 2024, 10 months ago

Problem/Motivation

The property was removed here: https://git.drupalcode.org/project/eva/-/commit/16561ab33f6424133619ad8d...

We have custom code that relies on it to know what entity the view is displayed on.
And it is still used in Eva::getPath().

Steps to reproduce

For example in a hook_preprocess_eva_display_entity_view, you can't know which entity the view is displayed on.

Proposed resolution

Re-add the property (or another way to get info about the entity).

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇫🇷France prudloff Lille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @prudloff
  • Status changed to Needs review 10 months ago
  • Not sure why this came out with the D10 updates. Seems fine to me -- do you have someone you can get to test and mark RTBC?

  • Status changed to Needs work 15 days ago
  • 🇫🇷France prudloff Lille

    We noticed it is dangerous to use this property because the entity ID is not always added to the cache keys (eva_entity_view() only adds it if the entity ID is used as view argument).
    So if for example you have the same eva view on the same page but for different entities and your code uses the current_entity property to change the output of the view, the view render will only be cached once for the first entity and reused for the other entities.

Production build 0.71.5 2024