1

I have some publishing pages that are using custom content types. Within the content types is a site column of type choice. I’ve update the choice values of this column and all have made sure that all references are using the new values, and that the old values no longer appear in the solution. After deploying the solution I have verified that all lists and libraries are using the new choice column values. However publishing pages using this site column are still using the old choice column values. Publishing pages are being deleted/recreated when deployed. Has anyone seen this, and is there a quick fix? Thanks.

  • If the publishing pages are being created when deployed, have you checked the elements file of the module that deploys the pages that the properties are updated appropriately? – Eric Alexander Aug 18 '14 at 17:56
  • Have you deleted the site columns and content types before redeploying? – Tom Resing Aug 18 '14 at 18:49
  • So it looks like a copy of the content types are stored in the pages library, along with the choice column values. So in script I would need to get a reference to the Pages library’s content types and then remove the previous column and re-add a reference to the updated column. But I've tried removing the column from the fieldlinks collection and then re-adding it, which does not seem to work. – Paul J Aug 18 '14 at 21:45
0

This was fairly straightforward once I found where to look. Within the Pages library the choice column was copied when the content types were associated with the library. This copy of the choice column contained the old values. The fix was to remove the column from the library and re-add it.

SPList list = web.Lists["Pages"];
SPField productGroupField = web.Fields["Product Group"];

list.Fields.Delete("ProductGroup");
list.Update();
list.Fields.Add(productGroupField);
list.Update();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.