Move node_access table to dynamic-creation for easier tests

Created on 25 March 2016, about 9 years ago
Updated 20 March 2025, 18 days ago

Problem/Motivation

In a KernelTest, you need only install the node schema to create a node. To UPDATE a node, however, you need to also install the node_access schema. That's because the node grants system ignores an initial save, but runs a delete on updates. This is not at all obvious if you're not expecting it. (I had to have Berdir fill me in, after which it made sense, kind of.)

Proposed resolution

Berdir and I discussed this a bit in IRC. We could move the node_grants table to be lazily-generated, the way the menu_router table and cache tables now are (along with a few others, I think?).

Pros: No need to manually create the table; it "just works" as soon as it's needed. The table needn't be created if not using SQL for node storage.

Cons: Tests that currently do manually create the node_grants schema will need to be updated. Possible mitigation: Would anything break if we left the schema definition in node_schema() for one minor version? (I don't know off hand.)

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

node system

Created by

πŸ‡ΊπŸ‡ΈUnited States Crell

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.

Production build 0.71.5 2024