Closed (duplicate)
Project:
Drupal core
Version:
8.3.x-dev
Component:
entity system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 May 2014 at 21:12 UTC
Updated:
17 Mar 2017 at 23:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
fagoActually, this is a bug. Thus re-phrasing.
Comment #2
berdirStill an issue? Is this a duplicate of others that we fixed?
Comment #3
fagoI don't think this is an duplicate, as #2232477: Fatal when adding new fields with NOT NULL constraints in a base table that contains existing entities only deals with 'required' for property definitions. But there is no required flag for lots of base fields which have a default value and are actually required, as the API and schema relies on a non NULL value to be there.
We can find base fields by that by looking at the schema - everything that is not null should be required imo. Then, there are more fields which have default values and code that relies on them being not null: langcode, created, changed and more fields with explicitly defined default values. I shortly look over Comment, Node, Term, User entities and figured it should be something like the following patch.
Also, we should be able to auto-generate not-null schema information once we've the required property information fixed by #2232477: Fatal when adding new fields with NOT NULL constraints in a base table that contains existing entities.
Comment #4
fagosry for the unrelated hunks, re-rolled patch.
Comment #7
plachComment #8
mgiffordJust unassigning issues that haven't been developed for a bit in the D8 queue.
Comment #11
berdirRelated #2390495: Support marking field storage definitions as required?
Comment #13
xjmThe entity and field maintainers discussed this issue with the core committers awhile back, and identified that this issue can be considered a duplicate of #2346019: Handle initial values when creating a new field storage definition,