Generated with the help of an LLM.
I used Claude to help write this summary, the code and the test. I reviewed and tested everything myself.
Problem/Motivation
Child of #3561626. The content type add route (node.type_add, /admin/structure/types/add) only checks the
administer content
types permission, so hook_entity_create_access() and hook_ENTITY_TYPE_create_access() are never called for it. A module that
forbids creating node_type entities can't block the add form. Restricting who can create content types was the case that started #3561626.
Proposed resolution
Use _entity_create_access instead of _permission on this route, like the menu, text format and language add routes already do. The
admin permission of node_type is administer content types, so nothing changes for sites that don't implement the hook.
Remaining tasks
Review the MR.
| Comment | File | Size | Author |
|---|
Issue fork drupal-3643704
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
deruina commentedComment #4
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #5
deruina commentedRebased on main and added #[ShareEnvironment(FALSE)] to the new kernel test, which core requires since #3623409. PHPStan and the test pass locally.
Comment #6
smustgrave commentedFor this one I don't think we need a whole new test file why not NodeAccessTest? This is where AI tests are annoying because they just make a new file and never look to extend an existing file or even an existing test.