CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • WordPress Installations (Moderators: Kurund Jalmi, Coleman Watts) »
  • Wordpress media editor fatal error
Pages: [1]

Author Topic: Wordpress media editor fatal error  (Read 1733 times)

siriusly

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: Wordpress 3.5.2
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Wordpress media editor fatal error
August 26, 2013, 11:23:45 am
Hi -- I am getting a fatal error when attempting to use the native WordPress Media Library image > edit function.  Would very much appreciate any direction someone can provide to hunt this down and resolve.  Thanks!

I've disabled other plugins, but am still getting this:

Fatal error: Call to undefined function ts() in sitename.wp-content/plugins/civicrm/civicrm.php on line 649

Here's what's in civcrm.php there:

Code: [Select]
function civicrm_add_form_button_html() {
  $title = ts("Please select a CiviCRM front-end page type.");

  $now = date("Ymdhis");

  $sql = "
SELECT id, title
FROM   civicrm_contribution_page
WHERE  is_active = 1
AND    (
         ( start_date IS NULL AND end_date IS NULL )
OR       ( start_date <= $now AND end_date IS NULL )
OR       ( start_date IS NULL AND end_date >= $now )
OR       ( start_date <= $now AND end_date >= $now )
       )
";

  $dao = CRM_Core_DAO::executeQuery($sql);
  $contributionPages = array();
  while ($dao->fetch()) {
    $contributionPages[$dao->id] = $dao->title;
  }

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Wordpress media editor fatal error
August 26, 2013, 02:36:32 pm

might want to add the foll lines to the start of the function:

Code: [Select]
  if (!civicrm_initialize()) {
    return '';
  }

and see if that fixes it

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

siriusly

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: Wordpress 3.5.2
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: Wordpress media editor fatal error
August 26, 2013, 03:28:12 pm
That did it.  Thanks a bunch!  What does that bit do, if you don't mind taking a minute to reply?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Wordpress media editor fatal error
August 28, 2013, 01:41:31 pm

the error indicated that civi was not initialized. hence the initialization code fixed that (temporarily). However, i dont enuf about the WP integration to see why/how that function was being called without civi being initialized. So a proper fix would trace that path and see what is happening and why

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

siriusly

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: Wordpress 3.5.2
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: Wordpress media editor fatal error
August 31, 2013, 11:59:08 am
Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • WordPress Installations (Moderators: Kurund Jalmi, Coleman Watts) »
  • Wordpress media editor fatal error

This forum was archived on 2017-11-26.