Skip to content

Regression: Type error in views with view of nodes #7039

@indigoxela

Description

@indigoxela

Description of the bug

As I already suspected: some added type hints might cause trouble.
Follow up to coding standard fixes in core/includes/c* (common.inc)

Steps To Reproduce

  1. Generate a bunch of nodes with devel
  2. Create a view of teasers but suppress link display
  3. Save it and try to preview or visit the page

Actual behavior

TypeError: hide(): Argument #1 ($element) must be of type array, null given, called in .../core/modules/node/templates/node.tpl.php on line 109 in hide() (line 7261 of ...core/includes/common.inc).

hide(): Argument #1 ($element) must be of type array, null given, called in ...core/modules/node/templates/node.tpl.php on line 109 

The view (page) is broken.

Expected behavior

No type error.

Additional information

Add any other information that could help, such as:

  • Backdrop CMS version: latest dev
  • PHP version: 8.5

Caused by Issue: #7031: Coding standards - core/includes/c* - merged only recently, so not released, yet.

PR was: backdrop/backdrop#5170

We need to fix doc block and type hint. Element can be null (in this case caused by calling hide() in a template in combination with suppressed links).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions