Problem/Motivation

Is it normal TokenSource::getContextDefinitions() always return entity:

  • also when not created in an entity context
  • also when there is no entity related token in the value

Proposed resolution

Return a context related to the value (nothing if no token in the value). I guess there is somethign in Drupal token API to guess that, but let's check.

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

pdureau created an issue. See original summary.

pdureau’s picture

Title: [2.0.1] TokenSource::getContextDefinitions() always return entity » [2.0.11] TokenSource::getContextDefinitions() always return entity
pdureau’s picture

Title: [2.0.11] TokenSource::getContextDefinitions() always return entity » TokenSource::getContextDefinitions() always return entity
Assigned: Unassigned » just_like_good_vibes
pdureau’s picture

just_like_good_vibes’s picture

Project: UI Patterns (SDC in Drupal UI) » Display Builder
Version: 2.0.x-dev » 1.0.x-dev
Assigned: just_like_good_vibes » pdureau

the entity in the context_definitions of UI Patterns' TokenSource is marked not required.
it's probably worth to take into account :)

pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Active » Needs review

mogtofu33 made their first commit to this issue’s fork.

  • mogtofu33 committed 7ff41247 on 1.0.x authored by pdureau
    fix: #3549567 TokenSource::getContextDefinitions() always return entity...
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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