The collapsible feature has to be converted to HTML 5 details in Drupal 8.

Comments

joyceg created an issue. See original summary.

joyceg’s picture

Assigned: joyceg » naveenvalecha
Status: Active » Needs review
StatusFileSize
new3.96 KB
new11.43 KB
new49.64 KB

Adding the required patch.

joyceg’s picture

Assigned: naveenvalecha » Unassigned
heykarthikwithu’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new49.64 KB
new11.43 KB

Checked the patch, works fine adds Collapsible feature for the fields as in the images and this can be pushed.

alan d.’s picture

Note, personally I would just use "#open' => FALSE," as having these open will push the submit button down the page. but I don't care enough to flag this as needs work ;)

joyceg’s picture

@Alan,

search_config: False
'#open' => \Drupal::config('search_config.node')->get('search_config'),

#open is actually assigned the value false in the patch #2.

alan d.’s picture

hehe, this was based on my decision on D7. Personally I now consider that scrolling down is worse than clicking once to open the fieldset :)

Looking at the code from D7 > D8, starting with the logic I used that was wrong, if configured, open fieldset by default

   '#collapsed' => (bool) variable_get('search_config', FALSE),

It should have been

    '#collapsed' => !((bool) variable_get('search_config', FALSE)),

Or more correctly, using array() which is the data type normally returned, and the cast isn't required:

    '#collapsed' => !variable_get('search_config', array()),

i.e. variable_get('search_config') was one of the variable records that contained multiple values, and now these are in config/schema/search_config.settings.schema.yml, so variable_get('search_config', FALSE), now \Drupal::config('search_config.node')->get('search_config'), was never a single value setting Boolean value, and was probably incorrectly created via the automated upgrade.

So suggesting that you could remove config/install/search_config.node.yml & config/schema/search_config.node.schema.yml completely and to simply set #open => FALSE.

naveenvalecha’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x-1.x

  • naveenvalecha committed 8679bb7 on 8.x-1.x authored by joyceg
    Issue #2783667 by joyceg, heykarthikwithu, Alan D., naveenvalecha:...

Status: Fixed » Closed (fixed)

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