Closed (fixed)
Project:
Paragraphs
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
12 Feb 2017 at 13:40 UTC
Updated:
28 Feb 2017 at 16:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
miro_dietikerSounds at least major.
However, we have great passing test coverage.
How can we reproduce your situation.
Comment #3
heyyo commentedThis error came just after installing the last dev version. It occurs only on node edition page which contains one paragraph field already filed with content from nested paragraphs.
Downgrading to previous dev version fixed my issue(the one of 4/5 days ago)
Comment #4
miro_dietikerYeah there was a recent fix that we use label of entity reference fields to populate the summary.
That code doesn't check the interface while not all entities (for instance config targets) do not have a label. Also not sure if we properly check if the entity load succeeded in the field item. (Problem stale field items where entities could be deleted)
Needs a fix and better test coverage.
Comment #5
thenchev commentedI can take a look.
Comment #6
thenchev commentedIt would probably help a lot if i get some more information, if someone has been thinking about this, when this can happen. Is having config targets the only situation?
I will test in the meantime.
Comment #7
berdirif ($field_type = $value->getType() == 'entity_reference') {
if (!in_array($key, ['type', 'uid', 'revision_uid'])) {
$summary[] = $paragraphs_entity->get($key)->entity->label();
}
}
There isn't really a way to check it, best we can do is a fallback for the ID. Not the problem here, it would just result in an empty string if there is no label.
This however is exactly the problem. Check with if (...->entity) before calling a method on it.
To reproduce, just delete the entity we're using for testing this, then reload the edit form with it closed.
Comment #8
thenchev commented@Berdir thanks
There might be a better place for the test but didn't find any obvious space?
Comment #10
thenchev commentedComment #11
berdirAbout the test, the code that added that also added tests: #2850788: Add test for collapsed user Paragraph summary, I would just expand on that.
Comment #12
thenchev commented@Berdir
Yea, makes sense. Wanted to avoid having to create paragraph type and configuring it but not that much extra code. Thanks again.
Comment #14
thenchev commentedComment #16
miro_dietikerCommitted with a comment. Thx.