Answers.Body: <p>This seems to be related to upgrading to 4.7.31.
  Upgrading it to 4.7.30 does not seem to cause this problem.</p>
  
  <p>See these two other questions about the exact same problem with 4.7.31:</p>
  
  <p><a href="https://civicrm.stackexchange.com/questions/24247/civimail-no-recipients-nothing-added-to-table-civicrm-mailing-recipients">CiviMail - &#39;No recipients&#39;: nothing added to table civicrm_mailing_recipients</a></p>
  
  <p><a href="https://civicrm.stackexchange.com/questions/24212/after-upgrade-to-4-7-31-send-mail-recipients-no-recepients">After upgrade to 4.7.31 send mail - recipients - &quot;no recepients&quot;</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-30T19:53:53.110Z
Answers.Text: Hey, @Tom B. did was your CiviCRM instance multilanguage?
Answers.UserDisplayName: Marko
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-30T23:46:42.503Z
Answers.Text: Yes, a multilingual installation.
Answers.UserDisplayName: Tom B.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-31T08:27:28.183Z
Answers.Text: Yeah, that's it. All of us had multilingual installation.
Answers.UserDisplayName: Marko
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-27T17:08:57.393Z
Answers.LastActivityDate: 2018-03-27T17:08:57.393Z
Answers.UserDisplayName: Tom B.
Answers.Body: <p>The issue was affecting multilingual installations.
  If the multilingual support is turned off in the settings everything works. </p>
  
  <p>Applying the fix solves the problem for multilingual installations.</p>
  
  <p>You can see the <a href="https://github.com/civicrm/civicrm-core/pull/11906" rel="nofollow noreferrer">@monishdeb's fix on github</a>, the fix will be included in the next version.</p>
  
  <p>And here's the patchfile I used</p>
  
  <pre><code>131c131
  &lt;              -&gt;where('mailing_id = #mailing_id AND entity_table IN ("!groupTableName", "civicrm_mailing")')
  ---
  &gt;              -&gt;where('mailing_id = #mailing_id AND entity_table IN ("civicrm_group", "civicrm_mailing")')
  133d132
  &lt;              -&gt;param('!groupTableName', CRM_Contact_BAO_Group::getTableName())
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-31T17:33:54.423Z
Answers.LastActivityDate: 2018-03-31T17:33:54.423Z
Answers.UserDisplayName: Marko
Body: <p>Recently I upgraded:</p>
  
  <p><strong>Drupal</strong> core to <strong>7.57</strong></p>
  
  <p><strong>PHP</strong> from 5.6 to <strong>7.0.28-1</strong></p>
  
  <p><strong>CiviCRM</strong> from 4.7.27 to <strong>4.7.31</strong></p>
  
  <p>Since I've done so I can't send mailings.
  Basically I get the same thing like in the post described <a href="https://civicrm.stackexchange.com/questions/24212/after-upgrade-to-4-7-31-send-mail-recipients-no-recepients">here</a> </p>
  
  <p>When I select a group to send the mailing to, it says no recipients. And when I click send the mailing is listed as completed with 0 deliveries.</p>
  
  <p>This is what I get in my php error log </p>
  
  <blockquote>
    <p>[Tue Mar 27 10:02:14.592307 2018] [:error] [pid 10110] [client
    ip:45513] PHP Fatal error:  Uncaught Error: Call to undefined function module_invoke_all() in
    /var/www/mysite/sites/all/modules/civicrm/CRM/Utils/System/Drupal.php:857\nStack
    trace:\n#0
    /var/www/mysite/sites/all/modules/civicrm/CRM/Utils/System.php(1413):
    CRM_Utils_System_Drupal->onCiviExit()\n#1
    /var/www/mysite/sites/all/modules/civicrm/extern/url.php(62):
    CRM_Utils_System::civiExit()\n#2 {main}\n  thrown in
    /var/www/mysite/sites/all/modules/civicrm/CRM/Utils/System/Drupal.php
    on line 857, referer:
    <a href="https://mysite.org/civicrm/mailing/view?reset=1&amp;id=709" rel="nofollow noreferrer">https://mysite.org/civicrm/mailing/view?reset=1&amp;id=709</a></p>
  </blockquote>
  
  <p>I tried cleaning cache (drupal and civicrm) but it doesn't fix it. Rebuilding the smart groups didn't help either.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This problem seems to be groups related and not mailing related. CiviCRM log is clean, and single mails work just fine. </p>
  
  <p><strong>EDIT2</strong></p>
  
  <p>However when I'm selecting mail recipients if I select recipients from previous mailings it counts them as it should but it doens't for groups (smart or regular).</p>
  
  <p><strong>EDIT 3</strong></p>
  
  <p>This seems to be an issue with multilingual installations. </p>
  
  <p>The issue can be replicated by adding another language and then turning on Multiple Languages Support. After this the problem appears and disappears again when Multiple Languages Support is switched off. </p>
  
  <p>4.7.27 was working, not sure whether the problem first appeared with 4.7.28, 4.7.29, 4.7.30 or 4.7.31 </p>
  
  <p>I <a href="https://issues.civicrm.org/jira/browse/CRM-21856" rel="nofollow noreferrer">updated this issue on Jira</a></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-27T11:28:04.723Z
Comments.Text: I don't think this log file errors are the reason for not sending the mails, but you should try applying https://github.com/civicrm/civicrm-core/pull/11712 on your site to avoid the displayed errors in logs.
Comments.UserDisplayName: jitendra - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-27T11:38:17.993Z
Comments.Text: Yeah I just came to the same realization. Thanks! But I have no clue as to why I have 0 recipients. This appears as nothing to do with mailing, it's as if the groups are empty, sending out testmails and single mails works just fine.
Comments.UserDisplayName: Marko
Tags: <drupal><upgrade><php><mailing><civicrm-home>
Title: Mailing stopped working after CiviCRM, PHP and Drupal upgrade
ThreadText: # Mailing stopped working after CiviCRM, PHP and Drupal upgrade
  
  (Asked by: username_0 on 2018-03-27)
  
  Recently I upgraded:
  
  **Drupal** core to **7.57**
  
  **PHP** from 5.6 to **7.0.28-1**
  
  **CiviCRM** from 4.7.27 to **4.7.31**
  
  Since I've done so I can't send mailings.
  Basically I get the same thing like in the post described [here](https://civicrm.stackexchange.com/questions/24212/after-upgrade-to-4-7-31-send-mail-recipients-no-recepients)
  
  When I select a group to send the mailing to, it says no recipients. And when I click send the mailing is listed as completed with 0 deliveries.
  
  This is what I get in my php error log
  
  > [Tue Mar 27 10:02:14.592307 2018] [:error] [pid 10110] [client
  > ip:45513] PHP Fatal error: Uncaught Error: Call to undefined function module\_invoke\_all() in
  > /var/www/mysite/sites/all/modules/civicrm/CRM/Utils/System/Drupal.php:857\nStack
  > trace:\n#0
  > /var/www/mysite/sites/all/modules/civicrm/CRM/Utils/System.php(1413):
  > CRM\_Utils\_System\_Drupal->onCiviExit()\n#1
  > /var/www/mysite/sites/all/modules/civicrm/extern/url.php(62):
  > CRM\_Utils\_System::civiExit()\n#2 {main}\n thrown in
  > /var/www/mysite/sites/all/modules/civicrm/CRM/Utils/System/Drupal.php
  > on line 857, referer:
  > <https://mysite.org/civicrm/mailing/view?reset=1&id=709>
  
  I tried cleaning cache (drupal and civicrm) but it doesn't fix it. Rebuilding the smart groups didn't help either.
  
  **EDIT**
  
  This problem seems to be groups related and not mailing related. CiviCRM log is clean, and single mails work just fine.
  
  **EDIT2**
  
  However when I'm selecting mail recipients if I select recipients from previous mailings it counts them as it should but it doens't for groups (smart or regular).
  
  **EDIT 3**
  
  This seems to be an issue with multilingual installations.
  
  The issue can be replicated by adding another language and then turning on Multiple Languages Support. After this the problem appears and disappears again when Multiple Languages Support is switched off.
  
  4.7.27 was working, not sure whether the problem first appeared with 4.7.28, 4.7.29, 4.7.30 or 4.7.31
  
  I [updated this issue on Jira](https://issues.civicrm.org/jira/browse/CRM-21856)
  
  **Tags:** drupal, upgrade, php, mailing, civicrm-home
  
  > **Comments:**
  > **username_1**: I don't think this log file errors are the reason for not sending the mails, but you should try applying https://github.com/civicrm/civicrm-core/pull/11712 on your site to avoid the displayed errors in logs.  
  > **username_0**: Yeah I just came to the same realization. Thanks! But I have no clue as to why I have 0 recipients. This appears as nothing to do with mailing, it's as if the groups are empty, sending out testmails and single mails works just fine.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2018-03-31. Score: 4 | Accepted answer
  
  The issue was affecting multilingual installations.
  If the multilingual support is turned off in the settings everything works.
  
  Applying the fix solves the problem for multilingual installations.
  
  You can see the [@monishdeb's fix on github](https://github.com/civicrm/civicrm-core/pull/11906), the fix will be included in the next version.
  
  And here's the patchfile I used
  
  ```
  131c131
  <              ->where('mailing_id = #mailing_id AND entity_table IN ("!groupTableName", "civicrm_mailing")')
  ---
  >              ->where('mailing_id = #mailing_id AND entity_table IN ("civicrm_group", "civicrm_mailing")')
  133d132
  <              ->param('!groupTableName', CRM_Contact_BAO_Group::getTableName())
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2018-03-27. Score: 1
  
  This seems to be related to upgrading to 4.7.31.
  Upgrading it to 4.7.30 does not seem to cause this problem.
  
  See these two other questions about the exact same problem with 4.7.31:
  
  [CiviMail - 'No recipients': nothing added to table civicrm\_mailing\_recipients](https://civicrm.stackexchange.com/questions/24247/civimail-no-recipients-nothing-added-to-table-civicrm-mailing-recipients)
  
  [After upgrade to 4.7.31 send mail - recipients - "no recepients"](https://civicrm.stackexchange.com/questions/24212/after-upgrade-to-4-7-31-send-mail-recipients-no-recepients)
  
  > **Comments:**
  > **username_0**: Hey, @username_2. did was your CiviCRM instance multilanguage?  
  > **username_2**: Yes, a multilingual installation.  
  > **username_0**: Yeah, that's it. All of us had multilingual installation.  
  
  ---
  
  