Git Product home page Git Product logo

Comments (25)

 avatar commented on July 3, 2024 2

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.

tfprado avatar tfprado commented on July 3, 2024 1

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.

Kusdrae avatar Kusdrae commented on July 3, 2024 1

@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.

skydiver avatar skydiver commented on July 3, 2024

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.

 avatar commented on July 3, 2024

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.

 avatar commented on July 3, 2024

Its not the fault of your plugin, the cause of the problem was offline responsive image plugin :

More informations here

responsiv/uploader-plugin#17

from october-plugin-forms.

 avatar commented on July 3, 2024

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.

Zmove avatar Zmove commented on July 3, 2024

+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.

skydiver avatar skydiver commented on July 3, 2024

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.

skydiver avatar skydiver commented on July 3, 2024

@Zmove

Here is an example of how the attached files will look screenshot from 2017-03-20 11 02 08

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.

Zmove avatar Zmove commented on July 3, 2024

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.

GeRoHi avatar GeRoHi commented on July 3, 2024

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.

 avatar commented on July 3, 2024

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.

GeRoHi avatar GeRoHi commented on July 3, 2024

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.

Kusdrae avatar Kusdrae commented on July 3, 2024

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.

Kusdrae avatar Kusdrae commented on July 3, 2024

@skydiver @ghost please help :'(

from october-plugin-forms.

tfprado avatar tfprado commented on July 3, 2024

@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.

Kusdrae avatar Kusdrae commented on July 3, 2024

@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.

tfprado avatar tfprado commented on July 3, 2024

@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
Screen Shot 2021-06-11 at 2 38 20 PM

from october-plugin-forms.

Kusdrae avatar Kusdrae commented on July 3, 2024

@tfprado yes, i have this option selected
Captura de tela 2021-06-11 155225

The error i'm getting is this:
Captura de tela 2021-06-11 155310

from october-plugin-forms.

tfprado avatar tfprado commented on July 3, 2024

@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.

Kusdrae avatar Kusdrae commented on July 3, 2024

@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.

tfprado avatar tfprado commented on July 3, 2024

@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.

Kusdrae avatar Kusdrae commented on July 3, 2024

@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.

tfprado avatar tfprado commented on July 3, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.