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

Created on 16 April 2016, about 8 years ago
Updated 18 February 2023, over 1 year 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

10.1 ✨

Component
Node systemΒ  β†’

Last updated 19 minutes ago

No maintainer
Created by

πŸ‡§πŸ‡ͺBelgium kristiaanvandeneynde Antwerp, Belgium

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

Comments & Activities

Not all content is available!

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

  • The Needs Review Queue Bot β†’ tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide β†’ to find step-by-step guides for working with issues.

  • @markdorison opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States markdorison
  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β†’ as a guide.

    Hiding files as the fix is being done in MR 3347

    Moving to NW as there are failures in the MRs

    Did not test or review yet.

Production build 0.69.0 2024