Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298558

Remove unique constraint on block content info field

$
0
0

Problem/Motivation

The first version of validation was introduced in #1998658: Creating Custom Block with same name as existing block throws SQL error, you can check commit (https://git.drupalcode.org/project/drupal/-/commit/edcc75602fe1fc3b1d15049bdaec0198ce5aa43a)
At that moment the custom_block module has a custom table with "unique keys", but now it is not a case any more

(core/modules/block/custom_block/custom_block.install)

'unique keys' => array(
      'revision_id' => array('revision_id'),
      'uuid' => array('uuid'),
      'info' => array('info'),
    ),

Currently custom block entity has constraint UniqueField for info field. I don't see any reason to have it unique.
We can have different content block types and of course they can have not unique info fields.

A little history

This was probably from before we had UUIDs
Back in Drupal 7 these were likely using in hook block info
But now we use the uuid, so this constraint isn't needed.

Steps to reproduce

Add a few block with the same info field value.

Proposed resolution

Get rid off UniqueField constraint.


Viewing all articles
Browse latest Browse all 298558


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>