Custom block variables can not be deleted for a block if there are no other blocks with custom block variables.

To reproduce:

  1. Install blocktheme
  2. Configure a block, add custom block variable, e.g. var1|value1
  3. Save the block
  4. Configure the same block, remove the custom block variable
  5. Save the block
  6. Configure the same block, see that the custom block variable is not removed

The problem is in the function blocktheme_set(). The custom block variables are only updated in the variable table when if ($blocktheme_vars) return TRUE. When all variables are unset, $blocktheme_vars is an empty array and the above statement return FALSE.

The attached patch against latest 7.x-1.x-dev fixes this.

Comments

pianodavid’s picture

StatusFileSize
new466 bytes

Ok, here is the patch.

amateescu’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

  • Commit 8385752 on 7.x-1.x, 8.x-1.x authored by pianodavid, committed by amateescu:
    Issue #1671042 by pianodavid: Fixed Last custom block variable can not...