Sackgesicht VIP
Total posts: 1,636
07 Апр 2016 18:56

Import with a unique number column should update existing records if the same unique column is used again. To test this scenario i just uploaded the same CSV file 2 times, but it creates the records again and is not updating them.

Последние изменения: 17 Июнь 2016


Sackgesicht VIP
Total posts: 1,636
08 Апр 2016 01:42

Another observation is the the configuration of thge import is not saved properly.

I made an assignment of a csv column to a field, but this assignment was not saved with the configuration.


Sergey
Total posts: 13,748
13 Апр 2016 08:18

Please attach your CVS I'll test.


Sackgesicht VIP
Total posts: 1,636
13 Апр 2016 09:10

Scenario: Empty js_res_record, js_res_record_values, js_res_record_categories, js_res_import, js_res_import_rows

I imported the attached CSV (4 records) into a TYPE with a TEXT field.

The CSV has 4 columns: NO --> unique Number Category --> category informartion Title --> Title File --> Text field in TYPE

After IMPORT it shows:

2016-04-13_16-51-27

It should say 4 new Articles inserted and not updated, since the type was empty and did not have any prior records.

When checking the record_values table it only shows 1 record (from article 4), the first 3 records for field FILE were not created.

2016-04-13_16-56-34

"Indexing" in js_res_record fieldsdata did only happen for the last inserted record.

2016-04-13_16-53-55

When importing the same file again, it creates another 4 records and is not ignoring (updating) the existing 4 records.

2016-04-13_17-11-27

See attached CSV file, exported from Excel as Windows CSV. Workbook21


Sackgesicht VIP
Total posts: 1,636
14 Апр 2016 01:33

Since the import process provides a "ctime" field, it should also provide an "expiration_time" field.

Speaking of date fields, the datetime field is also lacking the import feature. I would suggest to expect as default date "YYYY-MM-DD" and add the " 00:00:00", before storing, if the csv data does not have the time information.

Another usefull feature would be a recording of created ID's (or a logfile in general) to provide an option to UNDO the import in deleting all the created records.


Sergey
Total posts: 13,748
19 Апр 2016 07:09

Sackgesicht Another usefull feature would be a recording of created ID's (or a logfile in general) to provide an option to UNDO the import in deleting all the created records.

Such a thing created in DB js_res_import in crossids column. It is JSON.

I'll check the other issues on import later.


Sackgesicht VIP
Total posts: 1,636
19 Апр 2016 10:28

Sergey Such a thing created in DB js_res_import in crossids column. It is JSON.

nothing is created here in my setup under crossids column....


pepperstreet VIP
Total posts: 3,837
23 Апр 2016 00:19

Sackgesicht Since the import process provides a "ctime" field, it should also provide an "expiration_time" field.

Good point. I remember I have mentioned something similar in another topic.
IMHO, all minimum core infos/fields should be available during import.


Sergey
Total posts: 13,748
26 Апр 2016 13:35

If import soes not finish with success it might fail to write that data into import table. Does your import go through without error or interaption?


Sackgesicht VIP
Total posts: 1,636
26 Апр 2016 20:30

Sergey If import soes not finish with success it might fail to write that data into import table. Does your import go through without error or interaption?

No error.

Did you try the import with requested and attached file? Did it properly create the record values on your side? Does it show the articles created under "New articles inserted" in the final page? What happends on second import?

Here import is not working as expected under different scenarios (New installation, existing installation, PHP 5.5 to PHP 7)


Sergey
Total posts: 13,748
28 Апр 2016 11:19

I wrote very extensive answer to this question withh al the explanations. But fail to save. I was logged out.

So shortly you cannot use . in column name. Change NO. to NO.


Sackgesicht VIP
Total posts: 1,636
02 Май 2016 04:01

Sergey So shortly you cannot use . in column name. Change NO. to NO.

I changed it and the import is running better now. Exceptions like "No . in header" should be detected by the parser, giving a warning and not proceeding to Step 2, otherwise defective records will be created by the import script.

I have a complete empty Cobalt installation and import 4 records. In the final page it says, 4 articles updated. It should show 4 new articles inserted.

2016-05-02_11-44-51

Now i used the same csv file and added 1 article. After importing it shows :

2016-05-02_11-52-57

This is wrong, it should say 5 processed , 1 new article inserted and 4 articles updated. The import itself was correct.

Another thing, the import setting should remember the field settings. It only remembers the title, category and unique number.


Sergey
Total posts: 13,748
02 Май 2016 05:15

Sackgesicht Exceptions like "No . in header" should be detected by the parser, giving a warning and not proceeding to Step 2, otherwise defective records will be created by the import script.

Fixed.

Sackgesicht This is wrong, it should say 5 processed , 1 new article inserted and 4 articles updated. The import itself was correct.

I also noticed this problem. I'll check it later.

Sackgesicht Another thing, the import setting should remember the field settings. It only remembers the title, category and unique number.

For me it remembers averything. Including all fields configurations.


Sackgesicht VIP
Total posts: 1,636
11 Май 2016 05:39

Sergey For me it remembers averything. Including all fields configurations.

But not for TEXT fields, since it does not have the onImportForm function. See Github issue #85


Sergey
Total posts: 13,748
13 Май 2016 12:41

Text field have those methoods on parent class in components/com_cobalt/library/php/fields/cobaltselectable.php. This is parent class for checkbox, radio, select, listautocomplete and multiselect.


Sackgesicht VIP
Total posts: 1,636
17 Май 2016 03:43

Please check repeated import with TEXT field. It does not remember the setting.

If I add

    public function onImportForm($heads, $defaults)
    {
        return $this->_import_fieldlist($heads, $defaults->get('field.' . $this->id));
    }

to TEXT field, then it remembers it.


Sergey
Total posts: 13,748
18 Май 2016 13:44

I have updated parent class for text field. It should work now.


Sackgesicht VIP
Total posts: 1,636
09 Июнь 2016 02:50

Sergey I also noticed this problem. I'll check it later.

Still not working.. it does not distinguish between updated and created.


Sergey
Total posts: 13,748
12 Июнь 2016 11:06

But this is exactly what is called.

public function onImportForm($heads, $defaults)
{
    return $this->_import_fieldlist($heads, $defaults->get('field.' . $this->id));
}

this is what you can find in text field parent plass.


Sackgesicht VIP
Total posts: 1,636
12 Июнь 2016 12:09

it is refering to the problem in distinguishing between update and new record. Please check 13 comment here where you mentioned that you are aware of it and will check it later. Not about the text field.


Sergey
Total posts: 13,748
17 Июнь 2016 15:45

Sackgesicht it is refering to the problem in distinguishing between update and new record

I've fixed this problem for next update.

Работает на Cobalt