Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

joachim’s picture

Title: intro text for field groups » missing UI for description text for field groups
Component: Miscellaneous » User interface
Category: Feature request » Bug report
Issue summary: View changes

Actually, I think this is a bug: there's already code to output this, just no UI.

Updating the summary.

joachim’s picture

Here'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!)

joachim’s picture

Looks like it's not quite right, as I get two description properties in the config export:

    group_foo:
      children:
        - field_1
        - field_2
        - field_3
        - field_4
      parent_name: ''
      weight: 3
      label: 'My group'
      format_type: details
      format_settings:
        label: 'My group'
        description: 'Description text.'
        open: true
        required_fields: true
        id: ''
        classes: ''
      description: ''

Unfortunately I don't have any more time to work on this though!

mariagwyn’s picture

If 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.

phjou’s picture

Hi,
I fix the patch which was broken with the last changes on the dev branch. The patch works well on my environment.

phjou’s picture

The 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.

phjou’s picture

I 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.

phjou’s picture

When 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.

phjou’s picture

Version: 8.x-1.x-dev » 8.x-3.x-dev
phjou’s picture

After 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.

GuillaumeDuveau’s picture

Status: Needs review » Needs work

The patch from #11 does not apply to latest 3.x-dev

GuillaumeDuveau’s picture

Status: Needs work » Needs review
FileSize
14.4 KB

Here'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.

GuillaumeDuveau’s picture

New patch adding a check to avoid a notice

GuillaumeDuveau’s picture

Another notice fix

GuillaumeDuveau’s picture

Another one... And I'm not sure why @phjou didn't use getDescription.

GuillaumeDuveau’s picture

Another one. Also I'm not sure why @phjou didn't use getDescription, but I don't have more time to dig for now.

GuillaumeDuveau’s picture

GuillaumeDuveau’s picture

FileSize
14.58 KB

Another patch... I should have dedicated more time instead of many patches :-S

NickDickinsonWilde’s picture

Status: Needs review » Reviewed & tested by the community

Works 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.

NickDickinsonWilde’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
14.58 KB

With 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.

GuillaumeDuveau’s picture

@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

Vidushi Mehta’s picture

FileSize
452 bytes

Adding interdiff of patch 18 and 21 for more clarity. Hope it helps.

GuillaumeDuveau’s picture

Status: Needs review » Reviewed & tested by the community

Oh, that's all ! Thanks a lot! Reviewed & tested, then.

GuillaumeDuveau’s picture

Status: Reviewed & tested by the community » Needs work

Does 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...

GuillaumeDuveau’s picture

In 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

NickDickinsonWilde’s picture

Status: Needs work » Needs review
FileSize
13.16 KB

Rerolled

Status: Needs review » Needs work

The last submitted patch, 27: description_ui-2824350-27.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

NickDickinsonWilde’s picture

Hey I see automated tests are working again... guess I'll have to look at this to fix those results later

Anybody’s picture

Any news on this @NickWilde?

  • zuuperman committed 5da2c1e on 8.x-3.x
    Issue #2824350 by guix, phjou, joachim, NickWilde, Vidushi Mehta:...
nils.destoop’s picture

Status: Needs work » Fixed

I committed an update that includes the support to enter descriptions.

Anybody’s picture

Thank you very much, zuuperman, perfect! :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.