We have this situation where we had to change the delta of a block on an already deployed application. The update was done on several places on the database.
We noticed that on these blocks, when trying to save the block settings, block_cachealter crashes:
SQLSTATE[23000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Violation of PRIMARY KEY constraint 'blockcache_alter_pkey'. Cannot insert duplicate key in object 'dbo.blockcache_alter'. The duplicate key value is (684).
This is because in blockcache_alter_save_settings() the module is fetching the blockcache_alter block information using the block's module and delta, but later it uses the block id to match registries in the block and blockcache_alter tables.
There are two possiblities here:
- Consistently uses module + delta to identify a block
- Consistently use the block id
Comments
Comment #1
david_garcia commentedComment #2
vensiresThe patch saved the day.
Comment #4
fabianx commentedThank you, committed and pushed to 7.x-1.x!