Problem/Motivation

https://git.drupalcode.org/project/advancedform/-/merge_requests/16#note...

From @xurizaemon:

A separate note, which may want to go into a separate issue unless you like to tackle it here.
The form description at /admin/config/advancedform/advancedformsettings says,

Rule selectors to hide inputs, eg node-form:[#revision-information] will hide the revision information fieldset on node forms. One rule per line.

This is not quite correct. AFAICT it should recommend .node-form :[#edit-revision-information] or .node-form:[ #edit-revision-information ]:

  • The correct selector for that example is .node-form, or the CSS will look for a <node-form> element which doesn't exist.
  • The CSS generator requires a space to target fields within the form element, which is only generated if there's a space after the square bracket. If this is omitted, no fields will be hidden.
  • The revision information element is now targeted with #edit-revision-information!

This UX has always been confusing to me 😁 might be worth copying some examples from previous comment to README for clarity when we tackle that?
We could insert a space in this line ($selector . ' ' . $concatSelectors . ' {' . PHP_EOL;), does it feel likely anyone is depending on the current behaviour of not inserting a space? Two spaces would be harmless in a CSS selector ...

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ericgsmith created an issue. See original summary.

ericgsmith’s picture

Version: 2.x-dev » 2.0.x-dev

ericgsmith’s picture

So we can't auto add the space as the select-* classes depend on there being no space.

ericgsmith’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • ericgsmith committed dce4df5c on 2.0.x
    fix: #3559701 Form description is wrong
    
    By: ericgsmith
    By: xurizaemon
    

Status: Fixed » Closed (fixed)

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