I get this error message and I am unable to get a "add to cart" button or a view with this feature...

thanks for your help

CommentFileSizeAuthor
#6 issue_1265152.png70.25 KBFranciscoLuz
#5 issue #1265152.png70.25 KBFranciscoLuz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Haza’s picture

Title: Notice: Undefined index: commerce_product in field_views_field_default_views_data() » Notice: Undefined index: commerce_product in field_views_field_default_views_data() (line 222 of C:\wamp\www\drupal-7.x-dev\site
Status: Active » Postponed (maintainer needs more info)

Thanks for the report.
Could you please add more informations ?
What did you do before ? On which page (url) is this error ? What do you try to do exactly ?

pdeclarens’s picture

Status: Active » Postponed (maintainer needs more info)

Thanks for your help

In the mean time I found how to get the add to cart button

I installed the commerce module
It is running (on my local demo site) but I get this message each time i make a change on the view_product
I get first the message : The view Products has been saved.
and below the following error message:
Notice: Undefined index: commerce_product in field_views_field_default_views_data() (line 222 of C:\wamp\www\drupal-7.x-dev\sites\all\modules\views\modules\field.views.inc).

the url where it appears is :http://localhost/drupal-7.x-dev/

thanks again

Haza’s picture

Status: Postponed (maintainer needs more info) » Active
rszrama’s picture

Title: Notice: Undefined index: commerce_product in field_views_field_default_views_data() (line 222 of C:\wamp\www\drupal-7.x-dev\site » Notice: Undefined index: commerce_product in field_views_field_default_views_data()

Not sure. There's no reason on a clean install for you to be missing commerce_product. Did you have any problems during installation / are you using MySQL?

FranciscoLuz’s picture

Title: Notice: Undefined index: commerce_product in field_views_field_default_views_data() (line 222 of C:\wamp\www\drupal-7.x-dev\site » Notice: Undefined index: commerce_product in field_views_field_default_views_data()
Status: Postponed (maintainer needs more info) » Active
FileSize
70.25 KB

Hi Ryan,

I did, I mean, got the same error at the installation process. Take a look at the image attached please.

I have a clue though of what is causing it. This has something to do with locale, note that the error in the image is from a portuguese installation but that does not happen with drupal english.

But I did not get any errors after the installation was completed and could not reproduce the same issue pdeclarens reported, I mean, apart from the installation error message, everything seems to be working as they are supposed to.

FranciscoLuz’s picture

FileSize
70.25 KB

the image from #5 is not opening, so I am sending it again.

FranciscoLuz’s picture

Status: Needs review » Active

I think I found the culprit, apparently the problem is on Commerce Kickstart, check out this thread here http://drupal.org/node/1267386#comment-4937726, I rolled a patch in there.

Just a side note for #5. I was actually getting the error every time the caches were cleared.

FranciscoLuz’s picture

Assigned: pdeclarens » FranciscoLuz
Status: Active » Needs review
Chi’s picture

I have the same problem with Kickstart installation profile. But i think it is actually being caused by Drupal Commerce and not Kickstart.
I am getting this messages every time after flush cache.

FranciscoLuz’s picture

@Chi

So even after applying this patch here http://drupal.org/node/1267386#comment-4940310 and making a clean install of Kickstart, you are still experiencing the error message after you clear the cache, is that right?

I would like to stress on the fact that applying the patch and not re-installing Commerce Kickstart has absolutely no effect whatsoever. In order to get rid of the message you must apply the patch and make a fresh install of Commerce Kickstart.

Chi’s picture

I cannot reinstall Kickstart now. There is much work be done .
Can you explain, how I can get rid of the message without making a clean install of Kickstart?

FranciscoLuz’s picture

Status: Active » Needs review

@Chi #11

Yes, just go to admin/structure/types/manage/article/fields and delete the field_image field. Warning, you are going to loose your image data.

Would you be able to test out this patch http://drupal.org/node/1267386#comment-4940310 by creating a new folder in your local webserver, making a fresh install of Kickstart in it and sending us your feedback at http://drupal.org/node/1267386 please.

Cheers,

FranciscoLuz’s picture

Comment duplication

Chi’s picture

@FranciscoLuz
I make a fresh install of Kickstart but I cannot reproduce the bug.

Chi’s picture

Assigned: Unassigned » FranciscoLuz
Status: Active » Needs review

Steps to reproduce this bug without Kikstart.
1. Make a fresh Drupal installation (Drupal 7.8)
2. Install commerce modules (Commerce, Cart, Product, Order, etc.).
3. Open admin/commerce/products/types/product/fields and add existing field (field_image)
Label for this field must differ from "Image" (e.g. Icons, Pictures, etc.).

You will get this error messages any time a change will be made to anything views related.

Chi’s picture

Status: Needs review » Active

I think it is possible to reproduce this problem on any commerce site.
You need just change label for field_image.

shane.outwestart’s picture

I'm also having this issue.
I followed similar steps as described previously, and created a image field with a different label.
Now I get the Notice displayed on the front page and for each user any time a change is made to anything views related.

Vanilla Drupal 7.8 fresh install with commerce modules and prerequisites added later.

FranciscoLuz’s picture

Assigned: FranciscoLuz » Unassigned

Hi,

I haven't found the time yet to try reproducing the steps from #15. I will work trying to find the cause of that this weekend and see if I can come up with a solution.

@shane.outwestart and @Chi
Just double checking, you guys are getting that on a non-english installation, right?

Chi’s picture

Yes. I am getting that on Russian installation. But you can reproduce steps from #15 on English installation.

rszrama’s picture

Assigned: FranciscoLuz » Unassigned
Status: Needs review » Closed (duplicate)

Tracked this one down. It was a general Views problem in that the code in field.views.inc that generates aliases for fields attached to multiple entities wasn't checking to ensure that a revision table existed for each entity before trying to create an alias for the revisioned data. Fortunately, this has been resolved in the latest Views dev, though I don't know when / where (so I can't point you to a specific patch). The notice doesn't signify an error, though, so you can just ignore it when you see it until you update to the next release of Views.

FranciscoLuz’s picture

Awsome! Thank you Ryan, you are a champ.

shane.outwestart’s picture

Great!

Our site isn't live yet, so more than happy to wait.

rucx’s picture

Status: Closed (duplicate) » Active

I had an issue with views not appearing for anonymous users when using relationship: Content: Referenced Product (to show the product's image field) which was fixed today with the new dev releases of Views and Commerce. But now I get this error message:

Notice: Undefined index: commerce_product in field_views_field_default_views_data() (line 222 of ...

rszrama’s picture

Status: Active » Closed (duplicate)

As I mentioned above, this is an issue within Views itself pertaining to the absence of a revision table for products. However, if you are running Views' latest dev release, it should not be an issue. You'll want to check the contents of that function, but in the latest Views last I looked it was ensuring the revision index existed before attempting to operate on it.

darksnow’s picture

This issue popped up for me too. I'm getting that error after clearing the cache, but if I refresh the page, the error goes away until I clear the cache again.

I guess it's not that serious but it's reassuring to see that it's been identified and a future update will fix it.

Cheers.

tvilms’s picture

Subscribing

anandkp’s picture

Subscribing as well.

Thanks to those who are working on the fix for this!