Problem/Motivation

This module provides field access hook which is based upon property `denominator` to determine access rights.

The problem is that Drupal core Map - \Drupal\Core\Field\Plugin\Field\FieldType\MapItem field type have simple getter

  /**
   * {@inheritdoc}
   */
  public function __get($name) {
    if (!isset($this->values[$name])) {
      $this->values[$name] = [];
    }

    return $this->values[$name];
  }

Which in conjunction with webform_score_entity_field_access is going to mark any Map field type as forbidden.

  if (!$items || !$items[0] || is_null($items[0]->denominator)) {
    return AccessResult::neutral();
  }

  if (!$items[0]->denominator) {
    // No scoring is configured.
    return AccessResult::forbidden()->cachePerPermissions();
  }

Steps to reproduce

Proposed resolution

We should check by field type initiall, if is not fraction, that access is neutral

Remaining tasks

User interface changes

API changes

Data model changes

Command icon 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

valic created an issue. See original summary.

valic’s picture

Issue summary: View changes

valic’s picture

Status: Active » Needs review
valic’s picture