Drupal 7.34
PHP 5.5.20

Error

Saving any content type in '/admin/structure/types/manage/' with RDF UI sub module enabled. Seems that rdfui_form_node_type_form_submit() fail to define the bundle type

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'bundle' cannot be null: INSERT INTO {rdf_mapping} (type, bundle, mapping) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => a:9:{s:7:"rdftype";a:4:{i:0;s:19:"schema:CreativeWork";i:1;s:9:"sioc:Item";i:2;s:13:"foaf:Document";i:3;s:13:"madsrdf:Title";}s:5:"title";a:2:{s:10:"predicates";a:1:{i:0;s:11:"schema:name";}s:4:"type";s:8:"property";}s:7:"created";a:3:{s:10:"predicates";a:2:{i:0;s:7:"dc:date";i:1;s:10:"dc:created";}s:8:"datatype";s:12:"xsd:dateTime";s:8:"callback";s:12:"date_iso8601";}s:7:"changed";a:3:{s:10:"predicates";a:1:{i:0;s:11:"dc:modified";}s:8:"datatype";s:12:"xsd:dateTime";s:8:"callback";s:12:"date_iso8601";}s:4:"body";a:1:{s:10:"predicates";a:1:{i:0;s:15:"content:encoded";}}s:3:"uid";a:2:{s:10:"predicates";a:1:{i:0;s:16:"sioc:has_creator";}s:4:"type";s:3:"rel";}s:4:"name";a:1:{s:10:"predicates";a:1:{i:0;s:9:"foaf:name";}}s:13:"comment_count";a:2:{s:10:"predicates";a:1:{i:0;s:16:"sioc:num_replies";}s:8:"datatype";s:11:"xsd:integer";}s:13:"last_activity";a:3:{s:10:"predicates";a:1:{i:0;s:23:"sioc:last_activity_date";}s:8:"datatype";s:12:"xsd:dateTime";s:8:"callback";s:12:"date_iso8601";}} ) in rdf_mapping_save() (line 255 of drupal/modules/rdf/rdf.module).

Reformatted error message

Perhaps easier to read

Array ( 
[:db_insert_placeholder_0] => node 
[:db_insert_placeholder_1] => 
[:db_insert_placeholder_2] => a:9:
{
  s:7:"rdftype";a:4:
  {
    i:0;s:19:"schema:CreativeWork";i:1;s:9:"sioc:Item";i:2;s:13:"foaf:Document";i:3;s:13:"madsrdf:Title";
  }
  s:5:"title";a:2:
  {
    s:10:"predicates";a:1:
    {
      i:0;s:11:"schema:name";
    }
    s:4:"type";s:8:"property";
  }
  s:7:"created";a:3:
  {
    s:10:"predicates";a:2:
    {
      i:0;s:7:"dc:date";i:1;s:10:"dc:created";
    }
    s:8:"datatype";s:12:"xsd:dateTime";s:8:"callback";s:12:"date_iso8601";}s:7:"changed";a:3:
    {
      s:10:"predicates";a:1:{i:0;s:11:"dc:modified";
    }
    s:8:"datatype";s:12:"xsd:dateTime";s:8:"callback";s:12:"date_iso8601";
    }
    s:4:"body";a:1:
    {
      s:10:"predicates";a:1:
      {
        i:0;s:15:"content:encoded";
      }
    }
    s:3:"uid";a:2:
    {
      s:10:"predicates";a:1:
    {
    i:0;s:16:"sioc:has_creator";
  }
  s:4:"type";s:3:"rel";
}

s:4:"name";a:1:
{
  s:10:"predicates";a:1:
  {
    i:0;s:9:"foaf:name";
  }
}

s:13:"comment_count";a:2:
{
  s:10:"predicates";a:1:
{
  i:0;s:16:"sioc:num_replies";
}
  s:8:"datatype";s:11:"xsd:integer";
}

s:13:"last_activity";a:3:
{
  s:10:"predicates";a:1:
  {
    i:0;s:23:"sioc:last_activity_date";
  }
  s:8:"datatype";s:12:"xsd:dateTime";s:8:"callback";s:12:"date_iso8601";
  }
}

Have no idea why it fail to pick up bundle before saving.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

steinmb’s picture

Version: 7.x-2.0-alpha4 » 7.x-2.x-dev

Retested with the latest dev. and still the same problem.

steinmb’s picture

A little more digging around in the form API. $form_state['input']['type'] is NULL. if I as in the example below dump the variable.

function rdfui_form_node_type_form_submit($form, &$form_state) {
  $entity_type = 'node';
  $bundle = $form_state['input']['type'];
  var_dump($form_state['input']);
  _rdfui_mapping_save($form_state, $entity_type, $bundle, 'title');
}
steinmb’s picture

Status: Active » Needs review
FileSize
729 bytes

Tested and seems to be a safer place to pick up the bundle name.

steinmb’s picture

Issue summary: View changes
barig’s picture

Hi all,

I rolled back the patch to apply properly with a project.make ( module path was not relative to module root ).

The patch is generated from 7.x-2.0-alpha4.

Hope it helps!

steinmb’s picture

Status: Needs review » Reviewed & tested by the community

Doh, thank you. Did not notice that when I created the patch. Note: All patches must be generated from the latest dev.

dureaghin’s picture

Tested with latest dev version + patch #5.

I'm getting the same error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'bundle' cannot be null: INSERT INTO {rdf_mapping} (type, bundle, mapping) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => a:9:{s:7:"rdftype";a:2:{i:0;s:9:"sioc:Item";i:1;s:13:"foaf:Document";}s:7:"created";a:3:{s:10:"predicates";a:2:{i:0;s:7:"dc:date";i:1;s:10:"dc:created";}s:8:"datatype";s:12:"xsd:dateTime";s:8:"callback";s:12:"date_iso8601";}s:7:"changed";a:3:{s:10:"predicates";a:1:{i:0;s:11:"dc:modified";}s:8:"datatype";s:12:"xsd:dateTime";s:8:"callback";s:12:"date_iso8601";}s:4:"body";a:1:{s:10:"predicates";a:1:{i:0;s:15:"content:encoded";}}s:3:"uid";a:2:{s:10:"predicates";a:1:{i:0;s:16:"sioc:has_creator";}s:4:"type";s:3:"rel";}s:4:"name";a:1:{s:10:"predicates";a:1:{i:0;s:9:"foaf:name";}}s:13:"comment_count";a:2:{s:10:"predicates";a:1:{i:0;s:16:"sioc:num_replies";}s:8:"datatype";s:11:"xsd:integer";}s:13:"last_activity";a:3:{s:10:"predicates";a:1:{i:0;s:23:"sioc:last_activity_date";}s:8:"datatype";s:12:"xsd:dateTime";s:8:"callback";s:12:"date_iso8601";}s:5:"title";a:1:{s:10:"predicates";a:1:{i:0;s:8:"dc:title";}}} ) in rdf_mapping_save() (line 255 of /modules/rdf/rdf.module).

Chris Charlton’s picture

Ugh. Just got stung by this. :(

steinmb’s picture

@chris - Did the patch address the issue?