Answers.Body: <p>It's a limitation in CiviCRM views implementation.</p>
  
  <p>If you are a developer and know views api, i encourage you to propose a patch for this. You can find all the code in <code>drupal/modules/views/civicrm.views.inc</code> or <code>https://github.com/civicrm/civicrm-drupal</code></p>
  
  <p>More precisely, the function <code>civicrm_views_get_argument</code> return a <code>views_handler_argument_numeric</code> for all numeric data type. You might want to try changing that to <code>views_handler_argument_many_to_one</code>. But it's really a guess : i don't know if it will work and even less if it will work for every fields.</p>
  
  <p>Otherwise, still with some programming knowledge, you could do a drupal module that implements <a href="https://api.drupal.org/api/views/views.api.php/function/hook_views_query_alter/7" rel="nofollow">hook_views_query_alter</a> but it's more a drupal question.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-11T09:08:29.627Z
Answers.Text: Thanks a lot @samuelsov for your response. Knowing it doesn't currently do this helps me from going around in circles.  
  
  Unfortunately my dev knowledge wouldn't stretch to creating a patch for this.  
  
  I will take a look at the module option and also chat to our contract developer about creating that patch and whether we can fund it if it isn't too much.  
  
  Thanks again
Answers.UserDisplayName: kimberley_p
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-08T15:00:53.197Z
Answers.LastActivityDate: 2015-05-08T15:00:53.197Z
Answers.UserDisplayName: samuelsov
Body: <p>I have a drupal view that shows aggregated totals  grouped by user from civi contribution pages.</p>
  
  <p>The view has a contextual filter that takes the contribution page id as an argument.</p>
  
  <p>The view works well if I pass in one argument.</p>
  
  <p>I would like to be able to pass in multiple arguments, so, display contributions from contribpageID1 AND contribpageID2.</p>
  
  <p>On contextual filters with drupal fields I am able, in the "more section", to select "Allow multiple values". This option isn't available on the <code>CiviCRM Contributions: Contribution Page</code> field.</p>
  
  <p>Is this a limitation of the civi views integration? Or a setting I can't find.</p>
  
  <p>Below is the query being run:</p>
  
  <p><code>SELECT SUM(civicrm_contribution.total_amount) AS civicrm_contribution_total_amount
  FROM 
  {civicrm_contribution} civicrm_contribution
  WHERE (( (civicrm_contribution.contribution_page_id = '12') )AND(( (civicrm_contribution.financial_type_id IN  ('1')) AND (civicrm_contribution.contribution_status_id IN  ('1')) AND (civicrm_contribution.is_test = '0') AND (civicrm_contribution.receive_date &gt;= '2014-12-31 00:00:00') AND (civicrm_contribution.receive_date &lt;= '2015-12-31 00:00:00') )))
  LIMIT 20 OFFSET 0
  </code></p>
  
  <p>On line 5, I want it to say ...<code>_page_id = '12,15')</code>...</p>
  
  <p>Aggregation is turned on but the option is not there when this is turned off either.</p>
  
Tags: <civicontribute><drupal><drupal-views>
Title: How to allow multiple values on a civicrm contextual filter in drupal views
ThreadText: # How to allow multiple values on a civicrm contextual filter in drupal views
  
  (Asked by: username_0 on 2015-04-20)
  
  I have a drupal view that shows aggregated totals grouped by user from civi contribution pages.
  
  The view has a contextual filter that takes the contribution page id as an argument.
  
  The view works well if I pass in one argument.
  
  I would like to be able to pass in multiple arguments, so, display contributions from contribpageID1 AND contribpageID2.
  
  On contextual filters with drupal fields I am able, in the "more section", to select "Allow multiple values". This option isn't available on the `CiviCRM Contributions: Contribution Page` field.
  
  Is this a limitation of the civi views integration? Or a setting I can't find.
  
  Below is the query being run:
  
  `SELECT SUM(civicrm_contribution.total_amount) AS civicrm_contribution_total_amount
  FROM
  {civicrm_contribution} civicrm_contribution
  WHERE (( (civicrm_contribution.contribution_page_id = '12') )AND(( (civicrm_contribution.financial_type_id IN ('1')) AND (civicrm_contribution.contribution_status_id IN ('1')) AND (civicrm_contribution.is_test = '0') AND (civicrm_contribution.receive_date >= '2014-12-31 00:00:00') AND (civicrm_contribution.receive_date <= '2015-12-31 00:00:00') )))
  LIMIT 20 OFFSET 0`
  
  On line 5, I want it to say ...`_page_id = '12,15')`...
  
  Aggregation is turned on but the option is not there when this is turned off either.
  
  **Tags:** civicontribute, drupal, drupal-views
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-05-08. Score: 1 | Accepted answer
  
  It's a limitation in CiviCRM views implementation.
  
  If you are a developer and know views api, i encourage you to propose a patch for this. You can find all the code in `drupal/modules/views/civicrm.views.inc` or `https://github.com/civicrm/civicrm-drupal`
  
  More precisely, the function `civicrm_views_get_argument` return a `views_handler_argument_numeric` for all numeric data type. You might want to try changing that to `views_handler_argument_many_to_one`. But it's really a guess : i don't know if it will work and even less if it will work for every fields.
  
  Otherwise, still with some programming knowledge, you could do a drupal module that implements [hook\_views\_query\_alter](https://api.drupal.org/api/views/views.api.php/function/hook_views_query_alter/7) but it's more a drupal question.
  
  > **Comments:**
  > **username_0**: Thanks a lot @username_1 for your response. Knowing it doesn't currently do this helps me from going around in circles.    Unfortunately my dev knowledge wouldn't stretch to creating a patch for this.    I will take a look at the module option and also chat to our contract developer about creating that patch and whether we can fund it if it isn't too much.    Thanks again  
  
  ---
  
  