Hi,
I just updated my whole site to the latest 7.22 version and drupal commerce. There was a bug in the recommended commerce release so I moved to the DEV version to solve this problem. now I am getting the following error:
Notice: Undefined index: path in commerce_cart_field_attach_view_alter() (line 2401 of /home/.../www/www/sites/all/modules/commerce/modules/cart/commerce_cart.module).
The problem is that is doesn't appear for the admin user, but only for anonymous users - and the message appears full in red at the top of the page!!!!
Have run update.php, cleared caches
Slight panic....
Thanks
Rich
Comments
Comment #1
rszrama commentedNot enough info here to debug this. I haven't seen this locally, but I'll need to be able to reproduce it to fix it. For example, what is this Add to Cart form attached to? And why might an anonymous user not have access to view it but still see its fields rendered somewhere?
Comment #2
rszrama commentedThat said, this patch would fix your issue. I'd still hope to understand the underlying issue, though, as I'm not sure this patch wouldn't have undesired side effects. I'm also not sure this issue is related to Commerce 1.6, as this code hasn't seen any recent changes afaik.
Comment #3
richH commentedHi
thanks for the patch - I'd added something similar to keep the errors off the screen. I'll describe the setup later, but I just viewed a calendar page and got this...
which is essentially the same error. But in the calendar module. So I'm starting to think that something isn't defined in the core anymore. I updated today to 7.22 as well so I'm hoping that this might all be related!
getting wobbly from shocks...!
Thanks
Rich
p.s. To get rid of the above error I added the following code before line 401. Now I have to go and have a hot shower to get rid of the shame of such a nasty hack on a live site! This is guessing at its best.
Comment #4
rszrama commentedNothing in http://drupal.org/drupal-7.22-release-notes jumps out at me as having affected entity_uri(). Please keep us in the loop if you determine the problem does sit deeper than Commerce. About the only way I can imagine someone running into this problem strictly with Commerce would be by adding a product reference field to a product type and somehow rendering out that product somewhere w/ the reference field as an Add to Cart while bypassing access control. And I'm guessing that's not happening anywhere in the wild - and if it is, it shouldn't be. : P
Comment #5
richH commentedThat sounds too complicated to be something that I would have done. I think the issue with the calendar means that this is a more general issue with this entity path thing. But to honest, I haven't really got a clue where to start. Thinking cap on...
Thanks for all the help.
Rich
Comment #6
rszrama commentedI've committed my patch. Seeing as how Commerce can return NULL entity URIs in some cases, it stands to reason other modules might be doing the same thing. This patch will protect us in the event a product reference field is attached to such an entity.
Comment #7
richH commentedHi,
looks very nice - have installed it and don't have any errors.
Thanks a lot for the quick response.
Cheers
rich
Comment #8.0
(not verified) commentedadd note about clearing cache