After saving the site settings, I get this error
</br></br><em class="placeholder">Drupal\Core\Entity\EntityStorageException</em>: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'fieldset' cannot be null: INSERT INTO {site_setting_entity_field_data} (id, type, langcode, user_id, name, fieldset, status, created, changed, default_langcode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 4 [:db_insert_placeholder_1] => prices [:db_insert_placeholder_2] => ru [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => Prices [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => 1 [:db_insert_placeholder_7] => 1534072424 [:db_insert_placeholder_8] => 1534072424 [:db_insert_placeholder_9] => 1 ) in <em class="placeholder">Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()</em> (line <em class="placeholder">829</em> of <em class="placeholder">core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php</em>).
I tested it on a clean drupal installation and got the same error.



| Comment | File | Size | Author |
|---|---|---|---|
| #6 | site_settings-column-fieldset-cannot-be-null-2992171-6.patch | 1 KB | scott_euser |
| 3.png | 72.74 KB | xdevelx | |
| 2.png | 16.06 KB | xdevelx | |
| 1.png | 28.45 KB | xdevelx |
Comments
Comment #2
xdevelx commented...
Comment #3
xdevelx commentedComment #4
xdevelx commentedComment #5
mr.york commentedMissing fieldset.
Comment #6
scott_euser commentedAttached patch should prevent this from happening. Happens when on first site setting creation you don't set a fieldset name.
Comment #7
aludescher commentedWhen adding the first Site Setting type under /admin/structure/site_setting_entity_type/add there is no existing fieldset label and a Create a new "Fieldset Legend" label text field is used but field is not required, i.e. it can be left empty. But in the db schema fieldset cannot be null, thus the error from the OP.
When adding the next Site Setting type there's a Choose existing "Fieldset Legend" label select field which is required. With the -- create a new fieldset -- option it can be saved without entering a fieldset name. Thus you can have any number of site setting types without ever defining a fieldset.
The patch in #6 fixes this using a form validator check. It forces the user to add a fieldset label in the above cases, there's a Please enter a fieldset name. error message after a form submit as long as the fieldset label is empty. I confirm that it works for me.
It might not be the best for UX because the field required message only comes after submitting the form, Making the fieldset label field required when visible might solve this, see https://api.drupal.org/comment/62866#comment-62866
Comment #10
scott_euser commentedThanks for the tip! Added.
Comment #11
scott_euser commented