Everything I've encountered below has been reported in previous bug reports but never in one place with sufficient information. I'm hoping to pull a bunch of unresolved bugs together with this post.

I'm been trying to install Commerce on an existing site (Drupal 7.14) which already has the dependent modules installed:

Address Field 1.0-beta3
Ctools 1.2
Entity API 1.0-rc3
Rules 2.2
Views 3.4

I'm using a backup of the site and have attempted this a dozen times, each with a fresh backup of the site's db. The site has never had Commerce installed and I have never tried to uninstall/delete/reinstall/etc.

I installed Commerce 1.3 per instructions here - http://drupal.org/node/1007434. When enabling the modules according to the sequence listed, all goes fine until I enable the Order/Order UI modules. Then I am met with the error:

Fatal error: Unsupported operand types in /home/quickstart/websites/pacbwf.dev/sites/all/modules/entity/views/entity.views.inc on line 189

This is also reported here: http://drupal.org/node/1480106 but was derailed by the poster's subsequent unintall/delete.

In addition, I also sometimes run out of memory when I enable the Order module...and I have memory set to 512 Megs!!!

Here is the Call Stack for the Unsupported operand types error:

0.0002 391892 1. {main}() /home/quickstart/websites/pacbwf.dev/index.php:0
0.4978 38814416 2. menu_execute_active_handler() /home/quickstart/websites/pacbwf.dev/index.php:21
0.5046 39671952 3. call_user_func_array() /home/quickstart/websites/pacbwf.dev/includes/menu.inc:516
0.5046 39672204 4. drupal_get_form() /home/quickstart/websites/pacbwf.dev/includes/menu.inc:0
0.5047 39672836 5. drupal_build_form() /home/quickstart/websites/pacbwf.dev/includes/form.inc:131
1.6358 49048728 6. drupal_process_form() /home/quickstart/websites/pacbwf.dev/includes/form.inc:376
2.1099 54249928 7. form_execute_handlers() /home/quickstart/websites/pacbwf.dev/includes/form.inc:859
2.1099 54252280 8. system_modules_submit() /home/quickstart/websites/pacbwf.dev/includes/form.inc:1460
2.1274 54510320 9. module_enable() /home/quickstart/websites/pacbwf.dev/modules/system/system.admin.inc:1208
3.0192 57680880 10. module_invoke() /home/quickstart/websites/pacbwf.dev/includes/module.inc:484
3.0193 57681180 11. call_user_func_array() /home/quickstart/websites/pacbwf.dev/includes/module.inc:826
3.0193 57681372 12. commerce_order_enable() /home/quickstart/websites/pacbwf.dev/includes/module.inc:0
3.0193 57681372 13. commerce_order_configure_order_type() /home/quickstart/websites/pacbwf.dev/sites/all/modules/commerce/modules/order/commerce_order.module:131
3.4767 58120468 14. commerce_price_create_instance() /home/quickstart/websites/pacbwf.dev/sites/all/modules/commerce/modules/order/commerce_order.module:195
3.5487 58639908 15. field_info_field() /home/quickstart/websites/pacbwf.dev/sites/all/modules/commerce/modules/price/commerce_price.module:263
3.5487 58639908 16. _field_info_collate_fields() /home/quickstart/websites/pacbwf.dev/modules/field/field.info.inc:622
3.6012 60239140 17. module_invoke_all() /home/quickstart/websites/pacbwf.dev/modules/field/field.info.inc:235
3.6026 60265816 18. call_user_func_array() /home/quickstart/websites/pacbwf.dev/includes/module.inc:850
3.6026 60266008 19. eva_field_extra_fields() /home/quickstart/websites/pacbwf.dev/includes/module.inc:0
3.6026 60266172 20. eva_get_views() /home/quickstart/websites/pacbwf.dev/sites/all/modules/eva/eva.module:21
3.6048 60152840 21. views_get_applicable_views() /home/quickstart/websites/pacbwf.dev/sites/all/modules/eva/eva.module:130
3.6048 60153004 22. views_get_all_views() /home/quickstart/websites/pacbwf.dev/sites/all/modules/views/views.module:1389
3.6048 60153128 23. ctools_export_crud_load_all() /home/quickstart/websites/pacbwf.dev/sites/all/modules/views/views.module:1432
3.6048 60153200 24. ctools_export_load_object() /home/quickstart/websites/pacbwf.dev/sites/all/modules/ctools/includes/export.inc:148
3.6230 62900944 25. _ctools_export_get_defaults() /home/quickstart/websites/pacbwf.dev/sites/all/modules/ctools/includes/export.inc:496
3.6560 64881324 26. comment_views_default_views() /home/quickstart/websites/pacbwf.dev/sites/all/modules/ctools/includes/export.inc:680
3.6561 64886480 27. views_db_object->new_display() /home/quickstart/websites/pacbwf.dev/sites/all/modules/views/modules/comment.views_default.inc:25
3.6561 64886480 28. views_db_object->add_display() /home/quickstart/websites/pacbwf.dev/sites/all/modules/views/includes/view.inc:2411
3.6561 64886572 29. views_fetch_plugin_data() /home/quickstart/websites/pacbwf.dev/sites/all/modules/views/includes/view.inc:2315
3.6561 64886616 30. _views_fetch_plugin_data() /home/quickstart/websites/pacbwf.dev/sites/all/modules/views/views.module:1256
3.7092 67008864 31. views_discover_plugins() /home/quickstart/websites/pacbwf.dev/sites/all/modules/views/includes/cache.inc:96
3.7120 67112284 32. entity_views_plugins() /home/quickstart/websites/pacbwf.dev/sites/all/modules/views/includes/plugins.inc:414
3.7128 67112328 33. views_fetch_data() /home/quickstart/websites/pacbwf.dev/sites/all/modules/entity/views/entity.views.inc:319
3.7128 67112460 34. _views_fetch_data() /home/quickstart/websites/pacbwf.dev/sites/all/modules/views/views.module:1245
3.7135 67113684 35. module_invoke_all() /home/quickstart/websites/pacbwf.dev/sites/all/modules/views/includes/cache.inc:29
3.7226 67422348 36. call_user_func_array() /home/quickstart/websites/pacbwf.dev/includes/module.inc:850
3.7226 67422540 37. entity_views_data() /home/quickstart/websites/pacbwf.dev/includes/module.inc:0
10.0061 121838732 38. entity_views_table_definition() /home/quickstart/websites/pacbwf.dev/sites/all/modules/entity/views/entity.views.inc:42
10.0079 121863080 39. entity_views_field_definition() /home/quickstart/websites/pacbwf.dev/sites/all/modules/entity/views/entity.views.inc:152

Once I get to this point, I can't get anywhere. Nothing will load. All I get is the Unsupported operands error on every page I try to visit. So I go into the Systems table and disable Order/Order UI. I go back to admin/modules and re-enable Order/Order UI and the page loads with no errors. So I continue to enable the remainder of the modules. Sometimes I then get either Unsupported operand types error (same as above although if I then go to admin/modules, the page always loads) or I get:

Notice: Undefined index: commerce_total in commerce_line_item_entity_property_info_alter() (line 101 of /home/quickstart/websites/pacbwf.dev/sites/all/modules/commerce/modules/line_item/commerce_line_item.info.inc).
Recoverable fatal error: Argument 2 passed to entity_views_field_definition() must be an array, null given, called in /home/quickstart/websites/pacbwf.dev/sites/all/modules/entity/views/entity.views.inc on line 152 and defined in entity_views_field_definition() (line 175 of /home/quickstart/websites/pacbwf.dev/sites/all/modules/entity/views/entity.views.inc).

as reported here http://drupal.org/node/1430894.

Soooo, I followed that thread and changed entity/views/entity.views.inc as mentioned in http://drupal.org/node/1430894#comment-5964808

When I refresh the admin/modules page, the error goes away. So, nothing useful to report on that. I'll have to change it before another run at installing to see if I get anything useful.

Running Commerce Repair then clears up the remainder of the errors I was getting (when trying to add a product type, visiting the admin/structure/types/add page, etc.

So, the trick for me seemed to be the initial enabling of Order/Order UI, then going into the Systems table and disabling them and then re-enabling them again through the UI.

Let me know if there's anything I can provide you for trouble shooting. I've been going through this process for the past day and a half hoping to find some way that worked (finally did today) so can reproduce whatever you want.

Thanks,
Mickey

Comments

micnap’s picture

[banging head on desk]

I just installed the dev version on an existing site without a hitch. Wish I'd have tried that yesterday.

Mickey

micnap’s picture

I take comment #1 back. Just installed the dev version on my dev site and it bonked just like the 1.3 version did. :-(

rszrama’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Never had a problem here. Perhaps it's related to your environment? PHP version? Can you install fine using Commerce Kickstart 1.x?

micnap’s picture

I'm able to install Commerce Kickstart 2 no problem. Using PHP 5.3 on Ubuntu 11.04 - the Quickstart environment - http://drupal.org/project/quickstart

Mickey

rszrama’s picture

Ok, not sure where to look next then. Definitely sounds like you're not getting fields created on install that should be created, but 512M should be more than sufficient memory (I do all my development at 128M). Perhaps a memory problem with some other module? There was a patch for a while in Drupal core that caused runaway memory problems by duplicating the entire entity info array multiple times on page requests that was rolled back before Drupal 7.15 was released.

fonant’s picture

Lots of problems installing Commerce 7.x-1.3 here too.

Commerce Repair seems to help a bit, but enabling the last few modules (e.g. PayPal WPS) just kills everything dead, with the error @Recoverable fatal error: Argument 2 passed to entity_views_field_definition() must be an array, null given@

I'll see if I can debug some more.

fonant’s picture

OK, I get this too. Installation in the order recommended works fine for Commerce, Customer, Price, Line Item and their UIs.

But enabling commerce_order throws lots of errors. Can recover OK using drush @site pm-disable commerce_order.

I'm using a newer version of Views, but otherwise OK. A site I installed Commerce on some time ago is still working fine with the same modules.

Address Field 7.x-1.0-beta3
Ctools 7.x-1.2
Entity API 7.x-1.0-rc3
Rules 7.x-2.2
Views 7.x-3.5

Commerce 7.x-1.3

PHP 5.3 on a Fedora machine that runs lots of other Drupal sites, including one using Commerce 7.x-1.3 that I installed some months ago and then upgraded as needed :)

Yes!!! Progress. I can install commerce_order if I do this:

1) drush @sitename pm-enable commerce_order commerce_order_ui
2) Get error messages to do with entity views, site is dead. Nothing works, not even drush.
3) Edit system table in database, set "status" from 1 to 0.
4) drush @sitename pm-enable commerce_order commerce_order_ui

drupalerocant’s picture

I am having the same problem. My configuration:

PHP Memory limit 512MB
PHP 5.3.3-7+squeeze14
Apache/2.2.16
Drupal 7.14

Modules:
ctools: 7.x-1.2+4-dev
Entity API 7.x-1.0-rc3
Rules 7.x-2.2
Views 7.x-3.5

Commerce 7.x-1.3

This is not a fresh install though. It is a complex site with around 150 modules.
I installed Commerce 1.3 following instructions here - http://drupal.org/node/1007434.
Everything goes fine till I install the order module. Drupal gives me these notices:

Notice: Undefined index: commerce_order_total en commerce_order_entity_property_info_alter() (line 133 in /home/zzzzzzzz/sites/all/modules/commerce/modules/order/commerce_order.info.inc).
Recoverable fatal error: Argument 2 passed to entity_views_field_definition() must be an array, null given, called in /home/zzzzzzzz/sites/all/modules/entity/views/entity.views.inc on line 152 and defined en entity_views_field_definition() (line 175 in /home/zzzzzzzz/sites/all/modules/entity/views/entity.views.inc).

From then on, nothing works. I go to the database, change the status of the module form 1 to 0 and then I run update.php which makes come back to normal.
Anyway I am not able to install the order module as I dont hav access to a shell to do it through drush.
Is there any more data I can give to help out?
Any ideas how I can manage to make commerce work in full?
This module is basic for my project and I cannot go further.

PS: by the same time I am having problems with commerce I am having an 500 Internal Server Error after running cron. It takes a long time to run and at the end it gives the Internal Server Error. On every cron run drupal has to index 100 nodes and look for RSS content from some 10 or 15 blogs, but I guess this is not a big deal for drupal, is it?

drupalerocant’s picture

And a question to Fonant. Did you manage to work with commerce_order from then on?
Thanks

rszrama’s picture

Can you look in your field list (under Reports) and see if the commerce_order_total price field is listed?

drupalerocant’s picture

At the moment I dont have "order" installed and this field doesn't exist. Is there more info I can give you?
thanks

rszrama’s picture

You must have the Order module installed if commerce_order_entity_property_info_alter() is being called. : ?

drupalerocant’s picture

ok, that notice comes when I try to install order module.
I just did it and this was the message by drupal:

FieldException: There has been an attempt to create an instance of the field commerce_line_items in the package commerce_order that already has an instance of this field. in field_create_instance() (line 490 in /home/zzzzzzzzzzzz/modules/field/field.crud.inc).

well, this is a quick translation from spanish...

i hope it helps!

drupalerocant’s picture

after that, I cleared the caches and this was the message:

Mensaje de error

Notice: Undefined index: commerce_order_total en commerce_order_entity_property_info_alter() (línea 133 de /home/zzzzzzz/sites/all/modules/commerce/modules/order/commerce_order.info.inc).
Recoverable fatal error: Argument 2 passed to entity_views_field_definition() must be an array, null given, called in /home/zzzzzzzz/sites/all/modules/entity/views/entity.views.inc on line 152 and defined in entity_views_field_definition() (line 175 in /home/zzzzzzzz/sites/all/modules/entity/views/entity.views.inc).

after that whenever I go to any page it gives this fatal error:

Fatal error: Unsupported operand types in /home/zzzzzzzz/sites/all/modules/entity/entity_token.tokens.inc on line 93

hope it helps!

rszrama’s picture

Sounds like perhaps you had this module installed but the uninstalled or disabled it and now it's trying to create what it thinks is a duplicate field?

drupalerocant’s picture

Well, I just did another try.

1. I installed order module
2. I got the first error message
3. I went to the database and put status 0 to order module
4. went to admin/modules/list where order module appeared disabled
5. Enabled order module again
6. now I have the commerce_order_total field in the field reports, it appears as a blocked field.
7. now everything looks to work fine.

I will install order UI module to see what happens...

1. I just installed order UI module... and everything looks to work fine!!

I am very happy at the moment!

I am going to try with the rest of the commerce modules and I will write down the results!

thank you very much!

drupalerocant’s picture

Well, here comes the problem again, even though this one is different:

After success in installing order and order UI modules I went on with: checkout, payment, product following the order in http://drupal.org/node/1007434
everything ok so far.

The new problem comes with installing product_reference module. Once installed I got this notice:

Notice: Undefined index: commerce_total en commerce_line_item_entity_property_info_alter() (línea 101 de /home/zzzzzzzz/sites/all/modules/commerce/modules/line_item/commerce_line_item.info.inc).

after that, the following fatal error:

Fatal error: Unsupported operand types in /home/virtualmin/diagonalperiodico.net/public_html/nuevaweb/sites/all/modules/entity/entity_token.tokens.inc on line 93

So far I havent been able to recover the site (I made a backup though).

I tried disabling the module by hand and then running update.php
after running update.php I got this notice and error:

Notice: Undefined index: commerce_total en commerce_line_item_entity_property_info_alter() (línea 101 de /home/zzzzzzzzzzz/sites/all/modules/commerce/modules/line_item/commerce_line_item.info.inc).
Recoverable fatal error: Argument 2 passed to entity_views_field_definition() must be an array, null given, called in /home/zzzzzzzzzzz/sites/all/modules/entity/views/entity.views.inc on line 152 and defined en entity_views_field_definition() (línea 175 de /home/zzzzzzzzzzz/sites/all/modules/entity/views/entity.views.inc).

after this errors, everything went wrong:

Fatal error: Unsupported operand types in /home/virtualmin/diagonalperiodico.net/public_html/nuevaweb/sites/all/modules/entity/entity_token.tokens.inc on line 93

Any ideas on how can I install commerece modules properly? Am I doing something wrong?

rszrama’s picture

Oh, I see what you're doing - yeah, you can't just disable a module like that in the system table. The disable / uninstall process for Drupal modules involves, among other things, cleaning up leftover data and configuration that is no longer necessary - such as defined fields. I think you may have just backed yourself into a corner because you've put your site in a broken state where Drupal is assuming a module was removed through the normal method when in fact it was not.

I'll look into it more when I have time, but there's not much we can do from a core Commerce standpoint to fix that sort of problem.

drupalerocant’s picture

Thanks for the quick answer.
I know what I am doing is wrong in the way that I shouldn't disable modules by hand in the database.
The problem is that from the beginning I am doing things "in the right way" and nothing works, I am not even able to install the commerce modules...
Well, thanks anyway, if I finally get to a solution I'll try to write it down here just in case anyone finds the same problem.

rszrama’s picture

I have a queue of issues to work through, but I won't forget this one. ; )

If you have the time / ability, where I'd begin looking for a fix is to see if we can accommodate these "zombie" field instances in our install process, reusing them instead of failing because they already exist.

drupalerocant’s picture

I hope you have the time soon, rszrama. : )
For the moment I tried it again uninstalling and cleaning everything up with the help of shaisamuel at http://drupal.org/node/1480106 but it didn't work and I cannot figure out what it can be.
I executed the php script to clean up everything, and it gave me an error in the output that can be the problem, you can follow it at: http://drupal.org/node/1480106.
anyway I tried again the installation of the commerce suite and after enabling the order and order UI modules drupal gave me the following errors:

Notice: Undefined index: commerce_order_total in commerce_order_entity_property_info_alter() (line 133 in /homezzzzzzzzzzz/sites/all/modules/commerce/modules/order/commerce_order.info.inc).

    Recoverable fatal error: Argument 2 passed to entity_views_field_definition() must be an array, null given, called in /home/zzzzzzz/sites/all/modules/entity/views/entity.views.inc on line 152 and defined en entity_views_field_definition() (line 175 in /home/zzzzzzzzzzzz/sites/all/modules/entity/views/entity.views.inc).

After that everything broke again, gave me this fatal error:
Fatal error: Unsupported operand types in /home/zzzzzzz/sites/all/modules/entity/entity_token.tokens.inc on line 93

Well, I will keep trying tomorrow and if I find the way I will post it here.

drupalerocant’s picture

Well, I finally got it!

finally what helped me to figure it out was taking into account what is said in this issue:
Recoverable fatal error: Argument 2 passed to entity_views_field_definition() must be an array

I've just done as Fonant suggested but I only disabled "Order" in the "system" table of the database and then re-enabled it via Drupal->modules.

After that I ran commerce_repair module, but taking into account that whenever I tried to run it as user/2 (not user 1 but with administration privileges) it didn't allow me to do it, but running it with user/1 commerce_repair was able to repair all fields necessary.
Well! I hope this helps to anyone that arrives to the same problem!
Finally I will be able to use the famous commerce module in my site!
thanks!

rszrama’s picture

lol Sorry it was such a headache to get up and running in the first place, but glad you're in business now. ; )

PatchRanger’s picture

Status: Postponed (maintainer needs more info) » Fixed

All of symptoms described are fixed in the patch attached to #1509994: Missing entity property info results in notices / WSOD / fatal errors during installation.
Marking as fixed - re-open if the problem remains even with the patch.

rszrama’s picture

Status: Fixed » Closed (duplicate)

Marking as duplicate; if that patch doesn't end up solving this, we can re-activate it.