Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm getting 500 errors on a site of mine, with this in the logs:
PHP Fatal error: Unsupported operand types in commerce/includes/commerce.controller.inc on line 335
Lines 333-336:
// Add in fields.
if (!empty($this->entityInfo['fieldable'])) {
$entity->content += field_attach_view($this->entityType, $entity, $view_mode, $langcode);
}
Comments
Comment #2
rszrama CreditAttribution: rszrama at Centarro commentedThere's not enough information here to begin to understand what might be going wrong. It appears to me your $entity->content variable must have been initialized to a scalar value or something, which prevents it from an array union with the return value of field_attach_view(). The issue for you to debug then will be what it is that's initializing this value.
Comment #3
ElemAm024 CreditAttribution: ElemAm024 commentedI'm having a similar issue (or at least, it seems related) when trying to access the checkout page - log message is Fatal error: Unsupported operand types in ...entity/views/entity.property.inc on line 113.
Lines 111-113:
function entity_property_query($entity_type, $property, $value, $limit = 30) {
$properties = entity_get_all_property_info($entity_type);
$info = $properties[$property] + array('type' => 'text', 'queryable' => !empty($properties[$property]['schema field']));
Comment #4
mark_fullmer@ElemAm024, if it helps, I received the same "Unsupported operand types in ...entity/views/entity.property.inc on line 113" error due to an outdated, Featurized version of a commerce tax entity that referenced a Rules condition that no longer applied. Once I removed the outdated items, the operand type error disappeared.
Obviously, you've probably got something very different triggering this, but maybe simple process of elimination -- disabling various commerce components will lead you to a similar discovery.
Comment #5
ElemAm024 CreditAttribution: ElemAm024 commentedThanks, mark! I actually was able to (finally) pinpoint the problem, which turned out to be the FedEx shipping module, and disabling that fixed everything. Still not sure what the specific problem was, but it could definitely be related to outdated or broken rules conditions.
Comment #6
bojanz CreditAttribution: bojanz at Centarro commentedComment #7
donquixote CreditAttribution: donquixote as a volunteer commentedThis is a symptom of #2332955: Nested entity rendering problem in DrupalCommerceEntityController::buildContent(), which already has a patch.
I am changing the status to "Duplicate".