The Field Collections module defines a bundle called "field_name". This conflicts with the fields entered via the Field UI administration interface and can lead to strange bugs.
I have hit this issue once myself and it is likely to be affecting others in the wider community. So this is just a heads up on that issue, as mine and your modules are likely to be in the firing line for any potential issues, as the first choice of a name field in a user bundle is well, "Name" / "field_name".
It has been reported, #1422870: field_name is not right for any modules to use by default, but is likely to be a hard refactor of that module to reuse another bundle key.
Comments
Comment #1
hass CreditAttribution: hass commentedYou need to expect that the username changes. This is why we have format_username() function.
Comment #2
hass CreditAttribution: hass commentedI'm not sure how this is related to realname...
Comment #3
Alan D. CreditAttribution: Alan D. commented@hass
This was just a heads up for the maintainers at the time I discovered this in the Name modules issue queue.
I had issues with people installing Field Collection module after adding a field with the name "field_name" and they hit the Name modules queue with issues related to this.
If I wasn't clear above, the FC module uses field_name as a entity property key, and internal checks within the Field system go crazy when this bundle key clashes with an existing field key. Multiple notices, data loss, etc.
i.e.
Absolutely no way related to output from the function / token ;)
Comment #4
hass CreditAttribution: hass commentedYeah, but how does this clash with realname?
Comment #5
Alan D. CreditAttribution: Alan D. commentedNothing... Pure UX thing as this is a common use-case.
User:
Um. This RealName module looks really cool, I want to use it by putting a name field on something...
Adds a field called Name, defaults to field_name.
Um, Field collection looks darn useful too.
Enables it.
Bang multiple issues.
i.e. Name module & RealName module both suggest that users are going to add a field onto something, the field label that comes to mind is "Name (field_name)". This then triggers errors if they latter add Field Collection module.
So, I added this to the Name field modules page to give users the heads up.
Field Collections
If you are planning to use the Field Collections module, never create a field with the machine name "field_name".
Any field with this machine name will conflict with that module, irrespective of the field type.
Comment #6
Alan D. CreditAttribution: Alan D. commentedAnd to resolve this... Delete the field Name and create a new one that doesn't use the field name "field_name".
Kinda a real bummer for newbies that would not be able to handle a data migration between fields and loss data / pain in the butt for experienced developers that have to waste 30 min doing a migration...
Comment #7
Dave ReidThis should be a big red warning on the field collection module since it's responsible for this issue then, and not realname.
Comment #8
Alan D. CreditAttribution: Alan D. commentedIt is not possible to install FC then create a field called field_name. Internally checks withing the Field system prevent this.
Anyways, u both have made it clear that you do not consider it to be an issue for this module. Would close but hass already has ;)
Comment #9
hass CreditAttribution: hass commentedI'm fine with adding this as a compatibility note to the readme if sooo important, but I think fc should fix this... Why are you not fixing it in fc? Personally I never recommend creating a name field. Always create firstname and lastname fields. Otherwise you will run against walls very very soon.
Aside I'm using addressfield at the very best :-)
Comment #11
Alan D. CreditAttribution: Alan D. commentedDon't know enough about it to try...
Name module provides a 6 component name element; title, first, middle, last, generational and credentials with PHP date like formatters. You just select the display type for title surname; just first name; first name with fallback to surname; or whatever u require :)