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) »
  • How to debug contact export failure
Pages: [1]

Author Topic: How to debug contact export failure  (Read 1335 times)

tabletguy

  • I post occasionally
  • **
  • Posts: 73
  • Karma: 2
How to debug contact export failure
January 24, 2010, 10:51:01 pm
I did a search against a custom text field, using %India%. It returned 1300+ contacts, which I then wanted to export.

The export URL leaves a blank page, and also doesn't result in anything downloaded.

In the php log, I found this error:

Cannot access protected property CRM_Export_Form_Select::$_action in /home/ahymsin/public_html/main/administrator/components/com_civicrm/civicrm/CRM/Contact/Form/Task.php on line 87

CiviCRM 3.0.3 on Centos Linux 5.4, PHP version 5.1.6, Joomla 1.5.15

Is there something I can do to "unprotect" the export form, or somehow find out why it doesn't work?

The export would (I guess) be exporting the custom fields as well?

This is an individual contact search.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How to debug contact export failure
January 24, 2010, 11:55:15 pm
Are you able to replicate this on http://joomla.demo.civicrm.org ?

Kurund
Found this reply helpful? Support CiviCRM

tabletguy

  • I post occasionally
  • **
  • Posts: 73
  • Karma: 2
Re: How to debug contact export failure
January 25, 2010, 01:01:13 am
Is there a way to export and then reimport all the custom fields?  Otherwise, I will have to do all of that first. Also, I do not want to import my contacts, so I will have to check the demo out to see. It's going to take a while to set up, since I don't know what's causing it.

One of the reasons I asked "how to debug", rather than just report it :)

I'll start on setting up custom fields, etc.

tabletguy

  • I post occasionally
  • **
  • Posts: 73
  • Karma: 2
Re: How to debug contact export failure
January 25, 2010, 01:27:54 am
Adding a few custom data types and changing two records and running a search for %China% within the custom field, I was able to export successfully. Of course, this is 3.1, and I am running 3.03 on my (live) server.

tabletguy

  • I post occasionally
  • **
  • Posts: 73
  • Karma: 2
Re: How to debug contact export failure
January 25, 2010, 01:58:50 am
I disabled both custom field groups, and the export after search still fails.

Same message in my etc/php5errors.log file:


[25-Jan-2010 03:45:35] PHP Fatal error:  Cannot access protected property CRM_Export_Form_Select::$_action in /home/ahymsin/public_html/main/administrator/components/com_civicrm/civicrm/CRM/Contact/Form/Task.php on line 87

Code: [Select]
80    function preProcess( )
81    {
82        $this->_contactIds = array( );
83     
84        // get the submitted values of the search form
85        // we'll need to get fv from either search or adv search in the future
86        $fragment = 'search';
87        if ( $this->_action == CRM_Core_Action::ADVANCED ) {
88            $values = $this->controller->exportValues( 'Advanced' );
89            $fragment .= '/advanced';
90        } else if ( $this->_action == CRM_Core_Action::PROFILE ) {
            $values = $this->controller->exportValues( 'Builder' );
            $fragment .= '/builder';
        } else if ( $this->_action == CRM_Core_Action::COPY ) {
            $values = $this->controller->exportValues( 'Custom' );
            $fragment .= '/custom';
        } else {
            $values = $this->controller->exportValues( 'Basic' );
        }
       
        //set the user context for redirection of task actions
        $url = CRM_Utils_System::url( 'civicrm/contact/' . $fragment, 'force=1' );
        $session =& CRM_Core_Session::singleton( );
        $session->replaceUserContext( $url );
       
        require_once 'CRM/Contact/Task.php';
        $this->_task         = $values['task'];
        $crmContactTaskTasks = CRM_Contact_Task::taskTitles();
        $this->assign( 'taskName', $crmContactTaskTasks[$this->_task] );

        // all contacts or action = save a search
        if ( ( CRM_Utils_Array::value('radio_ts', $values ) == 'ts_all' ) ||
             ( $this->_task == CRM_Contact_Task::SAVE_SEARCH ) ) {
            // need to perform action on all contacts
            // fire the query again and get the contact id's + display name
            $sortID = null;
            if ( $this->get( CRM_Utils_Sort::SORT_ID  ) ) {
                $sortID = CRM_Utils_Sort::sortIDValue( $this->get( CRM_Utils_Sort::SORT_ID  ),
                                                       $this->get( CRM_Utils_Sort::SORT_DIRECTION ) );
            }

            $selectorName = $this->controller->selectorName( );
            require_once( str_replace('_', DIRECTORY_SEPARATOR, $selectorName ) . '.php' );

            $fv          = $this->get( 'formValues' );
            $customClass = $this->get( 'customSearchClass' );
            require_once "CRM/Core/BAO/Mapping.php";
            $returnProperties = CRM_Core_BAO_Mapping::returnProperties( $values);

            eval( '$selector   =& new ' .
                  $selectorName .
                  '( $customClass, $fv, null, $returnProperties ); '
                  );

            $params    =  $this->get( 'queryParams' );
            $dao       =& $selector->contactIDQuery( $params, $this->_action, $sortID );

            while ( $dao->fetch( ) ) {
                $this->_contactIds[] = $dao->contact_id;
            }
        } else if ( CRM_Utils_Array::value( 'radio_ts' , $values ) == 'ts_sel') {
            // selected contacts only
            // need to perform action on only selected contacts
            foreach ( $values as $name => $value ) {
                if ( substr( $name, 0, CRM_Core_Form::CB_PREFIX_LEN ) == CRM_Core_Form::CB_PREFIX ) {
                    $this->_contactIds[] = substr( $name, CRM_Core_Form::CB_PREFIX_LEN );
                }
            }
        }

        if ( ! empty( $this->_contactIds ) ) {
            $this->_componentClause =
                ' contact_a.id IN ( ' .
                implode( ',', $this->_contactIds ) . ' ) ';
            $this->assign( 'totalSelectedContacts', count( $this->_contactIds ) );             

            $this->_componentIds = $this->_contactIds;
        }
    }


Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How to debug contact export failure
January 25, 2010, 02:16:09 am
Quote
Is there a way to export and then reimport all the custom fields?  Otherwise, I will have to do all of that first. Also, I do not want to import my contacts, so I will have to check the demo out to see. It's going to take a while to set up, since I don't know what's causing it.
To import / export custom data you should scripts from bin/migrate/

Quote
[25-Jan-2010 03:45:35] PHP Fatal error:  Cannot access protected property CRM_Export_Form_Select::$_action in /home/ahymsin/public_html/main/administrator/components/com_civicrm/civicrm/CRM/Contact/Form/Task.php on line 87

Can you replicate this on http://joomla.demo.civicrm.org

Kurund
Found this reply helpful? Support CiviCRM

tabletguy

  • I post occasionally
  • **
  • Posts: 73
  • Karma: 2
Re: How to debug contact export failure
January 25, 2010, 02:24:56 am
Sorry I wasn't clear on my first reply to you.  When I said
Quote
Adding a few custom data types and changing two records and running a search for %China% within the custom field, I was able to export successfully. Of course, this is 3.1, and I am running 3.03 on my (live) server.
I was referring to the demo site that you linked to.

So, no, it does not duplicate with a simple test as I outlined.

I uninstalled 3.03 just now, and am in the process of installing 3.04.  The link you sent is 3.1 also. I might also try installing that..., but am worried that if I upgrade to 3.1, I would have to do a site restore to return back to 3.04 if needed.

tabletguy

  • I post occasionally
  • **
  • Posts: 73
  • Karma: 2
Re: How to debug contact export failure
January 25, 2010, 03:13:09 am
Same problem after installing 3.04, and same error message.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How to debug contact export failure
January 25, 2010, 03:17:57 am
Just check on on http://joomla.demo.civicrm.org, you don't need to upgrade your site to 3.1. It might be possible that it is fixed in 3.1

Kurund
Found this reply helpful? Support CiviCRM

tabletguy

  • I post occasionally
  • **
  • Posts: 73
  • Karma: 2
Re: How to debug contact export failure
January 25, 2010, 05:37:49 am
As I said, I already tried to duplicate the problem in 3.03 and 3.04. If there is still a sandbox version running 3.04 that DOES show the problem with the same steps, and does NOT show the problem in 3.1 then I would agree with you.

Otherwise, this seems to basic an issue in 3.0 to have been overlooked.

My site is running in CGI mode for php, and I'm thinking of changing to FCGI to see if that might solve the problem.

I also have an admin account set up for you if you'd like to take a look, but I'm happy to try out anything that anyone might suggest.

Stephan

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • How to debug contact export failure

This forum was archived on 2017-11-26.