#2666392: Unable to revert third party settings via config import introduced a new optional $id argument to ConfigEntityTypeInterface::getPropertiesToExport(). Without supplying this argument, some entities now throw a SchemaIncompleteException.
We need to supply this argument to avoid prevent the exception from being thrown on Drupal core 8.6 and up.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 2986899-15.patch | 1.72 KB | gabesullice |
| #10 | 2986899-9-followup.patch | 901 bytes | wim leers |
| #7 | interdiff-commit.txt | 554 bytes | gabesullice |
| #5 | 2986899-5.patch | 1.77 KB | gabesullice |
| #2 | 2986899-2.patch | 1.11 KB | gabesullice |
Comments
Comment #2
gabesulliceComment #3
gabesulliceComment #4
gabesulliceAh, I misunderstood what ID needed to be passed to
getPropertiesToExport. It's the ID of a particular config entity, not the ID of the entity type. Still playing around with this. At this point in the code, we don't have a particular entity available.Comment #5
gabesulliceTaking a different approach.
This can be removed because that issue turned out of be outdated by #2666392: Unable to revert third party settings via config import. It didn't resolve the fundamental need and in fact caused this issue.
Comment #7
gabesulliceFixed the CS violation on commit.
Comment #8
wim leersI'm confused by #5. So I checked/read #2483407: Allow configuration schema fallback in ConfigEntityType::getPropertiesToExport() to work without an ID again, and found new replies (#34–#36), which were pointing to #2666392: Unable to revert third party settings via config import, and suddenly #5 made sense.
Still, I have concerns: #2483407-37: Allow configuration schema fallback in ConfigEntityType::getPropertiesToExport() to work without an ID + #2483407-38: Allow configuration schema fallback in ConfigEntityType::getPropertiesToExport() to work without an ID + #2666392-53: Unable to revert third party settings via config import.
OMG I totally never realized we can finally use
finallyin Drupal 8! (Because it requires PHP >=5.5.9.)Comment #9
gabesulliceI think the committed fix is fine (for JSON API). Ideally we wouldn't need
$base_propertiesat all, but as long as it's possible for the exception to be thrown or for NULL to be returned, as it was before, then we'll need that variable.When/if the upstream issues you linked to are resolved, the exception simply will be thrown under fewer circumstances/not at all. IOW, the code will gracefully just start working better. The only thing that I can see for us to do in this issue is add a todo to monitor the upstream issue and remove the try/catch block if
getPropertiesToExportstops throwing an exception.Comment #10
wim leersYou're right.
Per #2483407-39: Allow configuration schema fallback in ConfigEntityType::getPropertiesToExport() to work without an ID, we need to bring back the deleted lines quoted below, because Alex Pott has confirmed that there's still more work to be done — previously he said it was a duplicate of #2666392, but he's changed his mind on that 👍.
Comment #11
gabesulliceLooks good, but not committing yet because once #2986901: Followup for #2666392: ConfigEntityTypeInterface::getPropertiesToExport no longer returns NULL, throws exception instead lands, we will be able to just revert this commit entirely.
Comment #12
wim leersOh, HAH! Unexpected. But indeed even better! 👌
Comment #13
wim leersThis is blocked on the #2986901: Followup for #2666392: ConfigEntityTypeInterface::getPropertiesToExport no longer returns NULL, throws exception instead issue in core now, which is currently RTBC. Looking forward to doing #11.
Thanks for being so diligent, @gabesullice!
Comment #14
wim leers#2986901: Followup for #2666392: ConfigEntityTypeInterface::getPropertiesToExport no longer returns NULL, throws exception instead landed, in both 8.7 and 8.6! The honor is yours, @gabesullice!
Comment #15
gabesulliceJust gonna double check before I push the revert.
Comment #17
gabesullice