FieldEmbedView::getFieldBuild() expects $view->getDisplay() to return an array, but that method returns a class instance that does not implements the __get() magic method.

The following code needs to be changed.

        $view_display = $view->getDisplay();
        foreach ($view_display['display_options']['arguments'] as $argument) {
          if (isset($display_settings['settings']['arguments'][$argument['id']])) {
            $arg_values = $this->getViewsArgumentsValues($entities, $display_field, $display_settings['settings']['arguments'][$argument['id']], $parent_entity, $view_mode, $language);
            if (!empty($arg_values)) {
              $args[] = implode('+', $arg_values);
            }
          }
        }
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

apaderno created an issue. See original summary.

avpaderno’s picture

Status: Active » Postponed
Related issues: +#3432055: Do not load twice the embedded view

Instead of $view_display['display_options']['arguments'], the code should probably use $view_display->display['display_options']['arguments'].

I am postponing it on #3432055: Do not load twice the embedded view.

avpaderno’s picture

Status: Postponed » Active
avpaderno’s picture

Title: FieldEmbedView::getFieldBuild() expects $view->getDisplay() to return an array when it returns a class instance » FieldEmbedView::getFieldBuild() expects $view->getDisplay() to return an array, but it returns a class instance

avpaderno’s picture

Status: Active » Needs review

  • avpaderno committed cc188e51 on 9.1.x
    Issue #3432070: FieldEmbedView::getFieldBuild() expects $view->...
avpaderno’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.