Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I'm trying to add a Serial Field to the Customer Profile in Commerce. When I do this and try to add a new customer, I get this error upon submit:
Error
The website encountered an unexpected error. Please try again later.
I tried adding it to another content type and got the same error when trying to add new content. No new nodes are created.
Thank you.
Comments
Comment #1
justmelat CreditAttribution: justmelat commentedSame issue, using drupal 7.12 and an old commerce-download module.
Steps
downloaded and enabled serial module, added new field to my content type: main_sku, added content, save, received error below.
Notice: Undefined property: stdClass::$nid in serial_field_insert() (line 83 of /home/lfwebz/public_html/gsh/sites/all/modules/serial/serial.module).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'nid' cannot be null: INSERT INTO {serial_digital_product_field_main_sku} (nid) VALUES (:db_insert_placeholder_0); Array ( [:db_insert_placeholder_0] => ) in _serial_generate_value() (line 155 of /home/lfwebz/public_html/gsh/sites/all/modules/serial/serial.inc).
Comment #2
indigoxela CreditAttribution: indigoxela commentedVery alike here: "PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'nid' in 'field list': INSERT INTO... serial.inc "
The problem seems to be in serial.inc in line 153:
I changed
'nid' => $nid,
to
'sid' => $nid,
and it worked again.
The module worked fine before. The table column's name is sid and not nid.
EDIT: but the field has the wrong value - it is no real serial field anymore but only has the node id
EDIT2: I mentioned that it was working fine before. There were some updates which might be influencing:
The field is used to create the title of nodes with an id (tickets).
Comment #3
indigoxela CreditAttribution: indigoxela commentedAfter updating to dev version serial field works fine again.
Whatever the problem is doesn't seem to happen with serial-7.x-1.x-dev
Comment #4
MustangGB CreditAttribution: MustangGB commented