Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-18279

Export not working with PHP < 5.5

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.4
    • Fix Version/s: 4.7.5
    • Component/s: Core CiviCRM
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      Exports aren't working if you are using a PHP version less than 5.5. The problem is line 435 in CRM/Export/BAO/Export.php:

      if (!empty(self::defaultReturnProperty($exportMode))) {
      

      This will give an error in all PHP versions below 5.5. From the PHP manual (http://php.net/manual/en/function.empty.php): "Prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error"

      You should be able to fix this by replacing lines 435-437 in Export.php with something like:

        $key = self::defaultReturnProperty($exportMode);
        if ($key) {
          $returnProperties[$key] = 1;
        }
      

      This issue has also been reported on StackExchange: http://civicrm.stackexchange.com/questions/10569/help-fatal-error-doing-an-export-civi-4-7-4

        Attachments

          Activity

            People

            • Assignee:
              saurabh.batra Saurabh Batra
              Reporter:
              reswild Gunnar Mathisen
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m