Shopping Cart Operations > Existing features
Data Import / Export actions?
Nimitz1061:
Opened my file with Open Office SCalc, resaved. This is encapsulated in double quotes.
Result:
--- Code: ---Data is empty or corrupted.
--- End code ---
File is not empty, (still contains 99K of data).
The original tab delimited file still reports no errors when ran in test mode:
--- Code: ---Test run completed. Total SQL queries: 360. Show details
--- End code ---
and
--- Code: ---Total loaded: 360. Updated: 0. Created: 360. Errors: 0
--- End code ---
are the results.
Detail wise the queries reported as being generated for a single product are:
--- Code: ---INSERT INTO `products` SET `product_id` = '', `model` = 'PNC28708', `weight` = '1', `weight_class_id` = '5', `date_available` = '4/1/2004 0:00', `date_added` = '4/1/2004 13:28', `quantity` = '99999', `price` = '32.95', `manufacturer_id` = '3', `tax_class_id` = '1', `status` = '1'
INSERT INTO `resource_map` SET `object_name` = 'products', `object_id` = 'new_id', `resource_id` = '', `default` = '', `sort_order` = '', `created` = '', `updated` = '', `name` = 'Toilet Tissue Aid', `description` = 'This toilet tissue aid is a simple solution for people who need an extended reach. The spring clamp on this toilet tissue holder easily opens to release tissue paper. This handy toileting aid measures 10" long. The vertical handle and horizontal clamp both measure 6" long. This bathroom aid is ideal for persons who are disabled, obese or are small people(dwarfism). Use with No Rinse Peri-Wash for added personal hygiene.', `meta_description` = 'Toilet tissue aides at Life Solutions Plus. Your source for toilet tissue holders, bathroom aides, toileting aides, toilet aides.', `meta_keywords` = 'toilet tissue aid, toilet tissue holder, bathroom aid, toileting aid, toilet aid, ass wipe, butt wipe'
INSERT INTO `resource_library` SET `resource_id` = 'new_id', `type_id` = '1', `created` = '', `updated` = ''
INSERT INTO `resource_descriptions` SET `resource_id` = 'new_id', `language_id` = '1', `name` = 'Toilet-Tissue-Aid-Paper-S.jpg', `title` = '', `description` = '', `resource_path` = 'Toilet-Tissue-Aid-Paper-S.jpg', `resource_code` = '', `created` = '', `updated` = ''
--- End code ---
I have difficulty envisioning this as an encapsulation problem.
Note the resource map table query:
--- Code: ---INSERT INTO `resource_map` SET `object_name` = 'products', `object_id` = 'new_id', `resource_id` = '', `default` = '', `sort_order` = '', `created` = '', `updated` = '', `name` = 'Toilet Tissue Aid', `description` = 'This toilet tissue aid is a simple solution for people who need an extended reach. The spring clamp on this toilet tissue holder easily opens to release tissue paper. This handy toileting aid measures 10" long. The vertical handle and horizontal clamp both measure 6" long. This bathroom aid is ideal for persons who are disabled, obese or are small people(dwarfism). Use with No Rinse Peri-Wash for added personal hygiene.', `meta_description` = 'Toilet tissue aides at Life Solutions Plus. Your source for toilet tissue holders, bathroom aides, toileting aides, toilet aides.', `meta_keywords` = 'toilet tissue aid, toilet tissue holder, bathroom aid, toileting aid, toilet aid, ass wipe, butt wipe'
--- End code ---
This contains data that appears to be consistent with the use for which it is labeled in the file.
Note also the fields reported, compared to the actual structure of the table involved:
--- Code: -----
-- Table structure for table `resource_map`
--
CREATE TABLE IF NOT EXISTS `resource_map` (
`resource_id` int(11) DEFAULT NULL,
`object_name` varchar(40) COLLATE utf8_bin NOT NULL,
`object_id` int(11) NOT NULL,
`default` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-no, 1-Yes',
`sort_order` int(3) NOT NULL DEFAULT '0',
`created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `resource_map_index` (`resource_id`,`object_name`,`object_id`),
KEY `group_id` (`resource_id`,`object_name`,`object_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--- End code ---
This is clearly a mistake in the name of the table used in the previous query.
Where the actual resource map should be derived from I don't know. But there are no name, description, meta_description or meta keywords fields in the resource_map table.
So, this should not work for the developer.
My working conclusion at present is that the code distributed and the code being tested by the developer are not the same.
David
Nimitz1061:
I have isolated the nature of the problem more specifically.
Double checked the encapsulation. The only difference in the results was that live imports started to return a somewhat vague error message to the effect that the import file was either empty or corrupted.
I knew the file was not empty, so I went back to file contents.
While the test imports had not indicated any problems with content, the file I'm using DID include additional columns not related to Abantecart database tables and columns. Removing SOME of these columns resulted in changes in the queries reported to be generated by the test routines, and a (somewhat) successful product import.
The queries generated now look like:
--- Code: ---INSERT INTO `products` SET `product_id` = '', `model` = 'NC28949-1', `weight` = '1', `weight_class_id` = '5', `date_available` = '4/1/2004 13:28', `date_added` = '4/1/2004 13:28', `quantity` = '99999', `price` = '0', `manufacturer_id` = '3', `tax_class_id` = '1', `status` = '0'
INSERT INTO `resource_map` SET `object_name` = 'products', `object_id` = 'new_id', `resource_id` = '', `default` = '', `sort_order` = '', `created` = '', `updated` = ''
INSERT INTO `resource_library` SET `resource_id` = 'new_id', `type_id` = '1', `created` = '', `updated` = ''
INSERT INTO `resource_descriptions` SET `resource_id` = 'new_id', `language_id` = '1', `name` = 'NC28949-1.jpg', `title` = '', `description` = '', `resource_path` = 'NC28949-1.jpg', `resource_code` = '', `created` = '', `updated` = ''
INSERT INTO `product_descriptions` SET `product_id` = 'new_id', `language_id` = '1', `name` = 'Guardian Economy Transfer Seat', `description` = 'The Guardian® Economy Transfer Bench is made of molded-plastic and has a nonslip textured surface and drainage hole. The backrest can be attached on either side. Seat height on this shower transfer bench adjusts from 16 ½" to 21 ½". Thie tub transfer bench fit tubs from 11" to 17" deep. Optional legs with suction cups are availabe on this bath transfer chair to increase stability. Bath transfer bench supports up to 300 lbs.', `meta_description` = 'Economy transfer seats at Life Solutions Plus. Your source for shower transfer benches, bath transfer benches, shower chairs, bath seats.', `meta_keywords` = 'bath transfer bench, shower transfer bench, economy transfer seat, transfer seat, shower chair, bath seat, shower stool, Guardian economy transfer seat, bath tub transfer bench, tub transfer bench, bath chair handicap'
--- End code ---
Note the new insert for products_description table, and the absence of attempts to insert data to missing fields in the resource_map table.
The total number of queries generated increased from 360 to 452. The live import was successful to the extent that product data WAS imported. Products were not assigned to the default store, or to categories. This is not unexpected, given that neither was included in the file set. (Note: I've yet to figure out how to assign the product to a store, though I do have an idea for how category assignment should work which I will test in the next few days.)
What was unexpected was that the resource column assignments which I thought would assign a product image file name to the product failed to do so.
So, some progress is being made. Strangely, some foreign column headings (and content!) remained in the file. Content included text and numbers. The columns deleted contained only file names, including some with sub-directories in the paths. This may be a good clue.....
David
andrew.mikhailyk:
Results of the test mode and actual import are not the same because in test mode script doesn't execute SQL queries.
But in actual import you see MySQL errors because table that you try to import doesn't have some columns that are present in your import file.
Nimitz1061:
Andrew,
I'd call that a reasonable restatement of my report.
Is there no way during the test run to check to see if sufficient data has been input to generate a complete object insertion ??
David
abantecart:
Unfortunately, there is no way to do test run of SQL unless transaction is used with no commit. Currently by testing import system does whole operation with creating SQL for whole import and validates if there is any data issue that it can find without performing SQLs.
In the future we can add this feature to the test once we support InnoDB engine. I agree that this will be beneficial
Thanks.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version