At first I thought this was a job for hook_preprocess_field()
; however, it then occurred to me that this field is populated by an ajax look up.
Where might be the best place to remove the group id from this? That is, how do I remove the (2) from the "TEST GROUP, Private" result pictured below?
I keep having users ask me why it's there.
I've also explored this in the Firefox Inspector. When I key in test, I see that requests are being sent to /og/autocomplete/tags/og_group_ref/node/post/default/NULL/test
And going a bit of work, I see that that path maps to these callbacks:
mysql> select path, page_callback from menu_router where path like 'og%';
+--------------------------------+------------------------------------------+
| path | page_callback |
+--------------------------------+------------------------------------------+
| og/autocomplete/single/%/%/%/% | og_entityreference_autocomplete_callback |
| og/autocomplete/tags/%/%/%/% | og_entityreference_autocomplete_callback |
+--------------------------------+------------------------------------------+
2 rows in set (0.00 sec)
Which I find in these files:
$ grep -Rin 'og_entityreference_autocomplete_callback' *
profiles/commons/modules/contrib/og/includes/og.field.inc:313:function og_entityreference_autocomplete_callback($type, $field_name, $entity_type, $bundle_name, $field_mode, $entity_id = '', $string = '') {
profiles/commons/modules/contrib/og/og.module:100: 'page callback' => 'og_entityreference_autocomplete_callback',
profiles/commons/modules/contrib/og/og.module:107: 'page callback' => 'og_entityreference_autocomplete_callback',
And the callback function returns entityreference_autocomplete_callback_get_matches
.