backdrop-contrib / collapsiblock

GNU General Public License v2.0
0 stars 2 forks source link

Error: Notice: Undefined index: collapsiblock_action in collapsiblock_form_submit() (line 185 of /app/modules/collapsiblock-1.x-1.x/collapsiblock.module). #1

Closed stpaultim closed 2 years ago

stpaultim commented 2 years ago

This module isn't working for me yet. I'm not able to set preferences for individual blocks. Not sure if this error message is related.

Notice: Undefined index: collapsiblock_action in collapsiblock_form_submit() 
(line 185 of /app/modules/collapsiblock-1.x-1.x/collapsiblock.module).

image

keiserjb commented 2 years ago

Yes, the submit function still has remnants of the Drupal version. It needs to look like this for now. I'll fix it. Not sure if that needs to be there in some way to make the global default setting work.

function collapsiblock_form_submit($form, &$form_state) {
  $values = $form_state['values'];
  if ($form_state['values']['form_id'] == 'layout_block_configure_form') {
    // Only save if value has changed.
    if (isset($form_state['values']['collapsiblock']['collapsiblock_action'])) {

       /*&& $form['collapsiblock']['collapsiblock_action']['#default_value']
      != $form_state['values']['collapsiblock_action'])*/
keiserjb commented 2 years ago

That should do it. Module file updated.

stpaultim commented 2 years ago

Confirmed that this is fixed.