Skip to content
Snippets Groups Projects

Issue #2796341: Entity reference field View output is not used for selected entity display

Open Issue #2796341: Entity reference field View output is not used for selected entity display
3 unresolved threads
3 unresolved threads

Merge request reports

Members who can merge are allowed to add commits.

Merge request pipeline #101033 passed

Pipeline: drupal-2796341

#101036

    Merge request pipeline passed for 2b96b061

    Ready to merge by members who can write to the target branch.
    Loading

    Activity

    Filter activity
    • Approvals
    • Assignees & reviewers
    • Comments (from bots)
    • Comments (from users)
    • Commits & branches
    • Edits
    • Labels
    • Lock status
    • Mentions
    • Merge request status
    • Tracking
    367 370 /** @var \Drupal\Core\Entity\EntityRepositoryInterface $entity_repository */
    368 371 $entity_repository = \Drupal::service('entity.repository');
    372 $labels_data = NULL;
    369 373
    370 $entity_labels = [];
    371 foreach ($entities as $entity) {
    372 // Set the entity in the correct language for display.
    373 $entity = $entity_repository->getTranslationFromContext($entity);
    374 // Check to see if the Selection handler can supply entity labels.
    375 if ($element != NULL) {
    376 $options = $element['#selection_settings'] + [
    377 'target_type' => $element['#target_type'],
    378 'handler' => $element['#selection_handler'],
    379 ];
    380 /** @var /Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface $handler */
    381 $handler = \Drupal::service('plugin.manager.entity_reference_selection')
  • 386 }
    374 387
    375 // Use the special view label, since some entities allow the label to be
    376 // viewed, even if the entity is not allowed to be viewed.
    377 $label = ($entity->access('view label')) ? $entity->label() : t('- Restricted access -');
    388 if ($labels_data === NULL) {
    389 $labels_data = [];
    390 // Fallback to legacy/default behavior for handlers that don't expose
    391 // the new interface for getting autocomplete labels.
    392 foreach ($entities as $entity) {
    393 // Set the entity in the correct language for display.
    394 $entity = $entity_repository->getTranslationFromContext($entity);
    395
    396 // Use the special view label, since some entities allow the label to be
    397 // viewed, even if the entity is not allowed to be viewed.
    398 $label = ($entity->access('view label')) ? $entity->label() : t('- Restricted access -');
  • 376 // viewed, even if the entity is not allowed to be viewed.
    377 $label = ($entity->access('view label')) ? $entity->label() : t('- Restricted access -');
    388 if ($labels_data === NULL) {
    389 $labels_data = [];
    390 // Fallback to legacy/default behavior for handlers that don't expose
    391 // the new interface for getting autocomplete labels.
    392 foreach ($entities as $entity) {
    393 // Set the entity in the correct language for display.
    394 $entity = $entity_repository->getTranslationFromContext($entity);
    395
    396 // Use the special view label, since some entities allow the label to be
    397 // viewed, even if the entity is not allowed to be viewed.
    398 $label = ($entity->access('view label')) ? $entity->label() : t('- Restricted access -');
    399
    400 // Take into account "autocreated" entities.
    401 if ($entity->isNew()) {
  • Guy Elsmore-Paddock added 599 commits

    added 599 commits

    • 66187739...0d134645 - 590 commits from branch project:9.5.x
    • 89ca0b8d - 2796341 - Pull in Changes from Comment 60
    • 964fe2b6 - 2796341 - Fix Return Values of `ViewsSelection::getAutocompleteLabels()`
    • e3829362 - 2796341 - Revise Tests to Verify Desired Escaping Behaviors
    • eea23bb0 - 2796341 - Fix Decoding of Apostrophes and Other Numeric HTML Entities
    • ce0de380 - 2796341 - Make `EntityAutocomplete::getEntityLabels()` Render the Labels
    • 5d5ce1cc - 2796341 - Fix Handling of Entity IDs Equal to Zero
    • 008564ba - 2796341 - Fix Legacy Logic for when `$element` is NULL
    • a1b328f7 - 2796341 - MRF: Extract Logic for Obtaining ER Handle and Add TODO for DI
    • d1efd052 - 2796341 - MRF: Use `t()` or `TranslatableMarkup` Instead of `\t`

    Compare with previous version

  • added 1 commit

    • 673bd6e6 - 2796341 - MRF: Convert Conditional to Ternary

    Compare with previous version

  • added 3 commits

    • fe4a6295 - 2796341 - MRF: Extract Logic for Obtaining ER Handle and Add TODO for DI
    • fc0c6820 - 2796341 - MRF: Use `t()` or `TranslatableMarkup` Instead of `\t`
    • 116e660e - 2796341 - MRF: Convert Conditional to Ternary

    Compare with previous version

  • Guy Elsmore-Paddock added 2262 commits

    added 2262 commits

    • 116e660e...bab4e144 - 2252 earlier commits
    • ef640115 - 2796341 - Pull in Changes from Comment 60
    • 032eca36 - 2796341 - Fix Return Values of `ViewsSelection::getAutocompleteLabels()`
    • ec2fe2f9 - 2796341 - Revise Tests to Verify Desired Escaping Behaviors
    • 8638d2dc - 2796341 - Fix Decoding of Apostrophes and Other Numeric HTML Entities
    • 4553d0c7 - 2796341 - Make `EntityAutocomplete::getEntityLabels()` Render the Labels
    • 721f15ad - 2796341 - Fix Handling of Entity IDs Equal to Zero
    • 9e45b274 - 2796341 - Fix Legacy Logic for when `$element` is NULL
    • 807e7d70 - 2796341 - MRF: Extract Logic for Obtaining ER Handle and Add TODO for DI
    • 9ff987d6 - 2796341 - MRF: Use `t()` or `TranslatableMarkup` Instead of `\t`
    • c50fe346 - 2796341 - MRF: Convert Conditional to Ternary

    Compare with previous version

  • Guy Elsmore-Paddock changed the description

    changed the description

  • Guy Elsmore-Paddock changed target branch from 9.5.x to 10.1.x

    changed target branch from 9.5.x to 10.1.x

  • added 55 commits

    • c50fe346...5406b836 - 45 earlier commits
    • 6af599ab - 2796341 - Pull in Changes from Comment 60
    • 6725852e - 2796341 - Fix Return Values of `ViewsSelection::getAutocompleteLabels()`
    • 71939ede - 2796341 - Revise Tests to Verify Desired Escaping Behaviors
    • c7804239 - 2796341 - Fix Decoding of Apostrophes and Other Numeric HTML Entities
    • 0596412e - 2796341 - Make `EntityAutocomplete::getEntityLabels()` Render the Labels
    • e391de3f - 2796341 - Fix Handling of Entity IDs Equal to Zero
    • e7dda1a4 - 2796341 - Fix Legacy Logic for when `$element` is NULL
    • 154ceef1 - 2796341 - MRF: Extract Logic for Obtaining ER Handle and Add TODO for DI
    • e6427c9c - 2796341 - MRF: Use `t()` or `TranslatableMarkup` Instead of `\t`
    • 0349e927 - 2796341 - MRF: Convert Conditional to Ternary

    Compare with previous version

  • Guy Elsmore-Paddock changed target branch from 10.1.x to 11.x

    changed target branch from 10.1.x to 11.x

  • Guy Elsmore-Paddock added 1319 commits

    added 1319 commits

    • 0349e927...26308296 - 1309 commits from branch project:11.x
    • ef70157f - 2796341 - Pull in Changes from Comment 60
    • 1ba9c1d5 - 2796341 - Fix Return Values of `ViewsSelection::getAutocompleteLabels()`
    • 665e342b - 2796341 - Revise Tests to Verify Desired Escaping Behaviors
    • 4460e48f - 2796341 - Fix Decoding of Apostrophes and Other Numeric HTML Entities
    • bb46ec8a - 2796341 - Make `EntityAutocomplete::getEntityLabels()` Render the Labels
    • 6b73d555 - 2796341 - Fix Handling of Entity IDs Equal to Zero
    • 1107606d - 2796341 - Fix Legacy Logic for when `$element` is NULL
    • 44bb353c - 2796341 - MRF: Extract Logic for Obtaining ER Handle and Add TODO for DI
    • f728e24a - 2796341 - MRF: Use `t()` or `TranslatableMarkup` Instead of `\t`
    • 2b96b061 - 2796341 - MRF: Convert Conditional to Ternary

    Compare with previous version

  • Please register or sign in to reply
    Loading