In today's episode of "there's an hour of my life I'll never get back..."
In the Spark installation profile, I attempted to create an "About Us" page in the little demo module that loads as part of the install profile: #1722802: Add an "About us" page Simple enough task, right? BZZT. WRONG. Why?
Because as dman so eloquently lays out:
spark_demo is listed as a requirement for spark : so will run its install before the spark install.
But it's the spark.install that creates a 'page' content type after that.
If I'd gotten an error such as "Invalid node type 'page'" when I called this function, I could maybe have figured this out. But with it silently doing nothing, I was completely at a loss, and dman saved my bacon.
Let's be nicer to people in this situation. :)
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | node_save_should-1723108-21.patch | 112.11 KB | nitesh sethia |
| #15 | core-throw_exception_in_node_save-1723108-15.patch | 3.04 KB | marcin.wosinek |
| #11 | core-throw_exception_in_node_save-1723108-11.patch | 3.47 KB | marcin.wosinek |
Comments
Comment #1
marcin.wosinek commentedHere is patch. It works, but I'm not sure if I've put code in right place.
Comment #3
marcin.wosinek commentedAnd now fixes for existing testes.
Comment #4
marcin.wosinek commentedStatus change.
Comment #6
marcin.wosinek commentedRerolling
Comment #7
marcin.wosinek commentedStatus update
Comment #9
marcin.wosinek commented#6: core-throw_exception_in_node_save-1723108-6.patch queued for re-testing.
Comment #11
marcin.wosinek commentedFix in patched tests; and adding one assertion to prevent nasty error we've got before (PathLanguageTest.php).
Comment #13
marcin.wosinek commented#11: core-throw_exception_in_node_save-1723108-11.patch queued for re-testing.
Comment #15
marcin.wosinek commented1 minor fix which seems to be unrelated, and we try again. What's funny it works locally.
Comment #18
alansaviolobo commentedComment #19
joburgalex commentedTried to re-roll at Amsterdam2014. Unfortunately it failed and trying to find the culprit was a bit problematic.
The patch needs to be updated for files that have moved. (i.e. /core/modules/entity/lib/Drupal/entity/Tests/ is now /core/modules/system/src/Tests/Entity/).
It also uses the function node_type_save which seems to be deprecated in Drupal8. Will try and revisit this in the future.
Comment #20
nitesh sethia commentedWorking on it.
Comment #21
nitesh sethia commentedRerolled the patch
Comment #36
acbramley commentedSurprised to see this is still an issue, and not specific to nodes (tested with block_content as well). Block content will even let you edit the entity, Node throws an error
Call to a member function getPreviewMode() on null in Drupal\node\NodeForm->actions()We should be able to throw an error at the storage level.