View mode can be nullable for some entities

Created on 29 March 2024, 3 months ago
Updated 12 June 2024, 16 days ago

Problem/Motivation

In some cases entities doesn't have view mode, end we can get en error
TypeError: _eca_render_trigger_extra_field(): Argument #4 ($view_mode) must be of type string, null given, called in /var/www/html/web/modules/contrib/eca/modules/render/eca_render.module on line 299 in _eca_render_trigger_extra_field() (line 318 of modules/contrib/eca/modules/render/eca_render.module).

Proposed resolution

Need to change view_mode type param from string to null|string

πŸ“Œ Task
Status

Postponed: needs info

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine r_cheh

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

Merge Requests

Comments & Activities

  • Issue created by @r_cheh
  • πŸ‡ΊπŸ‡¦Ukraine r_cheh
  • πŸ‡ΊπŸ‡¦Ukraine r_cheh

    for 2.x vesion

  • Status changed to Needs review 3 months ago
  • πŸ‡ΊπŸ‡¦Ukraine r_cheh
  • Pipeline finished with Success
    3 months ago
    Total: 533s
    #132609
  • Status changed to Needs work 3 months ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Thanks @r_cheh for reporting this. Is there a way on how this can be reproduced? AFAIKS that method _eca_render_trigger_extra_field is called from 2 places and none of them allows NULL for the display mode.

    Once we know, how this was happening what you reported above, we should find out the root of the problem. And if something really dispatches one of the hook where no display mode is present, then we should either define a default value (i.e. default or full) or follow the event that's being dispatched by that method, as that currently also expects a string and doesn't allow NULL.

    I hope you can follow-up with this?

  • Status changed to Postponed: needs info about 2 months ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Any news on this?

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen
  • Pipeline finished with Success
    16 days ago
    Total: 464s
    #197234
Production build 0.69.0 2024