- π¦πΊAustralia collab
I encountered this same problem after a 7->10 migration where title fields on some content types had lost their "required" property. I backed up the database in PHPadmin, searched the "config" table for "node.type.", found entries that were overriding titles of the affected content types and deleted them. After clearing the caches, the "required" property was back in place. Thankfully, nothing else appears to have been significantly affected by this action!
- π¨π¦Canada leducdubleuet Chicoutimi QC
In a project, the title field was required in Drupal 7 for my content types. Once migrated to Drupal 9 and now 10, the title field is not required anymore causing the same integrity constraint violation stated here.
I looked in the config table and there is no entry overriding titles so I am left with content types without required titles causing the error when saving with an empty title.
How can I have the titles back as required like it was in D7?
- π¨π¦Canada leducdubleuet Chicoutimi QC
OK, I found a way to put back my titles as required quite easily.
I exported my configurations using "drush config:export" and then I edited the corresponding title yml files to put them back as required.
For example, for the page content type, we edit the file "core.base_field_override.node.page.title.yml" and modify the line "required: false" to "required: true".
And then I imported back my configurations using "drush config:import --partial --diff".
TaDa! The titles are now required as needed!
- Status changed to Closed: duplicate
9 months ago 6:48pm 12 March 2024 - πΊπΈUnited States papagrande US West Coast
The tip in #15 is helpful (as is https://www.drupal.org/project/drupal/issues/2358537#comment-12648753 β¨ Do not require a 'title' field Needs work ), but this issue does duplicate several other currently open issues.