In #2233883: Link migration needs to convert source url into the appropriate route format for storage we've complete the config schema for the link field. This has exposed missing test coverage.
+ options:
+ type: mapping
+ label: 'Link options'
+ mapping:
+ query:
+ type: sequence
+ label: 'Url query key value pairs'
+ sequence:
+ - type: string
+ fragment:
+ type: string
+ label: 'Url fragment'
+ absolute:
+ type: boolean
+ label: 'Is this Url absolute'
+ https:
+ type: boolean
+ label: 'If the Url should use a secure protocol'
+ attributes:
+ type: sequence
+ label: 'Link attributes'
+ sequence:
+ - type: string
It is possible that the "attributes" is dead code... from an IRC chat with @GaborHojtsy
14:35 GaborHojtsy
alexpott: what are even link attributes?!
14:36 GaborHojtsy
alexpott: that looks liek some contrib extension point that is not well defined at all
14:36 alexpott
GaborHojtsy: no clue
14:36 GaborHojtsy
// Exposing the attributes array in the widget is left for alternate and more
14:36 GaborHojtsy
// advanced field widgets.
14:36 GaborHojtsy
$element['attributes'] = array(
14:36 GaborHojtsy
alexpott: that is in LinkWidget
14:37 GaborHojtsy
alexpott: but Url::_construct() does not allow for an ‘attributes’ field for Urls… so it may be set but then not actually used here
14:38 GaborHojtsy
alexpott: so its some unclear contrib extension point at best AFAIS
14:38 alexpott
GaborHojtsy: it might well be dead code
Comments
Comment #1
gábor hojtsyThere is also a theoretical language key that is not even included here even though theoretically supported on Url.
Comment #2
alexpottComment #13
catchAdditional test coverage is a task. But we might want to remove this key instead, which would also be a task.
Comment #17
anybodyFor some of these values, it would also be super helpful to have a UI for that. In my current case for the fragment: #3516646: Allow entering a fragment attribute
Comment #18
dcam commented> GaborHojtsy: it might well be dead code
This isn't far off.
LinkWidgetessentially throws away any value that's stored in it. See #3056652: Link options attributes removed on save. My proposal is to updateLinkWidget::massageFormValues()to fix this. I'm not sure this will add all necessary tests for the attributes, so I'm leaving this issue open.Comment #19
dcam commented