Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The formatter plugins have code that is there to output a description, but the admin UI is missing:
if ($this->getSetting('description')) {
$element += array(
'#description' => $this->getSetting('description'),
);
}
Comments
Comment #2
joachim CreditAttribution: joachim at Torchbox commentedActually, I think this is a bug: there's already code to output this, just no UI.
Updating the summary.
Comment #3
joachim CreditAttribution: joachim at Torchbox commentedHere's a patch on RC4, and my attempt to apply that to HEAD (which has changed rather a lot since RC4, so might not be quite right!)
Comment #4
joachim CreditAttribution: joachim at Torchbox commentedLooks like it's not quite right, as I get two description properties in the config export:
Unfortunately I don't have any more time to work on this though!
Comment #5
mariagwyn CreditAttribution: mariagwyn commentedIf anyone has worked on this, I would be happy to test. I would like to be able to add group descriptions, especially to details. Ideally, I would love to be able to have that description at the TOP of the fieldgroup, but that may be its own issue in overriding the default field twig file.
Comment #6
phjouHi,
I fix the patch which was broken with the last changes on the dev branch. The patch works well on my environment.
Comment #7
phjouThe export is quite strange indeed. We also have the label in double but the value is set in both cases.
I found that the description is not in the schema, but fixing it is not enough.
Comment #8
phjouI have changed how it works. I now have the same behaviour than the label, and thanks to that the export keep the description field uptodate.
Comment #9
phjouWhen the Plugin does not support description, the description input is not there and the submit value does not exist. I've just added a test to check if we have the description value before using it.
Comment #10
phjouComment #11
phjouAfter some research, the label was unset only in the FieldGroupAddForm. And the description was following the same behaviour, so both were in double into the export.
The unset into the FieldGroupAddForm has been moved into the field_group_group_save function in order to avoid saving the label and the description into the format_settings in some cases.
The export should be ok now.
Comment #12
GuillaumeDuveauThe patch from #11 does not apply to latest 3.x-dev
Comment #13
GuillaumeDuveauHere's a re-rolled patch (and some cleanup). The tests should be failing (they fail locally). But I think it could be because of other changes in 3.x-dev.
Comment #14
GuillaumeDuveauNew patch adding a check to avoid a notice
Comment #15
GuillaumeDuveauAnother notice fix
Comment #16
GuillaumeDuveauAnother one... And I'm not sure why @phjou didn't use getDescription.
Comment #17
GuillaumeDuveauAnother one. Also I'm not sure why @phjou didn't use getDescription, but I don't have more time to dig for now.
Comment #18
GuillaumeDuveauComment #19
GuillaumeDuveauAnother patch... I should have dedicated more time instead of many patches :-S
Comment #20
NickDickinsonWildeWorks well currently with latest dev and 8.5.x
It does touch a couple lines that aren't really in scope but I think it should just be comitted with that as they are valid code standards changes and they're in it all ready.
Comment #21
NickDickinsonWildeWith using this patch more, I've come to the conclusion that it would be much more useful to have the description be a textarea rather than a textfield. Patch attached with just one change.
Comment #22
GuillaumeDuveau@Nick, I agree with the textarea. I applied your new patch and tested it, works great.
Could you provide an interdiff patch with mine please, if you want me to check it ? https://www.drupal.org/documentation/git/interdiff
Comment #23
Vidushi Mehta CreditAttribution: Vidushi Mehta at gai Technologies Pvt Ltd commentedAdding interdiff of patch 18 and 21 for more clarity. Hope it helps.
Comment #24
GuillaumeDuveauOh, that's all ! Thanks a lot! Reviewed & tested, then.
Comment #25
GuillaumeDuveauDoes not apply any more since latest commits on 8.x-3.x. It's getting a little bit boring, it has been already re-rolled 2 times...
Comment #26
GuillaumeDuveauIn fact it seems that the latest commit it works on is https://cgit.drupalcode.org/field_group/commit/?id=9ab1b9963a07bdefde482...
So maybe we didn't have the latests dev versions or the commits were done but not pushed...
Anyway if you want to freeze on that commit:
composer require drupal/field_group:3.x-dev#9ab1b9963a07bdefde4829b025a1ea56cb63e03e
Comment #27
NickDickinsonWildeRerolled
Comment #29
NickDickinsonWildeHey I see automated tests are working again... guess I'll have to look at this to fix those results later
Comment #30
AnybodyAny news on this @NickWilde?
Comment #32
nils.destoop CreditAttribution: nils.destoop as a volunteer and at Wunder commentedI committed an update that includes the support to enter descriptions.
Comment #33
AnybodyThank you very much, zuuperman, perfect! :)