Needs work
Project:
Drupal core
Version:
main
Component:
entity system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Dec 2017 at 10:26 UTC
Updated:
14 Nov 2022 at 06:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
berdirI would expect that should be done on validation, might be related to #2841291: Fix NOT NULL handling in the entity storage and 'primary key' changes when updating the storage definition of an identifier field, if the problem indeed only happens when saving. It would be a rest-specific problem if doing that would completely break the entity, so that validation wouldn't work anymore.
Comment #3
cburschkaThis needs to be tested together with #2824851-203: EntityResource::patch() makes an incorrect assumption about entity keys, hence results in incorrect behavior, since the request will otherwise be denied without hitting the error.
(Should return an HTTP 500.)
Comment #4
wim leers+1
Comment #5
wim leers#3: I think the fatal error should be reproducible even without using REST.
Something like:
… should trigger the same fatal error.
Such a test would not depend on #2824851: EntityResource::patch() makes an incorrect assumption about entity keys, hence results in incorrect behavior landing first.
Comment #6
cburschkaYou're right, this is much simpler.
(Adding this to FieldTranslationSqlStorageTest, since it's vaguely related.)
Comment #7
wim leers👌
Comment #8
berdirAn invalid entity isn't prevented from being saved, you need to explicitly assert that there are validation errors.
Comment #11
wim leersThe point was to have a failing test, which we now do have. Adding validation plus explicit validation error assertion is the next step, right?
Comment #12
wim leersOr, put differently… @Berdir wrote in #2:
#6 does prove that this is a problem only when saving, because in its backtrace, it lists:
Both of which are
save()methods.Plus, #6 of course doesn't use the REST module at all, which means it definitely proves this is not a REST-specific problem.
Comment #13
wim leers@effulgentsia opened the related #2933408: Remove broken allowance of empty langcode in a PATCH request.
Comment #24
mstrelan commentedReviewing this as part of the Bug Smash Initiative. Patch in #6 was no longer applying so I've re-rolled it. The patch still fails for me so I assume this is still an issue, didn't quite follow all the related issues. Would be good to have a concise description of the problem in the issue summary.
Comment #26
Ankit.Gupta commentedComment #27
mstrelan commentedThis is the second time I've seen Ankit.Gupta repost the exact same patch someone else posted. Unchecking the suggested credit box and setting back to NW.