CommentFileSizeAuthor
#4 d8_required.patch9.4 KBfago
#3 d8_required.patch10.53 KBfago
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fago’s picture

Title: Mark all required fields as required » Not all required fields are marked as required
Category: Task » Bug report
Priority: Normal » Major

Actually, this is a bug. Thus re-phrasing.

Berdir’s picture

Assigned: Unassigned » fago

Still an issue? Is this a duplicate of others that we fixed?

fago’s picture

Status: Active » Needs review
FileSize
10.53 KB

I 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.

fago’s picture

FileSize
9.4 KB

sry for the unrelated hunks, re-rolled patch.

The last submitted patch, 3: d8_required.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: d8_required.patch, failed testing.

plach’s picture

Issue tags: +entity storage
mgifford’s picture

Assigned: fago » Unassigned

Just unassigning issues that haven't been developed for a bit in the D8 queue.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Berdir’s picture

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

xjm’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#2346019: Handle initial values when creating a new field storage definition

The 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,