Active
Project:
Profile 2
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Apr 2012 at 05:30 UTC
Updated:
28 Jul 2014 at 00:29 UTC
Jump to comment: Most recent
By chance found this setting when working with custom fields.
This setting gets added to all fields, regardless of bundle.
Comments
Comment #1
alexweber commentedThis appears to be done intentionally in profile2.module, lines 800-806.
Comment #2
alexweber commentedFor the record, the same happens with "user_register_form".
Is there a good reason why this approach was taken?
Comment #3
chrisschaub commentedAnd they don't get deleted when profile2 is uninstalled. And that causes some nasty bugs related to missing entity class controller errors. Can you recommend a safe way to remove this from my blob data?
Comment #4
joachim commented> Is there a good reason why this approach was taken?
I can't think of a good reason why we'd need to save this value on fields that aren't even on profile entities. AFAIK profile2 doesn't do anything with those fields at all.
Comment #5
alexweber commented@joachim I figured... patch time then :)
Comment #6
joachim commentedOh wait I get it.
The setting is on the field.
If the field has one instance on a profile, and one instance on a node type, and you edit and save the node instance, this ensures the value is saved.
I'm not sure how best to handle this. We could check the field to see if it has any instances on profiles, and if so, set a form value. But that still leaves the problem of data being left in the blob when the module is removed.
I think this is this is the best short term fix; longer term the profile2_private property should maybe live on the instance rather than the field?
Comment #7
joachim commented> We could check the field to see if it has any instances on profiles, and if so, set a form value
Even simpler, check if the field has a profile2_private property, and if so, set the form value to preserve it.
But that won't help everyone whose field data is already contaminated...
Comment #8
alexweber commented> But that won't help everyone whose field data is already contaminated...
Nope, but at least we can stop further contamination... :)
Comment #9
Taxoman commentedPlus add a comment in the code as per #6?
Comment #10
Bagz commentedFor those looking for a way to clean up the field configuration left behind after a profile2 uninstall: