Can't remove ID from multiple blocks
Create two blocks (Structure > Block Layout). Configure and assign ID my_new_block_id to one block. Try to assign ID my_new_block_id to another block. This results in an error message.
I have doubts that a duplicate ID should be an error in any case. Yes, duplicate IDs on a single web page are not ideal and usually unintended. But the block visibility settings do not necessarily allow two blocks with the same HTML ID to be shown on the same page. For example, a site may have one version of a block shown on the home page, and a slightly different version shown on every other page. Those blocks should be allowed to have the same ID, if it makes sense to the developer. I would prefer to be allowed to set duplicate IDs, with a warning.
Thanks for a very useful module that I use on every site!
Comments
Comment #2
solideogloria commentedComment #3
paulocsFor now I have created an issue to work on the 'none' case as I think it's a bug.
We can keep this issue open to talk about not verifying normal block id replacements.
I updated the issue summary as well.
Link of the new issue: https://www.drupal.org/project/block_class/issues/3356441
Comment #4
dydave commentedSince this is starting to be quite old, without any reply or related requests from other users, for several years, we could maybe consider this was addressed in a different issue (?!).
See more recently: #3356441: This ID: <none> is already in use by another block
I found the idea suggested in the issue summary interesting though:
Do not enforce unique ID validation and leave it to the admin/user's informed decision (with warning, message, etc...).
So if this request is still current, a new ticket should be created, for more recent versions of the module and Drupal core.
Marking issue as Closed (outdated), for now.
Thanks again everyone for all the great work on this issue.