Hello Patternkit Team,

Problem/Motivation

I notice a fatal error when creating pattern kit block on drupal 8.9.1. Here is the error : Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'pattern_id' cannot be null: INSERT INTO {patternkit_field_data}

Steps to reproduce

  • Have a Drupal 8.9.x with patternkit installed
  • Create a Patternkit block (/patternkit_block/add)
  • Choose a pattern
  • Enter a Block description and save
  • On the next form save
  • You will see the error

Proposed resolution

Look like the pattern_id is not set on the block in the blockSubmit function (file patternkit/src/Plugin/Block/PatternkitBlock.php). See patch coming to see solution.

CommentFileSizeAuthor
Screen Shot 2021-04-27 at 12.31.59 PM.png111.44 KBchurel

Issue fork patternkit-3211024

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

churel created an issue. See original summary.

cyb_tachyon’s picture

Thanks for the patch! I'll review and get this merged ASAP.

  • cyb.tachyon committed fa9ad30 on 8.x-1.x authored by churel
    Issue #3211024: [8.x-1.x-dev] Fatal Error on patternkit block save
    
cyb_tachyon’s picture

Status: Active » Fixed

  • cyb.tachyon committed c5cd62c on 9.1.x authored by churel
    Issue #3211024: [9.1.x] Fatal Error on patternkit block save
    

  • cyb.tachyon committed ab62c65 on 8.x-1.x authored by churel
    Issue #3211024: [9.1.x] Fatal Error on patternkit block save
    

Status: Fixed » Closed (fixed)

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