While OA Users can be theoretically turned off, it cannot be done as oa_core.module calls oa_users_picture() function on line 575, causing "Fatal error: Call to undefined function oa_users_picture() in /profiles/openatrium/modules/contrib/oa_core/oa_core.module on line 575"
There are couple of options here how to fix this, each of them very simple, but I do not know which one is preferable from the architectural point of view, if the option of disabling OA Users should even be considered.
Couple of options:
- Add dependency OA Core -> OA Users - this would tie these modules tightly together.
- Check if OA Users is enabled in "oa_core_preprocess_views_view_fields()" and call that function only if it is - much looser coupling, but what are the implications?
- Move the oa_users_picture() into OA Core - simple but needs a bit of refactoring as the function would be renamed to something like "oa_core_user_picture()" and it is used a couple of times elsewhere.
Please advise which of these is suitable from long term and I will be happy to provide patch.
Comments
Comment #1
mpotter commentedI tend to like #2. Since the user_picture field is in oa_users, we wouldn't want to do #3...that would just move more into oa_core and we are trying to move the other way and strip down oa_core so it just deals with OG Spaces/Groups/etc. And as you noted, #1 is too tightly coupled. The model of #2 is used other places in OA2, and should make an easy patch.
Comment #2
jkingsnorth commentedA grep for oa_users_picture() reveals the function call is in:
oa_core > oa_core.module
oa_core > includes > oa_core.util.inc
oa_teams > plugins > content_types > oa_teams_members.inc
So we might need to patch a couple of files?
Comment #3
mpotter commentedHmm, maybe there is a #4 way that is better:
#4: move the oa_users_picture() function into oa_core.util.inc and refactor it to only use the user's picture field if the field exists. So let oa_users add the field. The function could just return the default image if there isn't a user profile picture.
Or, maybe this needs to be even further refactored into a hook that can provide the user's picture so people not using oa_users can override how pictures are obtained.
Comment #4
hefox commentedwent with #4 thanks