I have been getting this error on Features diff pages for some time, but the weird thing is it's intermittent:

> ( ! ) Fatal error: Call to a member function set_display() on a non-object in sites/all/modules/contrib/commerce/commerce.module on line 362

A backtrace shows this is coming from commerce_cart_block_view() trying to embed the view 'commerce_cart_block'.

Could this be because Features is doing something wacky with Views on these pages?

Files: 
CommentFileSizeAuthor
#6 1803516-6-commerce_cart_block.patch711 bytesjoelpittet
PASSED: [[SimpleTest]]: [MySQL] 3,550 pass(es).
[ View ]

Comments

glennpratt’s picture

Are you using memcache? We see the same issue from time to time and that's my best guess.

joachim’s picture

No, I don't have memcached on my local machine and we haven't set it up yet on the dev server for my current project, so it's not that that's causing it for me.

m.stenta’s picture

I am also getting this on occasion, but I'm getting it in Checkout, and any pages that display the shopping cart block.

I can fix it by clearing the cache.

It's inconsistent, but I'll keep my eyes peeled, and dig in if it happens again. I'll post updates if I find any.

m.stenta’s picture

Correction: I can fix it by clearing the Views cache. It appears that sometimes that Commerce default Views disappear.

When the error is occurring, they do not show up in the Views admin list. None of the Commerce Views do, so going to any page that tries to use one of them gives this error.

rszrama’s picture

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

Until we have a reproducible problem here, I'm going to mark this "needs more info." I've never experienced the presenting issue (Views disappearing), so I can't confirm whether or not it's a problem in our modules or another.

joelpittet’s picture

Category:Support request» Bug report
Issue summary:View changes
Status:Postponed (maintainer needs more info)» Needs review
StatusFileSize
new711 bytes
PASSED: [[SimpleTest]]: [MySQL] 3,550 pass(es).
[ View ]

I'm not 100% positive but from the looks of it, this is because the wrong name of the display is passed into commerce_cart_block_view(). It should be the display_id of 'default' not 'defaults' which is the human name not the machine name of that view.

So here's a patch.

tyler.frankenstein’s picture

I get this same error, when using Commerce Coupon 2.x with a % discount. The patch above does not fix this particular problem.

This comment fixed it for me: https://www.drupal.org/node/2173963#comment-8913647

rszrama’s picture

Status:Needs review» Fixed

Not sure if #6 is the original issue or not, but that's definitely a typo needing to be fixed. It appears the issue may be in another module, so I'm going to mark this a tentative fixed based on #6 but we can always reopen later if need be.

  • rszrama committed 1e4c716 on 7.x-1.x authored by joelpittet
    Issue #1803516 by joelpittet: fix a typo in the cart block view function...
joelpittet’s picture

@rszrama I think I saw it originally in commerce_ajax_cart which I am now a co-maintainer so I'll keep my eye out.

Thanks for the fix and commit mention!

rszrama’s picture

You bet - thanks for the patch. : )

Status:Fixed» Closed (fixed)

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