Skip to content
Snippets Groups Projects

Issue #3254575: Entities tokens might cause problems when field prefix is empty

Open Issue #3254575: Entities tokens might cause problems when field prefix is empty
3 unresolved threads
Open Maxime Roux requested to merge issue/drupal-3254575:3254575-entities-tokens-might into 11.x
3 unresolved threads

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
597 /**
598 * Checks if a field machine name is a token.
599 *
600 * @see https://www.drupal.org/project/drupal/issues/3254575
601 *
602 * @param string $value
603 * The machine name, not prefixed.
604 * @param array $element
605 * An array containing the structure of the 'field_name' element.
606 * @param \Drupal\Core\Form\FormStateInterface $form_state
607 * The current state of the form.
608 *
609 * @return bool
610 * Whether or not the field machine name is a token.
611 */
612 protected function fieldNameIsAToken($value, $element, FormStateInterface $form_state) {
  • 83 84 * (optional) The entity field manager.
    84 85 * @param \Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository
    85 86 * (optional) The entity display repository.
    87 * @param \Drupal\Core\Utility\Token|null $token
    88 * (optional) The token service.
    86 89 */
    87 public function __construct(EntityTypeManagerInterface $entity_type_manager, FieldTypePluginManagerInterface $field_type_plugin_manager, ConfigFactoryInterface $config_factory, EntityFieldManagerInterface $entity_field_manager = NULL, EntityDisplayRepositoryInterface $entity_display_repository = NULL) {
    90 public function __construct(EntityTypeManagerInterface $entity_type_manager, FieldTypePluginManagerInterface $field_type_plugin_manager, ConfigFactoryInterface $config_factory, EntityFieldManagerInterface $entity_field_manager = NULL, EntityDisplayRepositoryInterface $entity_display_repository = NULL, Token $token = NULL) {
  • Sourabh Jain added 345 commits

    added 345 commits

    • cd7d188c...c284ccad - 341 commits from branch project:9.3.x
    • 2b414713 - Checks if a field machine name is taken by a token when field_prefix is empty
    • 1aad8334 - Add functional test
    • a490d8ee - Inject dependency since the error I met earlier was because of a typo
    • 9a213af8 - Definitively not a time to code

    Compare with previous version

  • 736 736 $this->assertSession()->addressEquals($url);
    737 737 }
    738 738
    739 /**
    740 * Tests that a field machine name can't be equal to a token name.
    741 */
    742 public function testTokenFieldName() {
  • Maxime Roux added 5781 commits

    added 5781 commits

    Compare with previous version

  • Maxime Roux added 1 commit

    added 1 commit

    • 63b5bbde - Issue #3254575 by macsim: Collision between tokens and fields machine name

    Compare with previous version

  • Maxime Roux added 1 commit

    added 1 commit

    • 33bba82b - Issue #3254575 by macsim: Collision between tokens and fields machine name

    Compare with previous version

  • Maxime Roux added 1 commit

    added 1 commit

    • dc1abfd5 - Issue #3254575 by macsim: Collision between tokens and fields machine name

    Compare with previous version

  • Maxime Roux added 1 commit

    added 1 commit

    • c892df3b - Issue #3254575 by macsim: Collision between tokens and fields machine name

    Compare with previous version

  • Maxime Roux added 1 commit

    added 1 commit

    • 7cad9a33 - Issue #3254575 by macsim: Collision between tokens and fields machine name

    Compare with previous version

  • Maxime Roux added 1 commit

    added 1 commit

    • d59230ce - Issue #3254575 by macsim: Collision between tokens and fields machine name

    Compare with previous version

  • Maxime Roux added 1 commit

    added 1 commit

    • 16274a7a - Issue #3254575 by macsim: Collision between tokens and fields machine name

    Compare with previous version

  • Maxime Roux added 1 commit

    added 1 commit

    • 48ff636e - Issue #3254575 by macsim: Collision between tokens and fields machine name

    Compare with previous version

  • Please register or sign in to reply
    Loading