- Issue created by @coaston
- π©πͺGermany rogerpfaff Munich
Taking a deeper look I think there must be a change in return values somewhere? The code does not look like it could work as the return values that get checked are not keyed with 'value' but target_id.
The code in question is this one
case 'shared': //allow if user shares a value is in this field $user = User::load(\Drupal::currentUser()->id()); $user_field = $config->getExtra(); $user_field_values = $user->get($user_field)->getValue(); foreach($node_field_value as $value){ foreach($user_field_values as $uvalue){ >>> if($value['value'] == $uvalue['value'] ){ $control_entity = $user; $grant_access_read = $config_bool_read ? true : false; $grant_access_update = $config_bool_update ? true : false; $grant_access_delete = $config_bool_delete ? true : false; break; } } } break;
The arrays $node_field_value and $user_field_values look like this
$node_field_value Array ( [0] => Array ( [target_id] => 26 ) )
$user_field_values Array ( [0] => Array ( [target_id] => 25 ) [1] => Array ( [target_id] => 26 ) )
- π©πͺGermany rogerpfaff Munich
Also the module is basically unusable with this error so setting this to critical.
- π©πͺGermany rogerpfaff Munich
There is now a MR to fix this.
It's only changing the index value to target_id if you want to quick fix this in your install. See the code block marked with >>> above.
- Merge request !11#3389641 Check for target_id instead of value for shared field references. β (Open) created by Unnamed author