- Issue created by @tim-diels
- Status changed to Needs review
almost 2 years ago 12:43pm 14 February 2023 - π§πͺBelgium tim-diels Belgium π§πͺ
I provide a patch as starting point on what to achieve, but It feels like this is not the best way to provide this.
This patch checks if the module field_display_label is installed and overwrites the label with the display label when there is one. - π§πͺBelgium tim-diels Belgium π§πͺ
Best would be to have a plugin for the module to have the display label in the list of the following:
- π«π·France duaelfr Montpellier, France
Thank you for reporting this!
I recently faced a quite similar issue when trying to add custom properties from a custom source plugin. The thing is that the way UI Patterns is built, the source only provide the list of available items but never the associated values. I think that's a big flaw in the design that should be fixed upstream. This way it would allow any module to add sources and reduce the burden of maintaining multiple integrations with a ton of potential contrib modules.
I opened β¨ [2.0.0-alpha1] Source plugins should also provide SourceField value Needs review to get this idea running. In the meantime we could integrate this here. I'd prefer it to be a new option in the least instead of overriding the existing label. What do you think?
- π§πͺBelgium tim-diels Belgium π§πͺ
I sure follow what you say. I was trying to build a source plugin, but was not able to get the appropriate information. So went the quick and dirty way and override the existing label.
I would indeed like to have the options in the list. Every module could provide its own plugin and will be displayed there.
But at this point I failed in getting that.
Great to see you opened an issue with ui patterns to see if it could provide more info for the plugins. Letβs see what happens there? I indeed think the current solution is not the way to go. Letβs postpone this until the other issue gets picked up and fixed? - Status changed to Needs work
almost 2 years ago 5:11pm 14 February 2023 - π«π·France duaelfr Montpellier, France
We could merge something now then remove/refactor it once the UI Patterns issue lands. It's unlikely to be done in the current major version so we might need to wait quite some time before it gets picked.
If we were to merge it in UI Patterns Field Formatter, I'd like to see it as a new field option so we should add a line in
\Drupal\ui_patterns_field_formatters\Plugin\UiPatterns\Source\FieldPropertiesSource::getSourceFields()
(let's call it_display_label
) then add an entirely new condition in the formatter instead of overriding the existing one like you did. - π§πͺBelgium tim-diels Belgium π§πͺ
I love the idea. Great thinking! Hope to have some time soon to get the patch refactored.
- Status changed to Needs review
almost 2 years ago 9:36am 15 February 2023 - π§πͺBelgium tim-diels Belgium π§πͺ
Ok had to fix another issue, so thought on rewriting this in the same time.
I added the field_display_label to the metadata properties and added it to both the formatters. - Merge request !16Issue #3341586: Allow to get the label from the field_display_label module β (Merged) created by tim-diels
- π§πͺBelgium tim-diels Belgium π§πͺ
Added MR for easier follow up.
- Assigned to duaelfr
- π«π·France pdureau Paris
Hi Duaelfr, I take care of 1.0.x reviews, and I assign the 2.0.x review to you.
-
duaelfr β
committed e410eb68 on 2.x authored by
tim-diels β
Issue #3341586: Allow to get the label from the field_display_label...
-
duaelfr β
committed e410eb68 on 2.x authored by
tim-diels β
- π«π·France duaelfr Montpellier, France
Sorry for the massive delay...
Rebased and added dependency injection because I like that better ;)
Thanks! Automatically closed - issue fixed for 2 weeks with no activity.