Search code examples
drupaldrupal-7drupal-modulesdrupal-viewsdrupal-theming

drupal blocks not ordering according to weight


We have additional content being displayed in blocks and blocks generated by views, for some reason drupal now is completely disregarding any weight / order we give to the base "main page content" block

For example we always wan the main page content block to sit at the top of the main content region, so we have moved it up to the top/ assigned the lowest weight, yet it completely disregards this and always renders the block after all the other blocks.

We ruled out any css issues such as floats/ position absolutes by disabling our template (built on adaptive theme) We have an older version of the site on localhost which display blocks fine and in the correct order, the html shows the main page content physically being rendered first but on he dev version its physically rendered last.

I've also gone through and disabled all the modules i could, except the few modules you are unable to disable as they contain data, but this shouldn't be an issue as the site has been an ongoing build for a while now and has been functioning fine.

I've done the basics such as clearing caches ect but to no avail. I'ts just strange how we are experiencing this issues in relation to the main page content block and other custom blocks. Custom content blocks in relation to other custom content blocks completely respect the weight given to them.

A few extra details from our drupal install

Web server Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 PHP/5.2.17 OK cURL Enabled OK PHP memory limit 128M OK Database system version 5.0.95-community OK PHP 5.2.17

Any clues appreciated


Solution

  • force weights can be done by writing a custom module function

    MYMODULE_block_info_alter(&$blocks, $theme, $code_blocks) { 
      $blocks['system']['main']['weight'] = -9999; 
    }