-1

I have two blue prints for the space content type in OA. On the toolbar dropdown i want to show only the spaces created using the default blue print. AO uses the oa_core_get_groups_by_user_access(found in OA core module in the oa_core.util.inc file) to pull all spaces a use subscribed to. I want to alter this function to show only spaces created using the default blue print by altering the query used in this function.

All my attempts to do so have failed probably because i don't understand the drupal database abstraction queries. Can someone help me with the piece of code i can add to this function to achieve this functionality.

dayuloli
  • 16,205
  • 16
  • 71
  • 126
  • Please show your attempts. – dayuloli Mar 11 '15 at 06:42
  • (this is in response to the comment above) I tried addid the following lines but it didn't change a thing. // show only default spaces $query->leftJoin('field_data_field_oa_space_type', 's', "s.bundle = n.type"); $query->condition('s.field_oa_space_type_tid',1); So @dayuloli if you know a way i can improve my query please help. Thanks – Mutesasira Edward Mar 20 '15 at 10:15
  • Please add what you've tried in the question itself. I don't use Open Atrium, so I can't really help much. I was just moderating questions and commented to suggest how you can improve it – dayuloli Mar 20 '15 at 10:17

1 Answers1

0

Finally got it. To show only the default spaces in the dropdown, you have to make changes to the oa_core_get_titles function in the oa_core_util.inc file of oa_core.

Add the following line below line 641 of that particular file. $query->leftJoin('field_data_field_oa_space_type','t','n.nid=t.entity_id'); $query->condition('t.field_oa_space_type_tid',1);

This filters out only spaces created using the default space.