1. rusasadmins
  2. RO CSVI
  3. Monday, 10 June 2019
  4.  Subscribe via email
Is it possible to UPDATE content with an import file?

1. if I provided an import file with 3 fields and one of the fields included the unique username, which was also a field in the article (unique), could I use it to update other fields in the table?

For example:
Import File:
First Name
Last Name
Phone Number
User Name

In the ARTICLEs I have fields:
First Name, Last Name, Phone Number, user Name

Could I UPDATE these records on the import?

2. If my import file included:
User Group
User Name

Could I 'import' into the user table, but only UPDATE the data and adjust the 'group' that the person is assigned to?

thanks,
Laura
Accepted Answer Pending Moderation
Hello Laura,
Can you send us the latest import debug log, template XML and your import file? There is no details on what the error could be when article is saved. It just says "Save failed with following error". Send me the requested details. I will run the import and check. I will see if i can reproduce the issue.

Also is the custom fields update in the same import? If not send me the debug log of that import to check.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 21
Accepted Answer Pending Moderation
For the error, I know it doesn't show any more details, even when I turn on debuger, and error handling it still doesn't show. when I looked up in the joomla forums / google, I found that the error like that signifies something is corrupt in the ASSETS table...

I'm attaching my people update fields and tags, I update my fields and tags at the same time.

When I go into any records that are within the category of 'people', I have the same problem.

If I need to, I could create a new people category, move all of the sub categories over, and see if that rebuilds the 'assets', but I will wait until you look at the log before I do that, because once I do, I will have to make lots of adjustments, to my data sql, fields, etc.

thanks,
LAura
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 22
Accepted Answer Pending Moderation
Hello Laura,
As per the import debug log, tags are imported for articles and also custom fields. There is nothing wrong i could see from debug log. If you can give me details of specific custom field which you are having problem with, i can check that in debug log.

For the article error, it could be something to do with people category. Was this people category created using RO CSVI?

How about you create a temp people category and import articles in there? You can test it with one article and see how it goes.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 23
Accepted Answer Pending Moderation
I have discovered the exact problem...

1. I created a new category
2. I COPIED my articles into this new category
(when I 'moved them', I still had errors in these articles
3. I tested, and can edit the articles as needed --> GOOD
4. I took one article (article title: Doug Motto), and REMOVED the only tag set for this person, so he had NO TAGS
5. The other 21 articles all had tags (each just had 1 tag)

I ran my update script
In the TAGS field had the tag: People/Administrative Staff (for example), just 1 tag

When I went into Doug Motto
---> everything worked perfectly
---> tag was added back properly
---> fields were editable
---> content was editable

When I went to edit any of the other 21 articles
---> SAME ERROR AS BEFORE, it's as if the record is corrupted
---> They have 1 tag as the others

Can you try something like this in your system, where you HAVE a tag in a record, then run the update with the same tag again... see if it corrupts the data?

thanks,
Laura
  1. more than a month ago
  2. RO CSVI
  3. # 24
Accepted Answer Pending Moderation
Hello Laura,
Thank you for the detailed information. I was able to reproduce this issue, for me the error was on article for which the tag has been removed and added again on import. But anyways the error is because of #__ucm_content and #__ucm_base table which was related to tags. I have fixed the issue with the attached patch file. Can you load the attached patch file and run your import? Let me know on how it goes.
Attachments (1)
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 25
Accepted Answer Pending Moderation
Tharuna& Roland,
Hi, it worked!!! I have tested a few times with the same article
- with the tag
- removed the tag
- without the tag
- with another tag

and it all worked, and no more corruption!

thanks,
Laura
  1. more than a month ago
  2. RO CSVI
  3. # 26
Accepted Answer Pending Moderation
Now, I tried to run it with 22 records, just to see how it works...

I got an error:
duplicate primary key = 4098

I looked at that record:
core_content_id = 4098
content_item_id = 2538
tag_id = 51

and
core_content_id = 4098
content_item_id = 2538
tag_id = 101

Here is the record:
Screen Shot 2019-12-18 at 9.58.50 AM.png

I attached the download log

It looks like the records are all being updated (although there is nothing to update in this run)

When I try to edit that record, I'm NOT getting any errors, so it's not corrupted.

I can ADD another tag manually to that record, and it works properly.

I don't want to run this script on all of my records until we are sure that it won't corrupt the data.

Question, do you think I should be able to run the script against all records, and it will 'fix' the error that I'm having, or will I have to move them to different categories, then run the script? Note, when I move to a different category, I have to make sure all of my fields work with that category before the move, so I don't lose any data. I have about 20 fields.

thanks,
Laura
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 27
Accepted Answer Pending Moderation
Hello Laura,
It looks like the records are all being updated (although there is nothing to update in this run)

Every time a tag is imported for an article, the existing row in the database is deleted and a new row is inserted. So there is no update when it comes to linking tags with articles.

Question, do you think I should be able to run the script against all records, and it will 'fix' the error that I'm having,

No this will not fix the duplicate entry error. We need to find what is causing this error.

or will I have to move them to different categories, then run the script? Note, when I move to a different category, I have to make sure all of my fields work with that category before the move, so I don't lose any data. I have about 20 fields.

If we can find the cause for duplicate entry error then i guess you don't need to move the category. The duplicate error is not because of the category but there is already an entry in database with same details. Can you run the below query in your phpMyAdmin and tell me how many rows you see?

SELECT * FROM `j17_contentitem_tag_map` WHERE `core_content_id`= 4098 and `tag_id` = 101;
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 28
Accepted Answer Pending Moderation
I have 1 record in this result for tag_id = 101

I also ran this so you can see all of the rows...


SELECT * FROM `j17_contentitem_tag_map` WHERE `core_content_id`= 4098


type_alias core_content_id content_item_id tag_id tag_date type_id
com_content.article 4098 2538 51 2019-12-18 13:36:23 1
com_content.article 4098 2538 55 2019-12-18 13:36:23 1
com_content.article 4098 2538 96 2019-12-18 13:36:23 1
com_content.article 4098 2538 101 2019-12-18 13:36:23 1

please note, it seems I have 2 errors...
1. Is the error from BEFORE, when I couldn't update my records, that is what I was referencing with the categories, any article in the category from before, got 'corrupted', so I can't edit the article without getting an 'error
2. Once I ran the script for just my 22 records, WITH YOUR PATCH, I do not get the error on those records.
3. The current error is just 'stopping' the program from running

Let me know what other queries I can run to assist.

thanks,
Laura
  1. more than a month ago
  2. RO CSVI
  3. # 29
Accepted Answer Pending Moderation
1. I REMOVED all tags from the record we are having an issue with
Adjusted Charles, so he did not have any tags.

2. Ran tags import again

3. error: duplicate entry: 4118 for key primary

checked record:
added properly
- admin staff
- technical staff

did not add: associate professor


SELECT * FROM `j17_contentitem_tag_map` WHERE `core_content_id`= 4118


2 records:

Action type_alias core_content_id content_item_id tag_id tag_date type_id
com_content.article 4118 2538 51 2019-12-19 10:33:14 1
com_content.article 4118 2538 101 2019-12-19 10:33:14 1


His entry in my 'update list': (see last field, 3 tags should have been added for him) - last field is the tag

2538 Hedrick, Charles charles-hedrick people/staff 1 Charles Hedrick Charles Hedrick LCSR Director Core 217 (848)445-3088 mailto:hedrick@rutgers.edu people/staff/technical-staff|people/staff/administrative-staff|people/affiliated-faculty/associate-graduate-faculty-member


Tag table listing:
id . parent_id . left rt . level . path
51 100 51 52 3 people/staff/administrative-staff
101 100 53 54 3 people/staff/technical-staff
96 94 37 38 3 people/affiliated-faculty/associate-graduate-faculty-member

could the error be because both tags that are being added have the SAME parent_id??? That is the only common thread...

thanks,
Laura
  1. more than a month ago
  2. RO CSVI
  3. # 30
Accepted Answer Pending Moderation
Hello Laura,
Thank you for detailed explanation. I ran a test import with your tags and can reproduce the duplicate entry error issue. I have fixed it with the attached patch file. Can you give a try by loading the patch file? The patch file has the changes which i sent earlier so you just have to load this latest patch file for new changes. Let me know how your import goes.
Attachments (1)
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 31
Accepted Answer Pending Moderation
Excellent!

I ran test #2 with 23 records --> WORKED
- my 'charles' record did not 'bomb' or error
- I tested each of the articles and they can all still be edited

I will keep testing, and get back to you on my 'big test'.

thanks,
Laura
  1. more than a month ago
  2. RO CSVI
  3. # 32
Accepted Answer Pending Moderation
Hello Laura,
Thank you for confirming that the patch is working. The fix will be included in our next RO CSVI release.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 33
  • Page :
  • 1
  • 2


There are no replies made for this post yet.
Be one of the first to reply to this post!