Before #470242: Namespacing for bundle names got fixed, we had to add a prefix to comment bundles names to differentiate between bundle 'article' on nodes and bundle 'article' on comments. This can now go away.
No UI for fields on comments yet, so this has to be tested either through #538164: Comment body as field or by running the following code in a devel PHP block.
$field = array(
'field_name' => 'field_test_comment',
'cardinality' => FIELD_CARDINALITY_UNLIMITED,
'type' => 'text',
);
$instance = array(
'field_name' => 'field_test_comment',
'object_type' => 'comment',
'bundle' => 'article',
'label' => 'Multiple',
);
field_create_field($field);
field_create_instance($instance);
| Comment | File | Size | Author |
|---|---|---|---|
| comment_bundles.patch | 4.03 KB | yched |
Comments
Comment #1
catchMy only concern about this one, is that one day, we might want to make comment module work for entities other than node. Then the bundles for comments, would be any of the bundles attached to any of the entities that comments can be attached to. So, is it worth leaving the 'node' namespace in (but removing comment_), or do we worry about that later?
Comment #2
yched commentedHm, though one. 'Comments on entities' is a little hard to predict. It does sound like 'comments as field', in which case the 'bundle' strategy might also be one bundle per 'comments' field (bundle name = comments field name) : article and page share the same 'comments' field => their comments have the same set of fields.
OK, tricky case of future-telling. Maybe we can just punt for now and keep the current, then :-p.
Comment #3
MichaelCole commentedcomment_bundles.patch queued for re-testing.
Comment #5
sunComment #6
andypostseems no more an issue for d8
Comment #7
yched commentedYup, #731724: Convert comment settings into a field to make them work with CMI and non-node entities has taken care of that.