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.
The creation of a new node fails (with 500 Service unavailable) if there is a field that accepts more than one item, e.g.
<field_some_field>
<item>First Value</item>
<item>Second Value</item>
</field_some_field>
The XML structure is the same as retrieved from an example entry of the same ContentType (without the fields that are not writeable).
The following message is the exception that is thrown.
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'item' for column 'delta' at row 1: INSERT INTO {field_data_field_is_super_event_of} (entity_type, entity_id, revision_id, bundle, delta, language, field_is_super_event_of_url, field_is_super_event_of_title, field_is_super_event_of_attributes) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 935 [:db_insert_placeholder_2] => 1306 [:db_insert_placeholder_3] => conferenceevent [:db_insert_placeholder_4] => item [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => h [:db_insert_placeholder_7] => h [:db_insert_placeholder_8] => h ) in field_sql_storage_field_storage_write() (line 448 of /home/www/html/website/modules/field/modules/field_sql_storage/field_sql_storage.module).
The website encountered an unexpected error. Please try again later.
Comment | File | Size | Author |
---|---|---|---|
#6 | 1717228-xml-create.patch | 2.62 KB | sepgil |
#5 | 1717228-restws-xml-create.patch | 1.72 KB | klausi |
#4 | 1717228-list-field-create2.patch | 2.48 KB | sepgil |
#2 | 1717228-list-field-create.patch | 867 bytes | sepgil |
Comments
Comment #1
klausiAssigning to Sebastian for GSoC.
Comment #2
sepgil CreditAttribution: sepgil commentedI also get an exception, but not the same as you.
Here is however the patch for my issue.
Btw: The correct syntax is:
Comment #3
klausiThis should come with a test case.
Comment #4
sepgil CreditAttribution: sepgil commentedI added the test to the testResourceArray() function.
Comment #5
klausiLooks like the whole XML creation is broken. I extended the XML create test with the author and now the tests fail or throw fatal errors, with and without your fix.
I suspect a bug in xmlToArray() where $values['id'] is set to the empty string, and then there is an isset() call in getResourceReferenceValue(). 'id' should never be set in the first place if the XML attribute does not exist.
Patch contains the test case only.
Comment #6
sepgil CreditAttribution: sepgil commentedThe problem with my patch above was that it didn't check for entities that are not in a list, this patch does it and xml creation works therefore properly.
Comment #7
klausiCommitted, thanks!
Comment #8.0
(not verified) CreditAttribution: commented*.*.*.* - restws_user [07/Aug/2012:14:42:51 +0200] "POST / HTTP/1.1" 500 7990 "-" "Ruby"