Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
8.x-3.x-dev
Component:
CTools Blocks
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Feb 2016 at 19:51 UTC
Updated:
4 Sep 2016 at 18:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
traviscarden commentedThis is about the most conservative fix I can imagine.
Comment #3
traviscarden commentedComment #4
traviscarden commentedComment #5
Saphyel commentedI tried your patch on my local and works (I don't see any error), but I don't like it, I think the "continues" in code should not exist.
Comment #6
mpotter commentedSpecific warning is
The error occurs only right after clearing cache, it seems to happen when a panel page is being displayed that contains a View Block of content nodes.
The $derivative_id field has value "comment:comment_body". What is odd is that comments are not enabled on this content type (or even this site), so not sure why it's going into the comment entity.
While this patch is a bandaid for the warnings, I'm not sure it's really how to handle this. Seems like a more fundamental issue with Views blocks and entities that have any field mapping.
Edited: You also get related warnings for different fields of various entities:
e.g.
Comment #7
xanoI'm moving this back to needs work, because we haven't found out the root cause and as such do not know whether this is the correct fix. I agree with #5 and #6 in that this hides the warnings, but likely is no viable long-term solution.
I have been trying to dig through the entity field manager's code, but so far no look. Simply disabling its caches to check if perhaps they were simply stale did not help either. One thing that still needs to be checked is whether the
entity.definitions.bundle_field_mapitem from state (key/value storage) as retrieved inEntityFieldManager::getFieldMap()might be stale.Comment #8
tim bozeman commentedYou can also reproduce this error by:
We could have a field.storage, but no derivative. Like when you define a field storage, and wait till a bundle is created to add the field.
Comment #9
xanoThat is the same fix as before. Multiple people expressed their concern at fixing it like this, because we don't know what the cause is and if this fix has side-effects.
When you say derivative, do you mean a field (instance) on an entity bundle?
Comment #10
tim bozeman commentedYes. Sorry about that. I meant field instance.Edit for posterity: The code is looking for a derivative.
Comment #11
xanoI read #8 and the code again and now I understand why the code fails. I'll dig into this again after the weekend. Thanks for sharing the steps to reproduce the problem!
Comment #12
dsnopekI'm able to reproduce this in the same way as #8/#10 explains, ie. having a field storage without any field instances using it. Based on that, I think #2 is probably a fine solution?
Or, we could try to fix this in core by having
EntityManagerInterface::getFieldMap()return fields without instances? There's nothing in it's documentation that would indicate that it wouldn't return fields without instances. But that would be a change, in behavior, so maybe we just document it's current return value?Comment #13
xanoI think that #8 accurately explains how this bug is caused by a wrong assumption.
EntityFieldDeriverexpects to map field data to field storage data 1:1, but fails, because fields do not always have to exist for field storages. Based on my knowledge of Field API I can say that this is a perfectly acceptable situation thatEntityFieldDeriverassumed would never happen.Based on that conclusion, I can say that the original patch is a valid fix in terms of behavior, albeit perhaps not the one that produces the cleanest code.
Comment #14
xanoThis takes @TravisCarden's original approach from #2, but adds documentation and changes a variable name so the situation is more clear.
Comment #16
xanoAlways great if your IDE marks unused variables accordingly.
Comment #17
Anonymous (not verified) commentedI was getting this as well and the patch in #16 seems to solve it.
Comment #18
leksat commented#16 works good for me. The explanatory comment in the patch looks good as well. RTBC +1
Comment #19
chrisroane commentedI was getting this error when running drush cr and #16 fixed it for me.
Comment #20
chrisroane commentedI was geting this error and #16 fixed it for me.
Comment #21
mpotter commentedI like the patch in #16. It documents the problem being solved effectively and fixes the messages.
Comment #22
dsnopekRTBC +1!
Comment #24
japerryYah #16 is much better. We'll need to readdress this later, but for now... Committed.
Comment #25
dsnopekWoohoo! Thanks!
Comment #26
mlhess commented