Issue #2796341: Entity reference field View output is not used for selected entity display
3 unresolved threads
Merge request reports
Activity
added 403 commits
-
cd6849fa...eb5e3b55 - 398 commits from branch
project:9.5.x
- d4407da8 - 2796341 - Pull in Changes from Comment 60
- b5b36a6b - 2796341 - Fix Return Values of `ViewsSelection::getAutocompleteLabels()`
- 79bd5b74 - 2796341 - Revise Tests to Verify Desired Escaping Behaviors
- 8b5639fc - 2796341 - Fix Decoding of Apostrophes and Other Numeric HTML Entities
- 31a7c51c - 2796341 - Make `EntityAutocomplete::getEntityLabels()` Render the Labels
Toggle commit list-
cd6849fa...eb5e3b55 - 398 commits from branch
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') changed this line in version 5 of the diff
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 -'); Actually, this method is static... so I believe I have to use
new TranslatableMarkup()
here, according to https://www.drupal.org/project/drupal/issues/3113904.changed this line in version 5 of the diff
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()) { changed this line in version 6 of the diff
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`
Toggle commit list-
66187739...0d134645 - 590 commits from branch
added 1 commit
- 673bd6e6 - 2796341 - MRF: Convert Conditional to Ternary
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
Toggle commit listadded 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
Toggle commit listadded 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
Toggle commit list-
0349e927...26308296 - 1309 commits from branch
Please register or sign in to reply