1

I'm working on a Drupal 8 / Drupal Commerce website, and I run into "Website encountered unexpected error" when trying to access /admin/commerce/orders/* pages (order view page).

In log messages I get :

Error : Unsupported operand types dans Drupal\views\Element\View::preRenderViewElement() (/---/core/modules/views/src/Element/View.php ligne 49)
#0 [internal function]: Drupal\views\Element\View::preRenderViewElement(Array)
#1 /---/core/lib/Drupal/Core/Render/Renderer.php(378): call_user_func(Array, Array)
#2 /---/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false)
#...
#10 /---/core/lib/Drupal/Core/Render/Renderer.php(437): Drupal\Core\Theme\ThemeManager->render('commerce_order', Array)

So it seems that a view displayed on these pages causes this error. Does anyone ran into this error ?

Thanks

EDIT

After some debugging, I found that in

/core/modules/views/src/Element/View.php L49
$element += $view->element;

...$view is null, which causes the error. Above that line, $view is defined by this line (L43) :

$view = Views::getView($element['#name']);

...and $element['#name'] = commerce_order_item_table.

The View::getView() method is :

public static function getView($id) {
  $view = \Drupal::service('entity.manager')->getStorage('view')->load($id); // this call returns null
  if ($view) {
    return static::executableFactory()->get($view);
  }
}

So it seems that I miss a view (commerce_order_item_total) ?... I'll report further info here.

EDIT 2

My missing view seems to be defined in

/modules/contrib/commerce/modules/order/config/install/views.view.commerce_order_item_table.yml

...but is not found apparently.

EDIT3

On /admin/config/development/configuration/single/export (exporting a single element), selectting "view" as configuration type, I cannot find "commerce_order_item_table". Doing a manual full export (drush cex --destination=sync) I don't find a views.view.commerce_order_item_table in sync folder.

3

2 Answers 2

0

I didn't find out why my order views disappeared, but I was able to import them back using configuration synchronization :

https://www.drupal.org/node/2917828#comment-12321847

0

I had the same error, but with a different view for commerce_orders, views.view.commerce_activity.yml, when viewing an order as an admin.

Export the view then importing the view with content synchronization did the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.