GeoDirectory SupportFailure to import sample csv – GeoDirectory Support https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/feed Fri, 14 Mar 2025 17:05:43 +0000 http://bbpress.org/?v=2.5.14-6684 en-US https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/#post-8729 <![CDATA[Failure to import sample csv]]> https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/#post-8729 Wed, 16 Jul 2014 20:52:02 +0000 physicaltherapistcom I’ve trying to import the unmodified sample CSV file with no luck:

Data inserted successfully.
Total of 0 records inserted.
Total of 3 records not inserted due to invalid address.

What could be causing the sample to not import correctly?
We are using GeoDirectory v1.1.6.

]]>
https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/#post-8731 <![CDATA[Reply To: Failure to import sample csv]]> https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/#post-8731 Wed, 16 Jul 2014 20:57:02 +0000 Guust Can you review this post
https://wpgeodirectory.com/support/topic/import-csv/#post-7753
and let us know how you went.
I am not sure the latest version already incorporated that improvement.

]]>
https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/#post-8732 <![CDATA[Reply To: Failure to import sample csv]]> https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/#post-8732 Wed, 16 Jul 2014 21:03:13 +0000 physicaltherapistcom I replaced the admin_funcitons.php but still get the same results.

Any other options?

*Edit* – As a side note, the admin_functions.php file from the post is identical to the one shipped with v1.1.6

]]>
https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/#post-8738 <![CDATA[Reply To: Failure to import sample csv]]> https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/#post-8738 Wed, 16 Jul 2014 21:47:49 +0000 Paolo Hi,

did you created the categories present in the sample file before trying to upload it?

That’s the only mandatory thing to do before a CSV upload, make sure all CSV mandatory fields aren’t empty and that categories have been previously created.

Thx

]]>
https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/#post-8811 <![CDATA[Reply To: Failure to import sample csv]]> https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/#post-8811 Thu, 17 Jul 2014 12:35:38 +0000 physicaltherapistcom Stepping through the debugger, it’s actually happening here (lines 1218-1247):


$location_result = geodir_get_default_location();
if($location_result->location_id == 0 ){

    if((!isset($gd_post_info['post_city']) ||
        strtolower($gd_post_info['post_city']) != strtolower($location_result->city)) ||
        (!isset($gd_post_info['post_region']) ||
        strtolower($gd_post_info['post_region']) != strtolower($location_result->region)) ||
        (!isset($gd_post_info['post_country']) ||
        strtolower($gd_post_info['post_country']) != strtolower($location_result->country)) ||
        (!isset($gd_post_info['post_address']) ||
        $gd_post_info['post_address']=='') ||
        (!isset($gd_post_info['post_latitude']) ||
        $gd_post_info['post_latitude'] == '') ||
        (!isset($gd_post_info['post_longitude']) ||
        $gd_post_info['post_longitude'] == '')){
    $address_invalid++;
    continue;

        }

    }else{

        if((!isset($gd_post_info['post_city']) || $gd_post_info['post_city'] == '') || (!isset($gd_post_info['post_region']) || $gd_post_info['post_region'] == '') || (!isset($gd_post_info['post_country']) || $gd_post_info['post_country'] == '') || (!isset($gd_post_info['post_address']) || $gd_post_info['post_address']=='') || (!isset($gd_post_info['post_latitude']) || $gd_post_info['post_latitude'] == '') || (!isset($gd_post_info['post_longitude']) || $gd_post_info['post_longitude'] == '')){

            $address_invalid++;
            continue;

        }

}

The sample upload matched the first long “if isset” conditional, increments $address_invalid and continues.

If I’m looking at it correctly, talking about the sample file:
It pulls the default location, which I have set.
Then it compares data pulled from the csv and fails if one of the location keys do not exists (which they do) or if the city, region or country key does not equal the default location.

Pretty sure thats whats getting it. Why does each imported record need to match the default location?

]]>
https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/#post-8848 <![CDATA[Reply To: Failure to import sample csv]]> https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/#post-8848 Thu, 17 Jul 2014 14:07:35 +0000 physicaltherapistcom Now I see…

It looks like with a default install of just the GEODirectory plugin, the default location gets a location_id equal to 0. Which causes the first if statement listed above to be true which then, based on the logic, will causes any imported places to fail if they are not at the default location.

When the GEODirectory Location Manager is installed, the default location’s location_id gets set to 1 which skips that check.

I would propose either the message generated from the import when not using the Location Manager is revised and notify the user that the imported items were not at the default location and possibly give them a hint to install the location manager.

You may also want to give some type of hint near the sample csv download to let users know it only works if the location manager is installed.

]]>
https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/#post-8862 <![CDATA[Reply To: Failure to import sample csv]]> https://wpgeodirectory.com/support/topic/failure-to-import-sample-csv/#post-8862 Thu, 17 Jul 2014 17:05:22 +0000 Paolo Hi @physicaltherapistcom,

yes you are correct, there is a validation to make sure places are imported only for default location in case multilocation isn’t installed.

We will add better error messages to avoid confusion.

I’ve flagged this for the developers.

thanks for the suggestions!

]]>