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 »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Error messages on Select Fields to Export
Pages: [1]

Author Topic: Error messages on Select Fields to Export  (Read 1153 times)

conductorchris

  • I post frequently
  • ***
  • Posts: 167
  • Karma: 9
    • Vermont Rail Action Network
  • CiviCRM version: 4.5.0
  • CMS version: Joomla 3.2.7
  • MySQL version: 5.5.32
  • PHP version: 5.3.26
Error messages on Select Fields to Export
February 25, 2010, 04:25:17 pm
Exporting primary fields works just fine (at least until I get to Microsoft Excel which insists on stripping the zero from the front of the zip codes 'cause it assumes I want everything to be a standard field </rant>).

When I try and choose fields to export I get 12 error messages on the "Select Fields to Export" screen and when I complete the export I don't have good data, just more error messages.

The first 6 error messages are:
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [root]/administrator/components/com_civicrm/civicrm/CRM/Core/BAO/Mapping.php on line 589
the second six are:
Warning: Invalid argument supplied for foreach() in [root]/administrator/components/com_civicrm/civicrm/CRM/Core/BAO/Mapping.php on line 605

[I'm running in Joomla]
Thanks to those who help create and enhance civiCRM!

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Error messages on Select Fields to Export
February 25, 2010, 07:13:34 pm
I can confirm this error in both 3.1.2 and 3.1.3
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Error messages on Select Fields to Export
February 25, 2010, 07:31:10 pm
ok, to fix this, the array_merge calls need to be fixed. in:
civicrm/CRM/Core/BAO/Mapping.php

replace 586-591 with:

Code: [Select]
                                if ( isset($relationshipType->$direction) ) { 
                                    $relatedFields    = array_merge((array)$relatedMapperFields[$relationshipType->$direction], (array)$relationshipCustomFields);
                                } else {
                                    $target_type      = 'contact_type_'.$second;
                                    $relatedFields    = array_merge((array)$relatedMapperFields[$relationshipType->$target_type], (array)$relationshipCustomFields); 
                                }

I filed an issue:
http://issues.civicrm.org/jira/browse/CRM-5888
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

conductorchris

  • I post frequently
  • ***
  • Posts: 167
  • Karma: 9
    • Vermont Rail Action Network
  • CiviCRM version: 4.5.0
  • CMS version: Joomla 3.2.7
  • MySQL version: 5.5.32
  • PHP version: 5.3.26
Re: Error messages on Select Fields to Export
March 02, 2010, 12:47:35 pm
Thank you!

After changing the code the export now throws this error:
Parse error: syntax error, unexpected T_FUNCTION, expecting T_VARIABLE in /home/railver/www/www/administrator/components/com_civicrm/civicrm/CRM/Core/BAO/Mapping.php on line 918

Line 918 is static function &formattedFields( &$params , $row = false ) {
Thanks to those who help create and enhance civiCRM!

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Error messages on Select Fields to Export
March 02, 2010, 01:15:46 pm
I would go back and make sure you edited things correctly. Maybe you accidentally added a bracket or something.
You can see diffs with the original file here:
http://fisheye2.atlassian.com/viewrep/CiviCRM/branches/v3.1/CRM/Core/BAO/Mapping.php?r1=26284&r2=26425
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

conductorchris

  • I post frequently
  • ***
  • Posts: 167
  • Karma: 9
    • Vermont Rail Action Network
  • CiviCRM version: 4.5.0
  • CMS version: Joomla 3.2.7
  • MySQL version: 5.5.32
  • PHP version: 5.3.26
Re: Error messages on Select Fields to Export
March 03, 2010, 12:59:09 pm
Accidently left a bracket off.
Thank you for your prompt, it's working now.
Thanks to those who help create and enhance civiCRM!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Error messages on Select Fields to Export

This forum was archived on 2017-11-26.