I just found a conflict with this extension (which I love) and Solspace’s onSubmit extension (which I kinda need).
I haven’t seen anyone report this yet, so I figured it might prove helpful. This is the first time I’ve experienced a conflict with extensions.
The Behavior: As soon as the onSubmit extension is enabled, the LG SAEF File Upload extension fails to do anything on the form – the hidden fields and enctype are missing. This is even if onSubmit is not being used on that SAEF form. The form still submits and the data saves, but no file uploads and the custom field will only show the filename, no path var.
I’m not sure what the conflict is exactly…that’ll have to wait.
[edit] I found that by modifying the priority of the onSubmit extension to 9, it can co-exist with the LG SAEF File Upload extension.
Hey DaveO,
I haven’t checked out Solspaces extension but I would hesitate to guess that it is not checking to see if anyone is modifying the data before the hook is executing the extension method.
Heres an example of my code:
/**
* Modify the $data parameters before they are processed by the user side form creator
*
* @param array $data The form data
* @return array The form data
* @since Version 1.0.0
* @see http://expressionengine.com/developers/extension_hooks/form_declaration_modify_data/
*/
function form_declaration_modify_data($data)
{
global $EXT, $TMPL;
// -- Check if we're not the only one using this hook
if($EXT->last_call !== FALSE) $data = $EXT->last_call;
// check if the $TMPL is an object
// on the traditional member pages this hook is called but there are no templates.
if(is_object($TMPL) === TRUE && $TMPL->fetch_param('lg_saef_file_upload') == 'y')
{
$data['enctype']='multi';
$data['hidden_fields']['lg_saef_file_upload'] = 'y';
$data['hidden_fields']['lg_saef_file_upload_dir_id'] = $TMPL->fetch_param('lg_saef_file_upload_dir_id');
}
return $data;
}
You can see that I am checking if anyone else is using the hook first. If they are I’m using their data as a base for my extension. You may be able to modify Solspaces extension to do something similar.
Cheers
I’m having the same issue as this one. The directory tag is showing. Seems to have something to do with Mark Hout’s File field which I’m using. I’ve tried switching to a regular text field with no formatting, but it shows in the SAEF, where this doesn’t for some reason.
Is there any way to get the Edit part of this working in the Admin Panel as well?
I’m using this for a weblog where data is entered via the SAEF, but edited via the normal control panel. And at the moment in the control panel, my SAEF file field just shows up as a text box, with no way to re-upload a file. It’d be great if this had the same functionality in the SAEF as in the control panel!
Is there any way to get the Edit part of this working in the Admin Panel as well? I’m using this for a weblog where data is entered via the SAEF, but edited via the normal control panel. And at the moment in the control panel, my SAEF file field just shows up as a text box, with no way to re-upload a file. It’d be great if this had the same functionality in the SAEF as in the control panel!
At the moment there are no plans to add this functionality to the backend CP. Generally I just use the normal file upload which works well although it does not provide a preview. :(
BUG: If a user doesn’t supply a required field or the title the file uploads anyway and then the form throws out an error. So then the user fills the required field and the file gets duplicated on the server again when they click submit. This is a problem for me because i’m using this to upload fairly large files.
Anyone have any ideas how this can be fixed?
Let me first say that I really love this extension. I first implemented it several weeks ago, and it has been working great except for this little problem…
If a user uploads a file with a space in it, such as “My File.doc”, EE converts the filename to “My_File.doc” but the extension still saves “My File.doc” to the database. Is there anyway to get the data saved to the database by the extension to go through the same filename encoding as the actual file that was uploaded?
Let me first say that I really love this extension. I first implemented it several weeks ago, and it has been working great except for this little problem… If a user uploads a file with a space in it, such as “My File.doc”, EE converts the filename to “My_File.doc” but the extension still saves “My File.doc” to the database. Is there anyway to get the data saved to the database by the extension to go through the same filename encoding as the actual file that was uploaded?
If i upload “my file.xyz” through a SAEF the extension saves it as “my_file.xyz” to the server, and in the database/weblog field it’s stored as “https://ellislab.com/asset/images/team-photo/my_file.xyz”.
So it does what you want it to do for me!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.