When I'm trying to save the weight settings of a content type I'm getting the error above.

I saw a post mentioning some of this, that it was fixed using the dev version, I've already tried with no luck. This is a multilingual site by the way.

Notice: Undefined index: values in weight_node_type_form_submit() (line 255 of E:\projects\seguridadsocial\sites\all\modules\weight\weight.module).

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'type' cannot be null: INSERT INTO {weight_settings} (type, weight_enabled, weight_range, menu_weight, weight_default) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => ) in weight_node_type_form_submit() (line 280 of E:\projects\seguridadsocial\sites\all\modules\weight\weight.module).

Comments

davisben’s picture

Hi renatodv,
I am unable to reproduce this on a clean install. Do you have any other contrib modules enabled that modify the node type form? The error you are getting shows that no form values are being passed to the submit function, which may be caused by another module modifying them first.

davisben’s picture

Status: Active » Closed (cannot reproduce)
dddbbb’s picture

Version: 7.x-2.1 » 7.x-2.x-dev
Issue summary: View changes
Status: Closed (cannot reproduce) » Active

I'm getting a very similar error with latest dev when trying to save assigned weights via a view:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'entity_id' cannot be null: INSERT INTO {weight_weights} (entity_id, entity_type, weight) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => node [:db_insert_placeholder_2] => 0 ) in _weight_set_weight() (line 605 of /var/www/site/docroot/sites/all/modules/weight/weight.module).

  • davisben committed 23a0570 on 7.x-2.x
    Issue #1701004 by davisben: Prevent PDOException.
    
davisben’s picture

Status: Active » Fixed

I was unable to reproduce this, but added additional checks to the _weight_set_weight function so the query will only be run if the needed fields are not null.

Status: Fixed » Closed (fixed)

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