• Add drupal_alter('entityreference_current_field_instance_form', $form) to EntityReferenceCurrentInstanceBehavior.
  • Add drupal_alter('entityreference_current_get_current_entity', $field, $instance, $entity) to entityreference_current_get_current_entity().
CommentFileSizeAuthor
#3 entityreference_current-2192159-2.patch2.27 KBkolier

Comments

kolier’s picture

tedbow’s picture

Please give me some details about possible needs/uses for these new alter hooks.

I am not opposed to adding this but I don't want to add any unnecessary code either.

kolier’s picture

StatusFileSize
new2.27 KB

Change a little.

kolier’s picture

@tedbow
Just like your 'use_uid', you can imagine it.

tedbow’s picture

Just like your 'use_uid', you can imagine it.

Sorry but unless there is specific reason that you need the hooks I am not going to add them. I don't want to unnecessary function calls in.

Let me know, if you need them for something I probably add them though.

Also for this one.

Add drupal_alter('entityreference_current_field_instance_form', $form) to EntityReferenceCurrentInstanceBehavior.

Have you checked if you can do this with any of the hooks that Ctools makes available or just form_alter?

kolier’s picture

No problem, it just an idea that I found possible and useful when I try to reuse this module without actually forking it.

Though it's still limited, if there are a better design, this module or similar new module could be a entityreference_context that easily choose the 'context' to auto reference.

About doing it in other ways, there are always many ways to accomplish it, but these are the best that I could think out that ease the developer's burden.