- Issue created by @plopesc
- Merge request !8411Issue #3450518: Add a generic trait for logic to convert references into Urls in LinkWidget β (Open) created by plopesc
- Status changed to Needs review
6 months ago 10:21am 14 June 2024 - πͺπΈSpain plopesc Valladolid
Initial approach moving the logic to a trait in the core namespace, so it could be used by Link module and others , avoiding to add the dependency on Link module.
A good candidate to make use of this trait would be π Provide a NavigationLinkBlock Plugin and use Help as an usage example Needs review once that MR gets in.
Final trait placement and/or Name is open for discussion, but this initial MR is ready for review.
- Status changed to RTBC
6 months ago 6:20pm 19 June 2024 - πΊπΈUnited States smustgrave
Move seems straight forward and non disruptive since function names are same.
I drafted a simple CR to announce the new trait here https://www.drupal.org/node/3455776 β
- π¬π§United Kingdom alexpott πͺπΊπ
In an ideal world...
if ($entity_type == 'node' && $entity = \Drupal::entityTypeManager() ->getStorage($entity_type) ->load($entity_id)) { $displayable_string = EntityAutocomplete::getEntityLabels([$entity]); }
the validation would some how allow us to use injectable code - a service or something - but it doesn't so this is okay and allows this code to be shared. See how \Drupal\Core\Form\FormValidator::doValidateForm() works.
- Status changed to Needs work
6 months ago 9:32am 28 June 2024 - π¬π§United Kingdom alexpott πͺπΊπ
Think about this another way - should we introduce another render element - or could we move this to \Drupal\Core\Render\Element\Url and have it as an optional thing?
- π¬π§United Kingdom alexpott πͺπΊπ
Looking at how we need to manipulate the value we should add a new form element that accepts a Url object as the value.