Closed (won't fix)
Project:
Default image ft
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Jun 2014 at 14:15 UTC
Updated:
3 Oct 2017 at 13:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rudiedirkx commentedEh, no. This hook is perfect. It not working in Panels is another issue, that I won't look into, because I don't do Panels.
You can fix it and submit a patch.
Comment #2
mrkdboyd commentedI've created the patch to make this work with panels. And I tested it to make sure that it still works fine with regular content type display settings as well.
Comment #3
mrkdboyd commentedComment #4
rudiedirkx commentedYou're adding panels support in a closed issue about
hook_entity_load()... That doesn't seem off to you?Please create a new issue for that. If you add a patch, "Needs review" is the correct status.
Comment #5
rudiedirkx commentedOh crap, I'm a blind asshole.
I'll look into this soon.
Comment #6
rudiedirkx commentedComment #7
rudiedirkx commentedOr maybe I'm not. Like I said before:
hook_entity_load()is NOT the hook for this.Comment #8
joco_sp commentedDid someone look into this?
Comment #9
mdeltito commentedRe-roll of @mrkdboyd's patch, which is still working well with Panels.
@rudiedirkx I'd be interested in hearing more about the reasoning behind "hook_entity_load() is NOT the hook for this".
Comment #10
mdeltito commentedFixed missing langcode in #9
Comment #11
mdeltito commentedAddition change for where
default_image_ft_entity_prepare_viewwas being called "manually"...Comment #12
rudiedirkx commented@mdeltito entity_load is not the hook for this because editing an entity will trigger that hook and then your empty field isn't empty anymore. Your empty field should only be non-empty when viewing it. There is a very specific hook just for that:
entity_prepare_view.It should work in Panels too IMO, because viewing an entity is viewing an entity, however you trigger it. I don't care about Panels, so I'm not looking into the difference, although this has made me slightly curious.
Comment #13
mdeltito commented@rudiedirkx
Good point for sure. The issue is actually with CTools, which doesn't trigger all the appropriate entity hooks in the latest release:
Issue: #1760384: Update node_view.inc to execute the normal Drupal hooks
Patch #13 resolves this issue for me
Comment #14
rudiedirkx commentedWow, I thought CTools and Panels were as old as the world, and at least as perfect and bugless. Still bugs in CTools??
I should look into Panels some time... Any great fantastic tutorials I should follow?
Comment #15
mohit_aghera commentedComment #16
mohit_aghera commentedIgnore the patch in #14
Updated patch.
Comment #17
darrell_ulm commentedHas this been added into the main codebase yet?
Comment #18
rudiedirkx commentedNo. See project page:
Comment #19
darrell_ulm commentedFor version 7.x-1.6 the patch in #16 seems to cause a segmentation fault, although the patch applied correctly. Is there a version this should be applied to, originally 7.x-1.0 for this issue? Thanks.