saveEditedEntityRecord
does not always save the entity record
#67161
Labels
[Package] Core data
/packages/core-data
[Type] Bug
An existing feature does not function as intended
Description
saveEditedEntityRecord
does not always save the entity record, meaning that bothsaveEditedEntityRecord
andsaveEntityRecord
need to be called in order to save an entity record successfully.Taking a quick look at the
saveEditedEntityRecord
function, it does callsaveEntityRecord
, but there are some cases where I believe it's returning early unnecessarily, meaningsaveEntityRecord
needs to be specifically called. I think it's whenrecordId
isundefined
, which it will be if saving global site settings which do not require an ID.This came up while working on #65426.
Step-by-step reproduction instructions
Try saving the global site settings via
saveEditedEntityRecord
:The site settings will not be saved. However, if you run
saveEntityRecord
immediately before it, the site settings will be saved successfully:Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: