With regions in theming, we actually hit the user-created block limit. Shows two oddities in the boxes table.

1) Field 'bid' in the boxes table is set to 'auto-increment' instead of using Drupal's sequence table
2) Field 'bid' in the boxes table is a TINYINT, with a limit value of 127. This is a hard stop. Reaching this limit throws SQL errors if new blocks are created.

Fatal error: Duplicate entry '127' for key 1 query: INSERT INTO boxes (title, body, info, format) VALUES ('Test 123123', 'asd', 'asd', 1) in /web/wig3.savannahnow.com/htdocs/includes/database.mysql.inc on line 66

This affects 4.6 and 4.7, all versions.

Two possible fixes:

1) Change the 'bid' field to INT from TINYINT
2) Remove the 'auto-increment' from field 'bid' and alter function block_box_save() to use the sequences table. In this case, line 500 alters as follows.

    db_query("INSERT INTO {boxes} (title, body, info, format) VALUES  ('%s', '%s', '%s', %d)", $edit['title'], $edit['body'], $edit['info'], $edit['format']);

 changes to:

    db_query("INSERT INTO {boxes} (bid, title, body, info, format) VALUES  ('%d', '%s', '%s', '%s', %d)", db_next_id('block_id'), $edit['title'], $edit['body'], $edit['info'], $edit['format']);

Comments

agentrickard’s picture

In either case, the TINYINT must be changed to INT.

Dries’s picture

Status: Active » Closed (duplicate)

Will be fixed by patch http://drupal.org/node/71389