NodeForm::actions() checks for delete access on new entities

Created on 16 April 2016, about 9 years ago
Updated 30 January 2023, over 2 years ago

At the bottom of NodeForm::actions() the following line calls the entity access system with a 'delete' operation and an entity without an ID (because it's new) when using node add forms. This may lead to crashes in entity access hooks as you'd expect the 'delete' operation to be run against an existing entity.

Also, seeing as the parent ::actions() call only defines the 'delete' form key when the entity isn't new, it makes sense to alter that part of the form only if the key actually exists. It's just cleaner code...

For reference, it caused a crash here: #2706893: Fatal error when creating a node at /node/add/NODE_TYPE

🐛 Bug report
Status

Needs work

Version

9.5

Component
Node system 

Last updated about 4 hours ago

No maintainer
Created by

🇧🇪Belgium kristiaanvandeneynde Antwerp, Belgium

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024