As a result of an upgrades and theme changes, not all of a site's blocks can be assumed to have database rows. Because the block module only runs UPDATE to save block settings, blocks without existing rows don't get saved.

The easiest solution is to add @db_query('INSERT INTO {blocks} (module, delta, theme) VALUES ("%s", "%s", "%s")', $block['module'], $block['delta'], $block['theme']); directly before the UPDATE query in block_admin_display_form_submit.

Comments

Coornail’s picture

I would prefer to use ON DUPLICATE KEY UPDATE (MySQL manual).

That's a mysql specific thing =(

dpearcefl’s picture

Status: Active » Postponed (maintainer needs more info)

Is this still an issue in modern Drupal?

dpearcefl’s picture

Status: Postponed (maintainer needs more info) » Active

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.