Move node_test_node_access_all_uid variable to the state system
Move variable_get/_set/_delete to state()->get/set/delete

Files: 
CommentFileSizeAuthor
#6 node_test_node_access_all_uid-1798868-6.patch1.83 KBAlbert Volkman
PASSED: [[SimpleTest]]: [MySQL] 46,311 pass(es).
[ View ]
#4 node_test_node_access_all_uid-1798868-4.patch1.82 KBAlbert Volkman
FAILED: [[SimpleTest]]: [MySQL] 42,244 pass(es), 1 fail(s), and 0 exception(s).
[ View ]
#4 interdiff.txt2.58 KBAlbert Volkman
#2 node_test_node_access_all_uid-1798868-2.patch2.62 KBLuukyb
PASSED: [[SimpleTest]]: [MySQL] 42,120 pass(es).
[ View ]
#1 node_test_node_access_all_uid-1798868.patch1.81 KBLuukyb
PASSED: [[SimpleTest]]: [MySQL] 41,901 pass(es).
[ View ]

Comments

Luukyb’s picture

StatusFileSize
new1.81 KB
PASSED: [[SimpleTest]]: [MySQL] 41,901 pass(es).
[ View ]
Luukyb’s picture

StatusFileSize
new2.62 KB
PASSED: [[SimpleTest]]: [MySQL] 42,120 pass(es).
[ View ]

Added the namespace to the variable and the system_update function.

alexpott’s picture

Status:Needs review» Needs work
Issue tags:+State system

Thanks for the work.

There's no need for the system update as this variable is only ever used during testing. Also the state name should be
node_access_test.no_access_uid as it "belongs" to the node_access_test module.

+++ b/core/modules/node/tests/modules/node_access_test/node_access_test.moduleundefined
@@ -21,7 +21,7 @@ function node_access_test_node_grants($account, $op) {
+  if ($op == 'view' && $account->uid == state()->get('system.node_test_node_access_all_uid', 0)) {

Should be something like as ->get() does not support providing a default value

$no_access_uid = state()->get('node_test_access.no_access_uid') ?: 0;
if ($op == 'view' && $account->uid == $no_access_uid) {
Albert Volkman’s picture

Status:Needs work» Needs review
StatusFileSize
new2.58 KB
new1.82 KB
FAILED: [[SimpleTest]]: [MySQL] 42,244 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

How's this?

Status:Needs review» Needs work

The last submitted patch, node_test_node_access_all_uid-1798868-4.patch, failed testing.

Albert Volkman’s picture

Status:Needs work» Needs review
StatusFileSize
new1.83 KB
PASSED: [[SimpleTest]]: [MySQL] 46,311 pass(es).
[ View ]

Bleh.

Berdir’s picture

Berdir’s picture

Status:Needs review» Reviewed & tested by the community

This is RTBC if it still applies.

webchick’s picture

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.