Skip to content
Snippets Groups Projects

Issue #2940605: Can only intentionally re-render an entity with references 20 times.

Closed Issue #2940605: Can only intentionally re-render an entity with references 20 times.
1 unresolved thread
Closed Jonathan Shaw requested to merge issue/drupal-2940605:2940605-recursion-global into 9.4.x
1 unresolved thread

Issue #2940605: Can only intentionally re-render an entity with references 20 times An approach using the renderer.

Closes #2940605

Merge request reports

Approval is optional

Closed by JessJess 1 year ago (Nov 10, 2023 9:29am UTC)

Merge details

  • The changes were not merged into 9.4.x.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 256 256 $referencing_entity_1->{$this->fieldName}->entity = $referencing_entity_1;
    257 257 $referencing_entity_1->save();
    258 258
    259 // Check that the recursive rendering stops after it reaches the specified
    260 // limit.
    259 // Using a different view mode is not recursion.
    260 $build = $view_builder->view($referencing_entity_1, 'teaser');
    261 $output = $renderer->renderRoot($build);
    262 // 2 occurrences of the entity title per entity.
    263 $expected_occurrences = 4;
    264 $actual_occurrences = substr_count($output, $referencing_entity_1->name->value);
    • we can use $referencing_entity_1->label() here, and below

      .. edit but I see the existing test is using ->name->value

      follow-up novice task to make it use ->label() throughout?

    • Yeah, it is nice to have. Make sense to have an additional issue to slightly improve tests. name->value used in many other tests of the core.

    • Please register or sign in to reply
  • Jonathan Shaw added 1 commit

    added 1 commit

    • a3ae8c9b - A zero length string as recursion key is harmless

    Compare with previous version

  • Jonathan Shaw changed target branch from 9.4.x to 9.5.x

    changed target branch from 9.4.x to 9.5.x

  • Jonathan Shaw changed target branch from 9.5.x to 9.4.x

    changed target branch from 9.5.x to 9.4.x

  • closed

  • Please register or sign in to reply
    Loading