I tried to follow your example: https://www.drupal.org/node/2491465 and adapt it for my table. I exactly took your code and only changed the table and field names.
The result is that I don't see any editable fields except one "Entity metadata property (editable)". When I use this one and change the value I get an error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY': INSERT INTO {noten} (noten_id, lernende_fk, module_fk, note) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array
(
[:db_insert_placeholder_0] => 1
[:db_insert_placeholder_1] => 1
[:db_insert_placeholder_2] => 1
[:db_insert_placeholder_3] => 20
)
in drupal_write_record() (Zeile 7334 von /home/wmopch/www/notentool/includes/common.inc).
This is because it tries to insert instead of update the changed record.
I attach the complete custom module. It's called "noten".
Could you please point me in the right direction?
Comment | File | Size | Author |
---|---|---|---|
noten.zip | 4.62 KB | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedrolfh created an issue.