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 Import (Moderator: Yashodha Chaku) »
  • Import Function crashing -- white screen of death
Pages: [1]

Author Topic: Import Function crashing -- white screen of death  (Read 1263 times)

Will Brownsberger

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 2
Import Function crashing -- white screen of death
October 06, 2009, 05:00:39 pm
I've successfully imported a number of files to CiviCRM, but now, for reasons I don't understand, I can't get to the import function. 

Whenever I click on import, I get the white screen of death with this error:

Fatal error: Class 'CRM_Import_DataSource_index' not found in /<myrootdoc>/civicrm/CRM/Import/Form/DataSource.php(197) : eval()'d code on line 1

Any ideas out there?  I'm guessing that I did something to the database or the flat files at some point that is causing the crash, because the code was working fine before.  But I'm not sure where to look?

The line that is breaking is in the _getDataSources function (relevant code below).

Any guidance greatly appreciated.  I'm running Civicrm 2.2.8 and php 5.2.9.   ??? ??? ???

/w.

 
    private function _getDataSources() {
        // Open the data source dir and scan it for class files
        $config = CRM_Core_Config::singleton();
        $dataSourceDir = $config->importDataSourceDir;
        $dataSources = array( );
        if (!is_dir($dataSourceDir)) {
            CRM_Core_Error::fatal( "Import DataSource directory $dataSourceDir does not exist" );
        }
        if (!$dataSourceHandle = opendir($dataSourceDir)) {
            CRM_Core_Error::fatal( "Unable to access DataSource directory $dataSourceDir" );
        }

        while (($dataSourceFile = readdir($dataSourceHandle)) !== false) {
            $fileType = filetype($dataSourceDir . $dataSourceFile);
            $matches = array( );
            if (($fileType == 'file' || $fileType == 'link') &&
                preg_match('/^(.+)\.php$/',$dataSourceFile,$matches)) {
                $dataSourceClass = "CRM_Import_DataSource_" . $matches[1];
                require_once $dataSourceDir . DIRECTORY_SEPARATOR . $dataSourceFile;
                eval("\$info = $dataSourceClass::getInfo();");
                $dataSources[$dataSourceClass] = $info['title'];
            }
        }
        closedir($dataSourceHandle);
        return $dataSources;
    }
   


Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Import Function crashing -- white screen of death
October 07, 2009, 12:05:25 am
It seems like some thing is wrong w/ data source directory.

can u put debug statement after line $dataSourceDir = $config->importDataSourceDir;

Code: [Select]
CRM_Core_Error::debug( '$dataSourceDir', $dataSourceDir );
exit( );

thanks

kiran
You Are Designed To Choose... Defined By Choice.

Will Brownsberger

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 2
Re: Import Function crashing -- white screen of death
October 07, 2009, 03:54:52 am
Thank you so much for responding.

You led me to the solution to the problem.

The result of your debug instruction was:

$dataSourceDir
<my civicrm base path>/CRM/Import/DataSource/

The contents of that directory are:

CSV.php
index.php
SQL.php

I threw in the debug line a couple of other places and realized that the program was crashing when it ran through that directory and hit index.php, not a file that it was expecting.  That's a file that I  put in there to show a blank screen if an intruder sought to open the directory.

So, I've removed that file and it all works fine.  I've also done the security instructions elsewhere on this site that make this directory inaccessible to browsing any way.

THANK YOU FOR SHOWING ME THE WAY!!!! :) :) :)


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Import Function crashing -- white screen of death

This forum was archived on 2017-11-26.