Answers.Body: <p>I just looked at a stock install of Civi 4.7.15, and the <code>getPublicViewUrl()</code> method is present in <code>&lt;civiroot&gt;/CRM/Mailing/BAO/Mailing.php</code>.  So if you're getting an "undefined method" error, I would assume that your <code>CRM_Mailing_BAO_mailing</code> class is getting overridden.  My wild guess is you have an extension installed that isn't compatible with 4.7.</p>
  
  <p>Here's what I would do:</p>
  
  <ul>
  <li>Ensure that the file <code>&lt;civiroot&gt;/CRM/Mailing/BAO/Mailing.php</code> exists, and the line <code>public static function getPublicViewUrl($id, $absolute = TRUE) {</code> is present in it.  This is pretty much guaranteed unless you're doing something really wacky, but it's a good sanity check.</li>
  <li>Look for any PHP overrides you might have.  Go to <strong>Administer menu » System Settings » Directories</strong> and locate both your "extensions" and "PHP overrides" directory.</li>
  <li>Go into your PHP overrides directory.  Is there a subdirectory <code>CRM/Mailing/BAO</code>?  If so, and it has a file <code>Mailing.php</code>, then you need to figure out why.  The resolution should be either to remove the override, or to copy the latest version of <code>Mailing.php</code> into the folder and incorporate your override.  PHP overrides are difficult to maintain because they're not upgrade-safe; if you have one, I suggest finding a way to remove it.</li>
  <li>Any of your extensions may also have a <code>CRM/Mailing/BAO</code> subfolder.  If so, identify if you can disable that extension.  If not, you may want to follow up, either in the comments to this answer, or with the extension author.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-31T15:19:31.120Z
Answers.LastActivityDate: 2017-01-31T15:19:31.120Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <ul>
  <li>Drupal 7.52 </li>
  <li>CiviCRM 4.7.15 </li>
  <li>Apache/2.4.7 (Ubuntu) </li>
  <li>PHP/5.5.9-1ubuntu4.20</li>
  </ul>
  
  <p>For the past few versions of CiviCRM I am getting a 500 error when going to:</p>
  
  <pre><code>Mailings &gt; Draft and Unscheduled Mailings (/civicrm/mailing/browse/unscheduled)
  Mailings &gt; Scheduled and Sent Mailings (/civicrm/mailing/browse/scheduled)
  </code></pre>
  
  <p><strong>The browser page:</strong></p>
  
  <pre><code>The www.EXAMPLE.org page isn’t working
  
  www.EXAMPLE.org is currently unable to handle this request.
  HTTP ERROR 500
  </code></pre>
  
  <p><strong>Apache logs:</strong></p>
  
  <pre><code>[Mon Jan 30 23:11:31.163855 2017] [:error] [pid 7942] [client xx.xx.xx.xx:36293] PHP Fatal error:  Call to undefined method CRM_Mailing_BAO_Mailing::getPublicViewUrl() in /home/USER/web/EXAMPLE.org/public_html/sites/all/modules/civicrm/CRM/Mailing/Selector/Browse.php on line 425
  </code></pre>
  
  <p>I can send a mailing, and it does go out, but as soon as I send it I get the error, and can never see the Scheduled and Sent messages.</p>
  
  <p>I am a capable server administrator, and I've been hosting CiviCRM sites for seven years, but I have no idea how to even begin to debug or fix this error. I keep hoping the error will go away with each CiviCRM update, but it remains. Any help is greatly appreciated.</p>
  
  <p>Thank you,
  Tony</p>
  
Tags: <civimail><error>
Title: CRM_Mailing_BAO_Mailing - Error 500 trying to view Draft, Unscheduled, Scheduled, and Sent Mailings
ThreadText: # CRM_Mailing_BAO_Mailing - Error 500 trying to view Draft, Unscheduled, Scheduled, and Sent Mailings
  
  (Asked by: username_0 on 2017-01-31)
  
  Drupal 7.52 
  CiviCRM 4.7.15 
  Apache/2.4.7 (Ubuntu) 
  PHP/5.5.9-1ubuntu4.20
  
  For the past few versions of CiviCRM I am getting a 500 error when going to:
  Mailings > Draft and Unscheduled Mailings (/civicrm/mailing/browse/unscheduled)
  Mailings > Scheduled and Sent Mailings (/civicrm/mailing/browse/scheduled)
  
  The browser page:
  The www.EXAMPLE.org page isn’t working
  
  www.EXAMPLE.org is currently unable to handle this request.
  HTTP ERROR 500
  
  Apache logs:
  [Mon Jan 30 23:11:31.163855 2017] [:error] [pid 7942] [client xx.xx.xx.xx:36293] PHP Fatal error:  Call to undefined method CRM_Mailing_BAO_Mailing::getPublicViewUrl() in /home/USER/web/EXAMPLE.org/public_html/sites/all/modules/civicrm/CRM/Mailing/Selector/Browse.php on line 425
  
  I can send a mailing, and it does go out, but as soon as I send it I get the error, and can never see the Scheduled and Sent messages.
  I am a capable server administrator, and I've been hosting CiviCRM sites for seven years, but I have no idea how to even begin to debug or fix this error. I keep hoping the error will go away with each CiviCRM update, but it remains. Any help is greatly appreciated.
  Thank you,
  Tony
  
  **Tags:** civimail, error
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-01-31. Score: 2 | Accepted answer
  
  I just looked at a stock install of Civi 4.7.15, and the `getPublicViewUrl()` method is present in `/CRM/Mailing/BAO/Mailing.php`. So if you're getting an "undefined method" error, I would assume that your `CRM_Mailing_BAO_mailing` class is getting overridden. My wild guess is you have an extension installed that isn't compatible with 4.7.
  
  Here's what I would do:
  
  * Ensure that the file `/CRM/Mailing/BAO/Mailing.php` exists, and the line `public static function getPublicViewUrl($id, $absolute = TRUE) {` is present in it. This is pretty much guaranteed unless you're doing something really wacky, but it's a good sanity check.
  * Look for any PHP overrides you might have. Go to **Administer menu » System Settings » Directories** and locate both your "extensions" and "PHP overrides" directory.
  * Go into your PHP overrides directory. Is there a subdirectory `CRM/Mailing/BAO`? If so, and it has a file `Mailing.php`, then you need to figure out why. The resolution should be either to remove the override, or to copy the latest version of `Mailing.php` into the folder and incorporate your override. PHP overrides are difficult to maintain because they're not upgrade-safe; if you have one, I suggest finding a way to remove it.
  * Any of your extensions may also have a `CRM/Mailing/BAO` subfolder. If so, identify if you can disable that extension. If not, you may want to follow up, either in the comments to this answer, or with the extension author.
  
  
  ---
  
  