In a contrib module I maintain, I define a DS field via hook_ds_fields_info().

Now it happens that I want to rename this field (the machine name). (actually it is not about renaming but splitting the one field into multiple fields, but that's a detail)

The first step is trivial: Rename the machine key in hook_ds_fields_info().

Next step, in hook_update_N(): Every entity view mode that uses the field with the old name, should be updated to use the field with the new name instead.

How would I implement this second step?

It seems that the ds_field_settings and ds_layout_settings db tables are what I need to look at. But is this enough? Which API functions could I use?

Thanks!

(same question on http://drupal.stackexchange.com/questions/102565/how-to-rename-a-field-w...)

Comments

aspilicious’s picture

Status: Active » Fixed

Answered this in IRC, just loop through the tables DS provides and alter where needed

donquixote’s picture

Thanks, aspilicious!

If anyone is interested: Here is how I implemented this stuff:
http://drupalcode.org/project/views_content_ds.git/blob/refs/heads/7.x-2...
(the best is to look at it with an IDE)

Status: Fixed » Closed (fixed)

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