• 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.

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


I just looked at a stock install of Civi 4.7.15, and the getPublicViewUrl() method is present in <civiroot>/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 <civiroot>/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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.