Skip to content
Snippets Groups Projects

Issue #3458580 fix missing constraints

1 unresolved thread

Closes #3458580

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 356 356 'storage' => $all_string_storage_props,
    357 357 'format_any_prop' => [
    358 358 'ℹ︎file␟description',
    359 'ℹ︎file␟entity␜␜entity:file␝filemime␞0␟value',
    360 'ℹ︎file␟entity␜␜entity:file␝filename␞0␟value',
    • Comment on lines +359 to +360
      Author Maintainer

      These new options seem to make sense to me. as the file name and file mime values will be strings

    • They do make sense, because we're trying to find all "string" shapes, and as you say, filemime and filename both are strings. So I don't quite understand what you're saying here?

    • Ah, I think I see what you mean. Neither of these are prose, yet are being matched against it.

      Whereas

      function experience_builder_entity_base_field_info_alter(array &$fields, EntityTypeInterface $entity_type): void {
        // The File entity type's `filename` and `filemime` base fields use the
        // `string` field type but are NOT prose (which is the default semantic for
        // that field type).
        // @see \Drupal\experience_builder\Plugin\Field\FieldType\StringItemOverride
        if ($entity_type->id() === 'file') {
          $fields['filename']->addPropertyConstraints('value', ['StringSemantics' => StringSemanticsConstraint::STRUCTURED]);
          $fields['filemime']->addPropertyConstraints('value', ['StringSemantics' => StringSemanticsConstraint::STRUCTURED]);
          $fields['uri']->setRequired(TRUE);
        }
      
      }

      means they SHOULD NOT be matched.

      I debugged this, and turns out that this is where the logic that you removed plays a key role :grimacing:

    • Wim Leers changed this line in version 9 of the diff

      changed this line in version 9 of the diff

    • Fixed in aae1a1f2.

    • Please register or sign in to reply
  • Ted Bowman added 1 commit

    added 1 commit

    Compare with previous version

  • Ted Bowman added 1 commit

    added 1 commit

    Compare with previous version

  • Ted Bowman added 1 commit

    added 1 commit

    Compare with previous version

  • Ted Bowman marked this merge request as ready

    marked this merge request as ready

  • Wim Leers
  • Wim Leers
  • Wim Leers
  • Wim Leers added 1 commit

    added 1 commit

    Compare with previous version

  • Wim Leers added 1 commit

    added 1 commit

    • 2e5f935b - Clarify comments after further research.

    Compare with previous version

  • Wim Leers
  • Wim Leers added 1 commit

    added 1 commit

    • 785afacc - Remove obsolete `@todo` — see...

    Compare with previous version

  • Wim Leers added 1 commit

    added 1 commit

    • aae1a1f2 - Document in great detail where constraints for data leafs is authoritatively...

    Compare with previous version

  • Wim Leers approved this merge request

    approved this merge request

  • Wim Leers added 10 commits

    added 10 commits

    • f633d363 - 1 commit from branch project:0.x
    • f53e8162 - find all constraints
    • ff4701a4 - update expected matches
    • a38779b3 - clean up
    • b6361908 - added todo to new issue
    • 97ee1a87 - fix comment
    • 184e376f - Remove obsolete `@todo`.
    • 2677f246 - Clarify comments after further research.
    • 5dc6dbe0 - Remove obsolete `@todo` — see...
    • 3eee6e39 - Document in great detail where constraints for data leafs is authoritatively...

    Compare with previous version

  • merged

  • Please register or sign in to reply
    Loading