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) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.7 Release Testing »
  • [solved] 4.7.4 fatal error on export
Pages: [1]

Author Topic: [solved] 4.7.4 fatal error on export  (Read 691 times)

davyivins

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 2
    • PURCO SA
  • CiviCRM version: 4.5
  • CMS version: Drupal 6.33
  • MySQL version: 5.5.34
  • PHP version: 5.4.33
[solved] 4.7.4 fatal error on export
March 19, 2016, 08:40:20 am
I have just upgraded my Drupal 6 site to the latest CiviCRM 4.7.4
All seemed to go well except that when I try to export contact records (using primary fields). I get the following fatal error:

Fatal error: Can't use function return value in write context in ...public_html/sites/all/modules/civicrm/CRM/Export/BAO/Export.php on line 435

Steps I followed
1. Search for contacts
2. Select Export option
3. Select Export Primary fields
4. Press Continue

Some help would be hugely appreciated!

Thanks
Davy
« Last Edit: March 22, 2016, 01:00:16 pm by davyivins »
There are times I love technology...and then there are times I *love* technology :-)

davyivins

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 2
    • PURCO SA
  • CiviCRM version: 4.5
  • CMS version: Drupal 6.33
  • MySQL version: 5.5.34
  • PHP version: 5.4.33
Re: [solved] 4.7.4 fatal error on export
March 22, 2016, 01:03:13 pm
This was answered and solved by reswild (Web developer at Wild Web, Oslo, Norway). Many thanks for his answer at http://civicrm.stackexchange.com/questions/10569/help-fatal-error-doing-an-export-civi-4-7-4

Below is the solution:

Line 435 in CRM/Export/BAO/Export.php that your error message is referring to says:

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;
  }
There are times I love technology...and then there are times I *love* technology :-)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.7 Release Testing »
  • [solved] 4.7.4 fatal error on export

This forum was archived on 2017-11-26.