We have a very large website and it seems that when we upgraded to drupal 7.12 strange thing happened when we go to admin/structure/block the weight is displayed as an input field with number in it but if we save the page all the weights are saved as NULL. We took the website and set it up on a development server and after looking over every installed module by disabling and them uninstalling it seemed to make no difference at all. But when we cut down the blocks by deleting them the normal dropdown appeard again.

We have like over 700 blocks just counting on one theme key.

Comments

vefverksmidja’s picture

Component: other » block.module
marcingy’s picture

Category: bug » support
vefverksmidja’s picture

I have figured out what was the problem.

The problem was the new code introduced in form.inc in drupal 7.12 that switches between select or textfield for the weights. This has turned out to be problem since when you save for instance some context that is using weights it does not retrieve the numbers from input field thus serializing the array with all weights as NULL.

I found out that you could set the variable 'drupal_weight_select_max' to some higher number then 100 sinze the contstant is 100. It solves the problem for now. I think this should be fixed either by context or drupal core.

So if someone encounters this problem you can set the variable in database either by using variable_set or with insert in mysql to some hight number I set mine to 1000.

pbfleetwood’s picture

@vefverksmidja, you wrote in #3:

So if someone encounters this problem you can set the variable in database either by using variable_set or with insert in mysql to some hight number I set mine to 1000.

What table must be updated? Perhaps you could fill in the blanks? Update sometable set somecol = 1000 where someothercolumn = somevalue

Thanks for finding the problem.

vefverksmidja’s picture

Hi,

it's a variable, they are in the "variable" table. Just change the value for drupal_weight_select_max.

regards, Vefverksmidjan

rudiedirkx’s picture

drush vset drupal_weight_select_max 1000
David_Rothstein’s picture

Status: Active » Postponed (maintainer needs more info)

For reference, the change in Drupal core (described above) that may have led to this is #1346760: Add a scalable weight select element... I just cross-linked this problem at that issue, and there's also already a bug report against the Context module about this: #1439134: Error when saving context - unable to define weight

Presumably, it needs to be fixed in Context at this point. Given that, is there a reason to keep this issue open?

vefverksmidja’s picture

Hi,

Yeah, just close it, the other report covers it.

regards, Vefverksmiðjan

David_Rothstein’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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