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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Luukyb’s picture

Luukyb’s picture

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
FileSize
2.58 KB
1.82 KB

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
FileSize
1.83 KB

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.