I'm trying to develop a domain beans module and I've based it on the Domain Block module. So I have it storing the bean domain info in a new table and all working in that respect and now I want to be able to not show the bean if its not set for a specific domain.

For the domain blocks it uses hook_block_list_alter and decides if it should unload a block based on is domain settings and the current domain. I can't figure how to do this for beans however and was wondering if you'd have any ideas.

indytechcook was good enough to reply to a personal message but suggested I post here as others may have some ideas.

"I would hook_query_alter (https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...) to alter the bean queries. You would need to submit a patch to the bean module to make sure all of it's queries have a tag on them. Anyone using the bean_load or bean_load_multiple (like they should be) will be tagged with bean_load_multiple per the Entity API.

Comments

Jaypan’s picture

The only way your question could be answered is for someone to know what beans is, what you are supposed to do with them, and what you are trying to do with them, since you didn't supply us with any of this info. Hopefully you will be lucky enough that someone who has heard of them will come across and give you some assistance. Because you haven't given enough info for the rest of us to help.

TheNef’s picture

Sorry my bad, this is the module Bean that I was referring to https://drupal.org/project/bean. I was hoping to make them available only on certain domains using the Domain Access module(With Domain Block as an example as their so closely tied), but never worry I've come up with an alternative approach but thanks for your reply.

ibevamp’s picture

Hi TheNef,

Can you explain what your alternative solution was? I am facing the same issue.

Thanks

dan_lennox’s picture

This module adds domain access support for entities, so should work for beans.

https://www.drupal.org/project/domain_entity