Problem/Motivation

Nodes created without title results in an error.

Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'title' cannot be null:

Proposed resolution

Added a title when a node is created.

Comments

giancarlosotelo created an issue. See original summary.

giancarlosotelo’s picture

Status: Active » Needs review
StatusFileSize
new1.5 KB

Here is the fix.

juanse254’s picture

Status: Needs review » Needs work
+++ b/src/Tests/TokenNodeTest.php
@@ -48,7 +48,7 @@ class TokenNodeTest extends TokenKernelTestBase {
+    $page = Node::create(['type' => 'page', 'title' => $this->randomMachineName(), 'revision_log' => $this->randomMachineName(), 'path' => array('alias' => '/content/source-node')]);

Maybe we can make this a bit more readable, split it a bit.

The rest looks good, waiting for the tests.

giancarlosotelo’s picture

Status: Needs work » Needs review
StatusFileSize
new1.48 KB
new1.58 KB

More readable now.

berdir’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 4: 2556351-4.patch, failed testing.

berdir’s picture

Let's fix that test here as well, use $this->installSchema() to install that table.

dave reid’s picture

Status: Needs work » Needs review
StatusFileSize
new551 bytes

I just committed #4 since it at least fixes one of the exceptions. This should fix the last one.

berdir’s picture

Status: Needs review » Reviewed & tested by the community

Green :)

dave reid’s picture

Status: Reviewed & tested by the community » Fixed

Committed #9 as well.

  • Dave Reid committed b17c78f on 8.x-1.x
    Issue #2556351 by Dave Reid: Fixed remaining test failure.
    

The last submitted patch, 2: 2556351-2.patch, failed testing.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.