Block names are currently based on field labels, which are instance specific information. The implementation of the content module returns only one instance per field when calling module_invoke('content', 'fields') which is the last instance, that is loaded.

Therefor, we get in trouble when one field is used in different content types with different labels.

The problem can be solved by naming the block with the machine readable name of the field. That could be improved by adding all instance specific names of the field. It's yet unavoidable to display the actual name of the field, as this is the only name that identifies the field unambiguously.

Comments

andypost’s picture

Do you think that blocks should be per-instance as it works now?

Suppose better naming is CCK blocks: {node-type} : {field-name}

Anonymous’s picture

No, I'm still convinced that it is enough to provide one block for each field. I don't see any use for one block per field instance. In my opinion, there is something missing like a 'human readable name' for the field.

At the moment, we are using the label of one of the fields instances. I don't know what happens, if there are more than one instances or if an instance is added after the block has been created. I'm not sure, if we always get the same label when calling $field_info['widget']['label'], as only the last instance of the field is contained in the array when calling module_invoke(...) (whatever last means in this case).

My suggestion is to use only the unique name of the field. It's not that comfortable to read for the (admin) user, but it's the only thing that accurately identifies a field .