Module does not save new class data to field instance data store

Created on 29 April 2014, about 10 years ago
Updated 10 September 2023, 10 months ago

Running field_formatter_class 7.x-1.1+0-dev
Running field_formatter_settings 7.x-1.1+0-dev
Running Drupal & Field API 7.27

Attempts to save formatter class data to field config instance data simply fails. (Note that, upon module install, a zero-byte empty character string is stored in the database for key "field_formatter_class" for each field instance.)

Reading class data from the database is not a problem - when I fidget with the serialized data in the field_config_instance table (column "data") and change the

s:21:"field_formatter_class";s:0:"";
to
s:21:"field_formatter_class";s:9:"something";

the field_formatter_class code DOES properly pull the data from the DB and presents it in "admin/structure/types/manage/NODE-TYPE/display". It also properly renders the class as we expect field_formatter_class to do out of the box.

The ajax behind setting the value appears to work correctly, but the database does not reflect the just-updated value. A refresh of the page confirms that the database never received the updated "field_formatter_class" data from the ajax transaction.

Introspection on the POST array shows that data is being passed from the browser to the Drupal back-end like this. The data *is* being sent back!

fields%5Bfield_example%5D%5Bsettings_edit_form%5D%5Bsettings%5D%5Bfield_formatter_class%5D=CUSTOM-CLASS-GOES-HERE

I've tried, but am not yet knowledgeable enough, to understand how this formatter data is saved to the DB. I see no calls to field_update_instance() or the like. There's no field_formatter_settings_SET_instance_display_settings() like there is field_formatter_settings_GET_instance_display_settings() (emphasis mine), so the question remains: HOW is "field_formatter_class" data getting forgotten en route from the ajax transaction to the database? And how do we fix it?

πŸ’¬ Support request
Status

Closed: cannot reproduce

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bshensky

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024