1. psmits
  2. RO CSVI
  3. Thursday, 01 December 2016
  4.  Subscribe via email
I am new to CSVI but I got it working, I can add records and update fields in my table
But in order to create a new record it is necessary to deliver a new record without a value for the field that has the primary key
How can I populate this field after the insertion with the proper value so it gets found by the primary key when I want to update it
I have tried with combining but that does not work
PHP version 7.0.13
Joomla! version 3.6.4
Database schema version 6.6.0
CSVI version 6.6.4.
Accepted Answer Pending Moderation
Hello,

We are working on it for our next release.
Kind regards,

RolandD

=========================
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. # 1
Accepted Answer Pending Moderation
Hi RolandD

Sounds logical to me, I know what to do to resolve it
But it is a bit annoying, so it would be helpfull to resolve it
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello,

If this is a template with using a custom field table than I believe I can explain why this happens. If you run an update of the available fields, the list of available fields is reset and the update process doesn't pick up the tables in any custom table import. When you save your template, the fields are added to the list of available fields again. I will have a look at improving that.
Kind regards,

RolandD

=========================
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. # 3
Accepted Answer Pending Moderation
Hi Tharuna

As indicated these settings were properly set, I only need to save the template again !!
That has happened with every update I installed !!
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello,
Thank you for confirming on the patch. Regarding your template problem, Please check if Use file for configuration is set to Yes in your template settings on File tab. This setting will read the column headers from import file and you wont see this unsupported fields message in import. If it is set to No, CSVI will try to read the template fields and in case there are no template fields it shows unsupported fields message.
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. # 5
Accepted Answer Pending Moderation
Hi Tharuna

I have tested your patch after installing the latest version
Now it works the same as my patch, so when a search field is set and the record is not present it will be inserted
I also tested for existing records to modify them
That does also work as expected

One question about updating CVSI
I noticed twice that after the update my import is not working
I have to save my template again without making changes to it
After that the import does work again
It gives a warning that the fields are not supported. I do not use predefined fields, I take them from the import file
See the image included


Error.jpg
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hello,
Yes the files are based on the latest version. Let me know 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. # 7
Accepted Answer Pending Moderation
Hi Tharuna

I will test the patch this afternoon, I have to update my system with the latest version first
The patch is based on the latest version released ?
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hello,
The patch file for import based on field to be independent of primary key field is ready. Can you try to load the attached patch file and see if it works as expected?

patch_custom_table_2017_01_31.zip
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. # 9
Accepted Answer Pending Moderation
Hi Tharuna

OK I will check your update to see if it does what I expect it to do
Thanks
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
Hello,
Ok, Thank you for confirming. I am working on changing the behaviour of import based on field so it acts independent from primary key field. If the value of import based on field is found in database then it will do a update else record will be inserted. I will send you a patch when it is ready.
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. # 11
Accepted Answer Pending Moderation
Hi Tharuna

Yes your assumption is correct, in case a search field is set, then it searches for it first.
If the record is not present it will add it. If the record is present than it will update the record found
If the record is not found than I set the primary key back to the one setup in the database
As the primary key is not present in my import the program inserts the record
  1. more than a month ago
  2. RO CSVI
  3. # 12
Accepted Answer Pending Moderation
Hello,
So i had a looked into your template and import file. You have set import_based_on field to be Type and this field has value in import file because of which CSVI is always doing an update even when the record is not there. For CSVI to create new records, this value should be empty. Your changes to the PHP file will check for Type value in database and if it is not present will create a new record else it will update the existing record. did i understand it correct?
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. # 13
Accepted Answer Pending Moderation
Hi Tharuna

Included the import file and backup from my template
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 14
Accepted Answer Pending Moderation
Hello,
I really don't understand why you had two templates for import. If its one field then one template should work. Can you send me your current template XML and your import file? To get template XML file got to CSVI maintenance page, Select CSVI Pro on first option and Backup template on second option. Select your template and click continue. Download the XML file and post it here.
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. # 15
Accepted Answer Pending Moderation
Hi Tharuna

No I do not have two different fields for the import !!
I use only one Field for that purpose, but with the standard program you need to create two templates
One for adding new records, and one for updating records
You cannot use one template to insert/update records
Hence with my modification, that is now possible with just one template
This template has the value for "ïmport based on field" set
That is a lot easier to setup and maintain
The behavior for an import without "import based on field" set is not changed
  1. more than a month ago
  2. RO CSVI
  3. # 16
Accepted Answer Pending Moderation
Hello,
We are happy hear that you solved your issues by writing custom code but we are not going to use your code in our component as it is been developed for your requirement. I believe the reason you had two templates was because you had two different fields import based on fields and your custom code supports that. Again to be clear custom table import is purely based on only one field which is either primary key or import based on field. If this field value is set then CSVI is going to do an update and if the field value is empty then a record is inserted.
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. # 17
Accepted Answer Pending Moderation
Hi Tharuna

I was not 100 % happy with the fact that I needed to use two templates for maintaining my database
So I altered the included php to solve that issue
Now I only have one template that inserts or updates my database
It checks if the record does exist in the database, if not than the primary key is reset to its original
Than the record is inserted, if it already exist, then the database is updated
com_csvi\addon\com_csvi\model\import\custom.php
You might need to remove some of my log statements, or improve the code to meet your standards
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 18
Accepted Answer Pending Moderation
Hello,
Yes, if you need to import based on two different fields then you need two different templates. Glad to know that your issues are solved.
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. # 19
Accepted Answer Pending Moderation
Hi Tharuna

OK that will work but then I have to maintain different import files
And I also have to create a different template for maintaining existing records (changing the search field as well)
Otherwise the records will always be added

So no comfortable solution yet :(
Thanks for your help


Just tested with two seperate templates but same import file
That does work for me currently :)
I only have to take care that I do not forget to switch templates !
Thanks for your grate support.
  1. more than a month ago
  2. RO CSVI
  3. # 20
  • Page :
  • 1
  • 2
  • 3


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