ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

Auto detect Write Action not working for me :(

jcm69 18 Feb, 2018
Hi,
does anyone know if there is something special to do with the id of
tables for the Auto detect Write Action to work in Database -> Save
Data functions ? I try to modify the dynamic actions demo for my own
needs on a table different than #__content but it doesn't work. In the
demo, the save function is used for both creation and modification of
articles thanks to this functionality. But in my case, it always create
new table entries😟 When I specify an Update Condition like
Article.id={data:article_id}, the modification works but then the
creation doesn't and vice versa... I know I could create 2 different
functions but I'd like to understand why this doesn't work in my case.
Any help anybody ?
Regards,
jc
Max_admin 19 Feb, 2018
Hi JC,
​
The auto detection will do an update only if a value of the table's primary key is passed with the data, so if your data provider array does not have a value for the primary key then an insert will be trigered.
​
Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
jcm69 19 Feb, 2018
Hi Max,
you're so strong🙂
The only thing I changed is to add the Id in the form fileds and it worked. But I wonder why. The Id should have been loaded fron the table, shouldn't they ? In read_article ou read_articles. Hmmm ?
Best regards,
jc
jcm69 19 Feb, 2018
Hi again,
may I respond to myself (may be usefull for someone... who knows).
In the case of article creation (New blue button), the edit event is called with no paramters. The read function doesn't find anything, hence there is no creation of an Id variable and so, Auto detect can't detect anything, and make the bad choice🙂 Adding a Id field in the form solves the problem because then Auto detect has a Id variable to work on. Am I right ?
Best regards,
jc
PS : I read in the FAQ of CC6:
(assuming a record is found, we will cover the not found possibility in a later part)
I didn't find the later part😉 And, I really wonder what these Events of read functions (record found event, record not found event) are made for. Especially Enable the record not found event.
Max_admin 05 Mar, 2018
Answer
Hi JC,
​
Exactly, when no id value is passed, no record is loaded and so the id field in the form is empty and an insert is auto selected.🙂
​
The not found situation can be solved with a switch function, I could not add more Connectiivty FAQs since that time but I will try to add more soon.😉
​
Please post any questions you may have on the forums and I will try to answer!
​
Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com