Comments (25)
Here is feedback after more in-depth testing.
As I said before, the plugin works, but it's actually too limited IMHO.
The configuration of the upload should be done in the upload field itself instead of the component, because it's possible to have several upload fields in one form (things the plugin don't support actually).
For example
For single field upload :
<input type="file" name="img">
For multiple field upload
<input type="file" name="img" multiple>
Options like allowed extension or max size could be handled with data-attributes, like this :
<input type="file" name="img" multiple data-extension=".png, .jpg, .pdf, .zip" data-maxsize="2MB">
The job of the plugin would be to detect the type of the input, and do the magic (it's magic form after all ^^) to make upload works.
For the UI, I think you should let the default basic HTML5 file upload and let the users choose the library they want to improve it like jquery fileupload
from october-plugin-forms.
This is what I have
// ADD UPLOADS
if (isset($properties['mail_uploads']) && $properties['mail_uploads'] && !empty($files)) {
foreach ($files as $file) {
$message->attach($file->getLocalPath(), ['as' => $file->getFilename()]);
}
}
`
from october-plugin-forms.
@tfprado Dude, i just comented the "$message->attach( Input::file('attachment') );" part, and uncommented the correct part, to make it the same as yours, and now it works!!!!!!!!!!!!!!!!! YOU ARE A LIFE SAVER MAN, THANK YOU VERY MUCH!!!!!!!!!!!!!!!!!!!!!!!!!
from october-plugin-forms.
I've never thought about that but i like your idea of only one component.
Still don't know when we can consider files uploads stable ...
from october-plugin-forms.
Tested the upload form a little, I encounter weird problem.
It break my html layout, like if there were missing
After some investigation, it seems that the cause of the problem is the code under the Template for new file comment.
It seems that closing divs between scripts tag don't output.
Tested on the latest version of chrome.
Alex
from october-plugin-forms.
Its not the fault of your plugin, the cause of the problem was offline responsive image plugin :
More informations here
from october-plugin-forms.
Tested the upload feature, (both multiple and single upload), here is my feedback.
Globally, it works well (and I defined my own partial), so I could consider it as stable. Just have some remark/questions :
-
Why did you put the submit button in a {{ form_submit() }} twig variables ? I tested to put a standard form submit button and there is no problems.
-
The uploader css file can be improved, for example instead of having hardcoded height and negative margin for .responsiv-uploader-fileupload.style-file-single .upload-button, you could use
position: absolute; height: 100%; right: 0; margin-right: 0;
Personally, now I always use the upload component as it perfectly works even with upload disabled. I just changed the file-upload partial to remove the message that say that the upload option needs to be enabled. I don't see any drawback.
from october-plugin-forms.
+1 for the last comment. I had to create a form with multiple upload elements recently and I agree it would be a joy to be able to define an upload input type exactly like other fields and let the module "magically" do the necessary.
Another suggestion about upload, In the backend, I would prefer to have upload files in the same format as the rest (in the table, with a label in first column and the link in second column) to stay consistent with the rest of the form. In addition, doing like this would keep the order of fields, which is important in my case.
Do you think you can implement the upload feature that way or do I have to think about a fork ?
from october-plugin-forms.
Hello @Zmove
About the public upload component, a pull request will be much appreciated.
Changes on the backend sounds good to me, will be ready on the next release.
from october-plugin-forms.
Here is an example of how the attached files will look
The files list needs to go on the bottom, because the order is not stored on the data array.
What do you think?
from october-plugin-forms.
Hello,
It's better than the previous version that displayed the files in buttons outside the table.
About the order of the field, I'm not sure to understand why the upload fields are different than the regular fields that can be ordered ? I think the solution is to detect all the file input type, like the rest of the fields.
I will try to examine the code and see if I can do something, but it will take times as I'm discovering laravel and october CMS at the same time. So I don't understand everything yet.
from october-plugin-forms.
Hello,
I encounter the same problem that Alex360hd experienced.
Template for new file is breaking my html, closing divs not being outputed.
I do have the responsive image plugin, the only solution is to delete it ?
I don't understand what's happening here, I'm new to october/laravel.
from october-plugin-forms.
Hello,
The only solution is to remove the responsive image plugin actually.
This is an issue related to the responsive image plugin, not magic form
from october-plugin-forms.
Ok thank you, this is disapointing that I have to choose between responsive images and magic forms.
Will definitely think about a fork on responsive images, php html parser is a pain, wouldn't it be easier to parse the html as plain text ?
from october-plugin-forms.
I'm starting to use the Magic Form Upload, but for some reason, when i put the {{ form_ajax(__SELF__ ~ '::onFormSubmit') }} <div id="{{ __SELF__ }}_forms_flash"></div> <!-- YOUR FORM FIELDS --> {% partial '@file-upload' %} {{ form_submit() }} {{ form_close() }}
, and i go the my website, and click on the "upload your files", it simply does nothing, doesn't open a browse to select the files, i have no idea how to fix this and would be really glad if someone could help me out!
FYI: i did change the "SELF" to my component name
from october-plugin-forms.
@skydiver @ghost please help :'(
from october-plugin-forms.
@Kusdrae do you have {% scripts %} and {% framework extras %} in your layout?
I had some issues with my JS load order that caused the same problem with the uploader not triggering the select file windows when clicked, switching the load order fixed it
from october-plugin-forms.
@tfprado Dude, i thought i had {% scripts %} and {% framework extras %} in my page, to be honest i gave up trying to fix it, since the form without upload worked just fine, but now that you answered, i went back and try to fix it, and it works!!!!!!!!!!!
thank you so much man!!!!
The only problem is that it is not sending the file as an attachment, but it's recording in the "Records" in October
from october-plugin-forms.
@Kusdrae Make sure you have the option to attach it to the notification selected.
If you are still not getting the attachment in the email check the mail logs
from october-plugin-forms.
@tfprado yes, i have this option selected
The error i'm getting is this:
from october-plugin-forms.
@Kusdrae that's interesting I don't see Input being used anywhere in SendMail.php. What is your plugin version? I am using 1.5.1
from october-plugin-forms.
@tfprado i'm using the same version, 1.5.1
i see it in this line:
/* $message->attach($file->getLocalPath(), ['as' => $file->getFilename()]); */ $message->attach( Input::file('attachment') );
from october-plugin-forms.
@Kusdrae and the sendMail
<?php
namespace Martin\Forms\Classes;
use Mail;
use System\Models\MailTemplate;
use Martin\Forms\Classes\BackendHelpers;
class SendMail {
public static function sendNotification($properties, $post, $record, $files) {
`
from october-plugin-forms.
@tfprado Hey, since you already helped me once (a lot), do you know if there's a way to make the form not accept duplicated data? Like, if i register someone in a form with the name "Test", is it possible to not allow any other form with the name "Test" ?
from october-plugin-forms.
@Kusdrae I believe you can use any regular Laravel validation rules. You are looking for Unique(database).
The plugin author has a lot of helpful documentation here on his website
Edit: It might be worth opening another question since we are no longer talking about uploads here
from october-plugin-forms.
Related Issues (20)
- Plugin breaks in Build >1.0.469 HOT 5
- The specified file extension [js] is invalid HOT 2
- No buttons on component input fields HOT 5
- Translate fields name in backend
- Error 405 caused by field validation on live server
- Post AJAX not Working. HOT 1
- Bug HOT 2
- Image/file validation error HOT 2
- reCAPTCHA does not work HOT 1
- Error code 406 after validation
- proc_open() has been disabled for security reasons
- Sending the form with the October JavaScript API instead of Data attributes gives 406 Not Acceptable
- Expected response code 250 but got code 550 HOT 3
- File uploaded on the storage but not displayed in the record and email. HOT 1
- Laravel Validation HOT 13
- How to add auto response email field in generic forms? HOT 3
- DE translation mistake
- Using Magic Form on October CMS 3 HOT 2
- Currently Getting this Error when submitting my Ajax Upload Form HOT 1
- Magic Forms does not support October CMS v3 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from october-plugin-forms.