I have this code in my install profile:

  install_add_block('crmngp', '0', 'ngp', 1, -50, 'right', 1, NULL, NULL, NULL, $title = 'Take Action');
  install_add_block('menu', 'action', 'ngp', 1, -49, 'right', 1, NULL, NULL, NULL, $title = '<none>');

The block are enabled as expected, but both wind up with weights of -17 instead of the weight I specified (resulting in them appearing in reverse order on the site). It is fairly important to me that they be in the correct order as the two generally go together as a set in our designs with the top blocks title basically being the title for both combined.

Comments

seanr’s picture

Ugh, just noticed that $title crap is a bit naff (that's what I get for copying from the function def), but that still worked just fine - only the weight fails to apply.

James Andres’s picture

Status: Active » Fixed

Try using install_set_block() instead of install_add_block(). Also ensure you call the _block_rehash() function at some point in your install profile before you begin shuffling blocks around.

Status: Fixed » Closed (fixed)

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