After enabbling this (GREAT!) module, without further configuration i get a WSOD in a commerce checkout:
mod_fcgid: stderr: PHP Fatal error: Cannot access empty property in .../sites/all/modules/display_cache/display_cache.module on line 280, referer: http://example.com/cart
Did not investigate further yet, of course this may be due to another module.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 2152653-13.patch | 1.11 KB | thedavidmeister |
Comments
Comment #1
geek-merlinOffending code:
Looks like the code assumes every entity has a bundle key. Commerce orders do not.
Comment #2
Caseledde commentedThanks for your report. I will investigate this problem soon.
Comment #3
zhl841129 commentedThis patch provides a fallback if there is no bundle available. I checked and it looks like $bundle is only used by display_cache internally and should not care whether it's a legitimate bundle or not (it just creates a cache key, of sorts).
Comment #4
Caseledde commentedComment #5
kars-t commentedHi
I added one more occurence of "bundle" and some minor codingstyle changes. I am quiet sure that this patch will work. But we would really need some help with a meaningfull test.
Comment #6
geek-merlini do not get why we need all this complexity introduced in #4.
if an entity declares no bundle, a bundle named like the entity is created implicitly.
so why not as simple as #2 changed to:
Comment #7
thedavidmeister commented#6 makes sense to me, and appears to work when I applied it manually.
Can someone explain clearly why we need the extra code in #4 and #5?
Comment #8
geek-merlinPatch flying in.
Comment #9
thedavidmeister commentedI'm actually getting notices with #6:
Notice: Undefined index: bundle keys in display_cache_view_entity() (line 290 of /srv/bindings/7a0d2b55f77a4b45ac5bd2f7e8416abe/code/sites/all/modules/contrib/display_cache/display_cache.module).
Comment #10
geek-merlinline 290 does not have this index here when applied #8 to dev. (it's "else {")
please post your line 290 in context.
Comment #11
thedavidmeister commentedLine 290 for me, after applying #8 is
$bundle_key = $entity_info['bundle keys']['bundle'];inside the else {}Comment #12
thedavidmeister commentedThis is for user entities, btw.
Comment #13
thedavidmeister commentedpatch.
Comment #14
geek-merlinYES this #13 totally makes sense.
Comment #15
thedavidmeister commentedrtbc then?
Comment #16
geek-merlinwe need a 2nd person to test that to rtbc.
(unfortunately i don't have an installation to do so right now and no time to set one up.)
Comment #17
nimek commentedI have same issue in ubercart. Cant access to cart
Patch 13 solved problem but line 177 should also be changed to
$bundle = isset($build['#bundle']) ? $build['#bundle'] : null;
otherwise watchdog will save a lot of notices about undefined #bundle property.
With this quick fix now it works :)
@axel please add patch with line 177 to official release because without that your mod looks like dev version ;)
Comment #19
kars-t commentedHi
I added the patch to the latest dev.
A minor change I did is that I changed the long ternary operation to a "real" if()
Thank you all for your work! :)
Comment #20
kars-t commented