On a Drupal 7.9 site, running on Ubuntu 10.04, I received the following errors upon enabling the Order UI module, while following the installation instructions on d.o for the order in which to enable modules:

Notice: Undefined index: commerce_order_total in commerce_order_entity_property_info_alter() (line 117 of /var/www/html/drupal-7.4-essentials/sites/all/modules/contrib/commerce/modules/order/commerce_order.info.inc).
x
Recoverable fatal error: Argument 2 passed to entity_views_field_definition() must be an array, null given, called in /var/www/html/drupal-7.4-essentials/sites/all/modules/contrib/entity/views/entity.views.inc on line 127 and defined in entity_views_field_definition() (line 149 of /var/www/html/drupal-7.4-essentials/sites/all/modules/contrib/entity/views/entity.views.inc).

My site was then returned to an "Error" page. I have not yet tried to make use of the Commerce module suite to determine whether the error is fatal to use of Commerce.

Comments

rszrama’s picture

Category: bug » support
Status: Active » Needs review

Hmm, it sounds like perhaps the Order Total price field wasn't properly created when the Order module was installed. Did you experience any white screen errors during installation? Also, if this is a new site, it would be much better to just use the Commerce Kickstart installation profile; it mimics a standard installation but enables all the Commerce modules and their dependencies during the normal installer, which uses a batch process to enable modules in order and avoid PHP errors during installation.

tunny’s picture

Try manually truncating your cache table.

I was experiencing similar errors, which ceased after I did that.

jacobson’s picture

Hey Ryan.

I experienced an error when enabling the Order / Order UI modules per the installation instructions. The error I received is the one reported in this issue. I see no Order Total Price field in the commerce_order table. I also don't see an Order Total Price field in the .install file scheme for the commerce_order table.

Unfortunately, I can't use Kickstart, since this is an existing site with far too much development and customization already done to it.

How can I help further solve this issue?

rszrama’s picture

Status: Needs review » Fixed

Ahh, sorry to hear it. Before going any further, make sure you've backed up your database unless you're already working on a dev copy of your existing site (recommended). rfay has developed a module to repair missing fields that should solve this issue for you: http://drupal.org/project/commerce_repair

jacobson’s picture

Title: Undefined index: commerce_order_total in commerce_order_entity_property_info_alter() » More Detail on Error

To try to help diagnose this problem, I uninstalled Commerce completely. I deleted all modules and verified that all Commerce DB tables were dropped.

I then downloaded Commerce again and tried to use drush to enable the Commerce modules as specified on the Handbook installation page. When I tried to pm-enable order and order_ui, the following error occurred:

WD php: Recoverable fatal error: Argument 2 passed to entity_views_field_definition() must be an array, null given, called in                                                                       [error]
/var/www/html/drupal-7.9-essentials/sites/all/modules/contrib/entity/views/entity.views.inc on line 127 and defined in entity_views_field_definition() (line 149 of
/var/www/html/drupal-7.9-essentials/sites/all/modules/contrib/entity/views/entity.views.inc).

Unfortunately, this error message does not tell us what Commerce code is responsible, but I hope this helps identify the source of the problem.

Status: Fixed » Closed (fixed)

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

mattsmith3’s picture

Status: Closed (fixed) » Active

I'm having this same error. It originally showed up (and after adding a couple of products) killed the whole site. Couldn't access any pages or use drush. I've ripped out the module and used this: http://drupal.org/project/registry_rebuild (for anyone else in the same place) to recover my site.

Now I just can't get commerce (and it's 20 sub modules) to install correctly. I usually get about 3 in before this error starts back in. I've re-stripped out the module... dropped the tables. I'll try truncating the cache tables on this next round. I'm also running the latest versions of everything.. completely up to date.

rszrama’s picture

Status: Active » Closed (fixed)

Matt, when you went through the install, did you try to use the Commerce Repair module? And were you on 1.1 or 1.2? You might try using the 1.x-dev.

brandon_beeler’s picture

Ryan do you know if there is a command to run the repair in drush? I can't navigate through the site to actually run the repair from the actual UI because the site is throwing this error on every page.

rszrama’s picture

I'm not sure if it supports drush or not - rfay is a fan of it, though, so I wouldn't be surprised. I'd ask in http://drupal.org/project/issues/commerce_repair.

brandon_beeler’s picture

Thanks

rfay’s picture

Title: More Detail on Error » Failure to enable commerce_order_ui: Recoverable fatal error: Argument 2 passed to entity_views_field_definition() must be array

@mattsmith3, I think you need a new issue, and please report the exact results you have. I doubt they're exactly the same as this old issue. Please post the link to the new issue here.

It *does* seem like you might have an old version of Entity module. I'm sure you know that Commerce depends on Entity, Rules, and Views, and they have to be updated with the various Commerce modules.

It doesn't actually make any sense that if you delete all commerce tables you wouldn't be able to install. However, you may be missing some field tables. #858722-61: Cannot reinstall Commerce modules after uninstall due to field deletion failure has a brute-force uninstall script that might point out to you something you failed to do. (That is old and hasn't been revisited, so you get what you pay for :-)

Garmisch’s picture

Version: 7.x-1.1 » 7.x-1.3
Category: support » bug
Status: Closed (fixed) » Active

I'm having the same error as mattsmith #7. Like him it originally showed up, and after adding the product UI module, it killed the whole site. Cannot access any pages or use drush. Before the final crash, I also tried the commerce_repair module, without any results.

rszrama’s picture

Version: 7.x-1.3 » 7.x-1.1
Category: bug » support
Status: Active » Closed (fixed)

Please refer to rfay's comments above; there are good reasons to believe the initial issue here has been dealt with through other module updates, but if not, let's have a separate issue that outlines the bug with steps to reproduce the issue in a clean install of Drupal Commerce. For issues like this, we can't even begin to debug the problem until we can reproduce it locally.

liam mcdermott’s picture

Category: support » bug
Priority: Major » Normal
Status: Closed (fixed) » Active

This bug is still present, it's very hard to track down, however. I can make it happen consistently on our dev site, but getting it to appear from an installation created from scratch is proving to be difficult.

There is one strong correlation, however: the bug only appears when we have EVA already installed. Then when the Order UI (edit: apologies, I meant Order module) module is enabled the bug is triggered, specifically the problem happens when entity_views_field_definition() is called for the commerce_order_total field.

Side note: I've tried enabling each module one-by-one in case the issue is anywhere lower down the dependency chain.

So this is definitely a bug, however I'm guessing it's just normal priority since it can be worked around by disabling EVA before installing Commerce.

What I'm wondering is: do all the other people with this issue have EVA installed?

EDIT: just to note, the reason I re-opened this is to ask the other people in the issue whether they had EVA installed, too. If I find a way to reproduce this bug consistently, I'll open a new issue.

rszrama’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Ok, let's leave this as a postponed support request then and see if anyone else chimes in. I doubt it's gonna happen, though... resurrecting old issues rarely results in new information.

lucasgladding’s picture

I have been looking into this issue with Liam, and I've tracked the problem as far as commerce_order_entity_property_info_alter() in commerce_order.info.inc. On the installation with EVA enabled, $properties['commerce_order_total'] is not set, which is causing the null value to be set in $info, ultimately resulting in the fatal error.

$info['commerce_order']['properties']['commerce_order_total'] = $properties['commerce_order_total'];

I can't figure out why EVA would be causing the issue, but it seems like the culprit based on our testing. I'm going to investigate further, but if this triggers any thoughts from the experts, those thoughts are very welcome. :)

lucasgladding’s picture

It turns out the field wasn't being created when the order module was enabled. If you check whether the properties are set in commerce_order_entity_property_info_alter() before moving them to the commerce_order properties, the problem disappears. I'm still not sure why the problem is occurring in the first place, but this seems to be one solution.

if (isset($properties['commerce_line_items'])) {
  $info['commerce_order']['properties']['commerce_line_items'] = $properties['commerce_line_items'];
}
if (isset($properties['commerce_order_total'])) {
  $info['commerce_order']['properties']['commerce_order_total'] = $properties['commerce_order_total'];
}
liam mcdermott’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Think I have a set of steps to reproduce this, so have created issue: #1871832: Conflict with Entity Views Attach (EVA)

Lucas, please could you try to repeat my steps in the other bug report and reply (in the other report) with the result? Just want to make sure what I did wasn't a fluke. :)

I'm guessing we can close this as a duplicate.

PatchRanger’s picture

RealGecko’s picture

Patch from #17 of that issue helped.

acmaintainer’s picture

I tried out the latest dev version of Commerce. I was able to install and enable all sub modules with 1.4+28...no issues. See my comment on http://drupal.org/node/1509994. Sadly, after posting this I tried the install on my real local dev site, rather than the fresh sandbox site (where it worked fine) and it broke it. Still working on it.

rszrama’s picture

If this is a new site, why not try Commerce Kickstart 1.x?

acmaintainer’s picture

Mystery solved!!!! It is definitely a conflict with the Eva module. Everything was perfect after disabling it.
I saw the posting earlier where someone was having that same eva issue, and I disabled it locally. However at the time I began having fatal errors thrown by the lack of resources settings in my local dev site "my.ini" file (http://drupal.org/node/259580), and thought the eva thing was not helping.
So, I had 2 sets of problems going and had to peel the onion. It worked locally once I got past the resources issue, then had the original problem (this issue queue) on the staging site. Why? Because I had not disabled eva on the remote dev site. Dang.
Anyway, the eva module was not being used for much, so it goes, in favor of Commerce.
Great module! Nice job. I hope this helps anyone else who might have either or both of these issues.
BTW, KickStart is wonderful. I did all my "studying" on it, before attempting Commerce on the existing site.
Thank you, many times over.