file field, user_id field and form with CCv5

veronique 28 Oct, 2014
Hi,

In my form connect with CCv5, I have a file field who don't save value nor file in directory and I can't save user_id value also. I would user_id take current user id.

This is my form designer
[attachment=0]ScreenShot.png[/attachment]
[attachment=1]ScreenShot2.png[/attachment]

This is my form setup
[attachment=2]ScreenShot3.png[/attachment]
[attachment=3]ScreenShot4.png[/attachment]

I try to do anything with DB Read but I'm really not sure of this
[attachment=4]ScreenShot5.png[/attachment]
[attachment=5]ScreenShot6.png[/attachment]

Then this the "File Upload" action details
[attachment=6]ScreenShot7.png[/attachment]
[attachment=7]ScreenShot8.png[/attachment]

All field are saved but not patronymes[patro_fichier] and patronymes[user_id].

Thanks for help and sorry for my bad english.
Max_admin 03 Nov, 2014
Hi Veronique,

First, please make sure that you have the latest v5.0.3

Then the user_id should be saved to the table only if you use "db save" action, but since we use CC here, then you will have to add it to the $form->data array before the "Connection action".

The Files config in the "upload" action will need to be changed to this format:
Model.field_name

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
veronique 07 Nov, 2014
OK, I update ChronoForms to v5.0.3.

Tank you for answer.

If I well understand I must not use "db save" for save current user id because I use ChronoConnectivity. That's right ?
Then how add user_id value saving before "Connection action". I try to put Custom Code before with this :
<?php
$user = JFactory::getUser();
return array("user_id")=>$user->get("id");
?>

but it don't save user_id in my table.

I change File config to
patronymes.patronymes[patro_fichier]:zip-doc-pdf-xls-rar-odt-ods-xlsx-docx-rtf-txt-jpg
where "patronymes" is model name (in CC) and patronymes[patro_fichier] is the filed name in Designer tab of ChronoForms. Nothing happen.

Could you please help me again.
GreyHead 07 Nov, 2014
Answer
Hi veronique,

I'm not clear about the file uploads, Max will need to answer that question.

The code you have for the user id is broken it won't do anything useful that I can see. It looks as though you have found some code to use the User_id to select a record in a DB Read. But it's not quite correct for that either.

Please try
<?php
$user = JFactory::getUser();
$form->data['patronymes']['user_id'] = $user->id;
?>

Bob
veronique 07 Nov, 2014
Hi GreyHead,

Your code make good. Current user id it's now save in my table.
I wait for solution for file upload fonctions.

Thanks a lot.
Max_admin 08 Nov, 2014
Hi Veronique,

The File's config box should use this syntax:
patronymes.patro_fichier


which is the model.field

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
veronique 14 Nov, 2014
Hi Max,

Thanks for précisions. Neither the file nor the value are registred despite this syntax correction.

That is my parameters :
[attachment=0]ScreenShot.png[/attachment]

Any other issue ?
Max_admin 14 Nov, 2014
Hi Veronique,

Bug found, please send me a message using the contact us page to get a patch file for this to work.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 17 Nov, 2014
Hi Veronique,

Please change the field name in the "Files config" box to include the Model id ONLY, then include the model id in the "Arrays fields names" in the upload action settings!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
veronique 17 Nov, 2014
Like that ?

"File config" : patronymes
"Array field" : patronymes

Véronique.
Max_admin 17 Nov, 2014
In the fields config you will use "patronymes" as the field name, instead of "patronymes.patro_fichier"

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
veronique 18 Nov, 2014
Max,

Despite your advices, no value, no file

My file field in form :
[attachment=1]ScreenShot.png[/attachment]

File upload action properties :
[attachment=0]ScreenShot2.png[/attachment]
[attachment=2]ScreenShot3.png[/attachment]

Sorry 😶

Veronique.
Max_admin 18 Nov, 2014
Hi Veronique,

In the fields config box:
patronymes:jpg-png...eyc

In the array fields:
patronymes

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
veronique 19 Nov, 2014
Hi Max,

Nothing.

Véronique.
Max_admin 23 Nov, 2014
Hi Veronique,

screenshot for the new config please ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 23 Nov, 2014
Also please make a form copy, remove the "Connection action" and test the form, does the file upload work ? if not then please send me a backup file for the form, either here or using the contact ticket!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
veronique 23 Nov, 2014
Hi Max,

I remove "Connection action" and this don't make upload work.

I send you backup file.

Thanks a lot

Véronique.
veronique 24 Dec, 2014
Hi Max,

My form works with CF v5.0.4 (it upload file and save its name in data base) but on submit I get a blank page instead of the ChronoConnectivity list.

Any idea ?

Thanks
GreyHead 24 Dec, 2014
Hi veronique,

Please see this FAQ - the same method should help debug here.

Bob
veronique 24 Dec, 2014
Hi GreyHead,

Thank you for your advice, I turned Joomla debug mode but the page remains completely blank so I try to resolve this disfunction like blind😃

Véronique
Max_admin 02 Jan, 2015
Hi Véronique,

Its not the Joomla debug which should be turned on, but the "Error reporting" should be set to "Maximum", that should display some error information to help understand why the blank page occurs.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
darrenhallinan 14 Jan, 2015
Has anyone managed to get this to work?

Just wondering would it be easier just to add a manual link to the form and call using db read? or is a fix available?
Contix71 17 Feb, 2015
Does this problem, by chance, has been solved in some way?
Because it's the same that I have, as explained at the end of this topic (which I haven't yet received a reply): empty database column in CFv5 only with file upload (and consequently, no connection with CCv5).

http://www.chronoengine.com/forums/posts/f12/t98771/adding-a-download-button-or-link-in-action-view.html
Contix71 20 Feb, 2015
1 Likes
After a long and daily search on the forum, at the end I solved the problem by reading this topic:

http://www.chronoengine.com/forums/posts/t98522/p341583/image-upload-and-chronoconnectivity.html#p341583

And in particular this very useful custom code of great Max:

<?php
if($form->data("file")){
$form->data["Model"]["field"] = $form->data["file"];
}


In my opinion, you should add this it in the FAQ, because I noticed that the "file upload action" is one of the most difficult to save in a DB with CF and solutions are not easy to find ...
This topic is locked and no more replies can be posted.