Import / Export columns
Permalink Browser Info Environment
When exporting, the column order is
State, Zip, Country
When importing, the column order is
State, Country, Zip
So an export followed by an import results in country and zip data being cross-filled.
State, Zip, Country
When importing, the column order is
State, Country, Zip
So an export followed by an import results in country and zip data being cross-filled.
Type: | Pre-Sale |
---|---|
Status: | Resolved |
Thinking more about this, the cleanest fix for any existing data would be to change the import sequence and example to match the export sequence.
Thanks John,
I will also amend this :)
I will also amend this :)
Just realised the new version is available and have been doing some checks.
At first, I created a store, no groups, exported and imported, CSV import gave a column mis-match error (expected 12 columns). Looking at the csv, there are only 11 columns.
Guessing this could be because there are no groups, I created some groups. Now when I edit my test store and save, I get a database error.
Thinking maybe this was a table update glitch, I did a complete uninstall, dropped the tables, then reinstalled and repeated. Exactly the same problems.
At first, I created a store, no groups, exported and imported, CSV import gave a column mis-match error (expected 12 columns). Looking at the csv, there are only 11 columns.
Guessing this could be because there are no groups, I created some groups. Now when I edit my test store and save, I get a database error.
An exception occurred while executing 'INSERT INTO bthwstorelocation VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [null, "John Shop", "", "San Francisco", "CA", "United States", "94133", "37.8083823", "-122.41041970000003", "", "", "", "", "My test shop", "0", "0", ["1","2","3","4","5"]]: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'Array' for column 'gID' at row 1
Thinking maybe this was a table update glitch, I did a complete uninstall, dropped the tables, then reinstalled and repeated. Exactly the same problems.
OK that's odd, I will have a look into that error.
Ed
Ed
John,
Pushed an update that fixes that issue.
Ed
Pushed an update that fixes that issue.
Ed
Same error. Double checked I had installed the update.
Looking through the trace, it stems from:
22 Concrete\Core\Database\Connection\Connection Execute
/packages/hw_store_location/controllers/single_page/dashboard/hw_store_locations/addstore.php299
22 Concrete\Core\Database\Connection\Connection Execute
/packages/hw_store_location/controllers/single_page/dashboard/hw_store_locations/addstore.php299
Can you PM me your csv file?
That's not in a csv.
The db error happens when trying to add a store with groups through the dashboard page in order to create some content so I could export a CSV with groups.
The db error happens when trying to add a store with groups through the dashboard page in order to create some content so I could export a CSV with groups.
Yep sorry, me not reading the support ticket correctly.
John,
Can you amend Line 296 in hw_store_location/controllers/single_page/dashboard/hw_store_locations/addstore.php
from
to
NULL
Ed
Can you amend Line 296 in hw_store_location/controllers/single_page/dashboard/hw_store_locations/addstore.php
from
$_POST['hwGroups']
to
NULL
Ed
Adds OK.
Similar error on edit from
/home/john/Documents/web/customers/wayne_dejager/ling_ling/cms2/packages/hw_store_location/controllers/single_page/dashboard/hw_store_locations/addstore.php195
Hacked 195 to
seems to resolve that
Similar error on edit from
/home/john/Documents/web/customers/wayne_dejager/ling_ling/cms2/packages/hw_store_location/controllers/single_page/dashboard/hw_store_locations/addstore.php195
Hacked 195 to
'gID' => null, //$_POST['hwGroups'],
seems to resolve that
OK thanks John,
will push an update to fix.
Ed
will push an update to fix.
Ed
Export and then import leaves the country and zip fields crossed over, so back to the original bug at the top of this thread.
With the export/import crossed over, I then got a faulty geocode that appears to be stuck.
Once a store is geocoded, a change of address (ie correcting the country and zip) does not invalidate the geocode.
Once a store is geocoded, a change of address (ie correcting the country and zip) does not invalidate the geocode.
Yes the geo code is activated when doing an address search.
I will look into this and think of another way to update, may be a geo refresh button.
Ed
I will look into this and think of another way to update, may be a geo refresh button.
Ed
Version 1.3.5 pushed to the market place.
This should fix the cross over issue and other issues you have discovered,
Ed
This should fix the cross over issue and other issues you have discovered,
Ed
Export/Import now OK.
After importing and adding to existing , I edited a loactaion and changed the zip.
trace to:
/packages/hw_store_location/controllers/single_page/dashboard/hw_store_locations/addstore.php195
After importing and adding to existing , I edited a loactaion and changed the zip.
An exception occurred while executing 'UPDATE bthwstorelocation SET name = ?, address = ?, city = ?, state = ?, country = ?, zip = ?, latitude = ?, longitude = ?, phone = ?, email = ?, url = ?, urltext = ?, extra = ?, storeimage = ?, markericon = ?, gID = ? WHERE sID = ?' with params ["John Store", "", "San Francisco", "CA", "United States", "94134", "", "", "", "", "", "", "test store", "0", "0", null, "3"]: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'latitude' at row 1
trace to:
/packages/hw_store_location/controllers/single_page/dashboard/hw_store_locations/addstore.php195
Nothing to do with the zip. Edit and save with no changes gives the same error.
Looks like your database didn't like trying to update the table with a blank latitude data.
John,
Can you try this hack.
From line 173 add
and replace lines 197 and 198 with
Thanks Ed
Can you try this hack.
From line 173 add
and replace lines 197 and 198 with
'latitude' => $latitude, 'longitude' => $longitude,
Thanks Ed
Had to hack it around a bit. The empty test was back to front [edit - in the email, I see you have corrected that above]. '0' as a string failed. 0 as a number left lat/lng showing as 0/0.
Seems to accept null, which surprises me as my database settings usually object to null for numeric types. So I am not confident the below will be a good solution. Perhaps numeric 0 is safer.
The above could be simpler:
Seems to accept null, which surprises me as my database settings usually object to null for numeric types. So I am not confident the below will be a good solution. Perhaps numeric 0 is safer.
The above could be simpler:
I noticed and changed the code, you must have copied before I did!
So if string failed I'm guessing floatval('0') may fix the issue?
So if string failed I'm guessing floatval('0') may fix the issue?
A simple $latitude=0 etc worked for me, but floatval is certainly more correct and ensures type compatibility.
However, with a lat/lng 0.0/0.0 value now in the database, will it be geocoded correctly? Ow will it get stuck off west africa? I haven't tested that far ahead.
However, with a lat/lng 0.0/0.0 value now in the database, will it be geocoded correctly? Ow will it get stuck off west africa? I haven't tested that far ahead.
As it stands you will be stuck just off the coast of West Africa!.
I'm having a think of the best way to resolve this, I may alter the job to pick up blank and 0 and re geocode.
I'm having a think of the best way to resolve this, I may alter the job to pick up blank and 0 and re geocode.
Just pushed another update that changes the job to also re-geocode where the longitude and latitude are 0.
Not the best solution but works for now.
I will add a better indication on the store add/edit screen, probably with a map so you can visually see where it has geocoded to. Also have the option to refresh the location.
Ed
Not the best solution but works for now.
I will add a better indication on the store add/edit screen, probably with a map so you can visually see where it has geocoded to. Also have the option to refresh the location.
Ed
v1.3.6 fixes these issues. OK to mark this resolved.
The example csv has the column order
State, Country, Zip