Giter Site home page Giter Site logo

contao-mp_forms's Introduction

mp_forms

This is a Contao extension that allows you to create real forms over multiple pages.

After installing the module, you have a new setting in the form definitions where you can define the GET parameter you want the extension to work with. By default, this is step so it will generate step=1, step=2 etc. in the URL. If, for whatever reason step is already in use on your webpage, you can change the settings there.

Moreover, you'll get a new form field called Page break. Every time you use this form field, the module will insert a page break in the form.

mp_forms validates if a user manually wants to go to step 3 and did not fill in step 1 or 2. I this case the user will be redirected to step 1 (obviously, only if you had required fields on step 1).

In case you don't want your users to be redirected but prefer to have some Ajax magic, you may combine this extension with our ajaxform one. They work perfectly well together!

⚠️ You may not use the regular submit form field element:

Note that you must not be using a regular submit form field but use the Page break again. Otherwise, you won't have any back button displayed. mp_forms will automatically detect the last Page break as behaving like the form submit. If you use the regular submit form field anywhere in your form, mp_forms is completely disabled and you won't have any steps!

The Summary element

A typical use case of forms that are split into multiple steps is to summarize data that was previously entered. This might be on the final step before the data is submitted but it can also happen in between. You can use this special form field type to display the data. Accessing the data can be done via the "Simple Token" technology that is typical for Contao. All the form fields of previous steps are passed on using the ##form_*## notation. You may also access the labels using ##formlabel_*##.

Files are handled a bit differently because there is more than just one value to a file. You may use extension, size, mime as well as a download_url which is generated for you. To make things simple, the default token for the file (e.g. if the form field was named upload that would be ##file_upload##) contains the HTML rendered using the ce_download template.

A simple summary for all the submitted fields, encapsulated in simple <div> elements can be displayed using the ##mp_forms_summary## token.

Because trying things out yourself is usually easier and so you don't have to remember all the tokens that can be used, you may simply place the ##mp_forms_debug## token which will show you all the available tokens with their content.

Frontend module to display a step navigation

This module ships with a front end module that allows you to easily build a front end navigation for each of your steps. Not styled at all, it might look something like this in the end:

Example for step navigation

Note that by default steps will just be named Step x in every language. The Page break form field label field will be used for the navigation if you provide it.

Insert tags

There are insert tags you can use to fetch information about the state of the form:

Insert tag Description Example
{{mp_forms::<form id>::step::current}} Contains the current step you are on 2
{{mp_forms::<form id>::step::total}} Contains the total steps of your form 5
{{mp_forms::<form id>::step::percentage}} Contains the percentage of your progress 20
{{mp_forms::<form id>::step::numbers}} Contains a classic x of y display 2 / 5
{{mp_forms::<form id>::step::label}} Contains the label of the current step Step 1
{{mp_forms::<form id>::field_value::<field_name>}} Contains the submitted value of a previous field

Note that they can be especially useful together with a Custom HTML front end module. Let's assume you want to display a progress bar for form ID 5:

<div class="progress">
    <div class="progress-bar">
        <div class="progress-bar-inner" style="width:{{mp_forms::5::step::percentage}}%"></div>
    </div>
    <div class="numbers">{{mp_forms::5::step::numbers}}</div>
</div>
```

contao-mp_forms's People

Contributors

toflar avatar red-nothing avatar qzminski avatar m-vo avatar taca avatar aschempp avatar contaoacademy avatar markocupic avatar markejn avatar wiphi avatar cgoit avatar

Stargazers

Markus Pfeifer avatar  avatar Steffen Gransow avatar  avatar Oliver Orlowski avatar Stefan Schulz-Lauterbach avatar Sascha Wustmann avatar Fritz Michael Gschwantner avatar  avatar André Saage avatar  avatar  avatar Sebastian Gabler avatar Stefan Schleich avatar Richard Henkenjohann avatar Andraz avatar Niels avatar  avatar Sven Baumann avatar Christian Barkowsky avatar Cliff Parnitzky avatar  avatar CeeKay avatar Oliver avatar

Watchers

 avatar James Cloos avatar Oliver avatar Blair Winans avatar Cliff Parnitzky avatar Joachim Scholtysik avatar  avatar André Saage avatar Fritz Michael Gschwantner avatar  avatar Sebastian Gabler avatar  avatar

contao-mp_forms's Issues

mp_forms + password

Hello, first time I am posting an issue, so please be patient if there is something wrong with it. I am using Contao 4.4.53 and installed mp_forms for a multipage registration process. On my first form page there is a simple checkbox, on the second page are four inputs and on the last page there is a registration like form with password and confirmation. I can get through until the last page and if I enter everything correctly in the shown inputs and hit the submit button, the last page shows up again, there are no values in my input fields and error messages are shown with text like "please enter a value...". Is this fixable in the foreseen future?

Hidden fields are not set in $_SESSION['MPFORMSTORAGE'] by Contao 4.6.6 and MP-Forms 3.0.8

I am working on a multipage form and using this extension version 3.0.8 with Contao 4.6.6.

What I am doing:
I use a few custom fields (HTML-Code) that I override with jQuery and pass them to the hidden fields (i change the values and put it on hidden fields).
The form has 4 steps and I want to display the entered data in step 3 before the form sent.
I read the issues and saw that this issue is already open #21
The Problem:
Now I'm using $_SESSION['MPFORMSTORAGE']['formID']['steps'] to see the pasted data, but the hidden fields are empty.

Result:
These value from hidden field are unfortunately not available. If I use input type text instead of hidden fields, then the values are available.

It' is a bug or is this extension not compatible with contao 4.6?

Thank you very much for your support.

AJAX steps/submit/Progress

Feature request:

I need to use mp_forms with ajax or with your plugin ajaxform.
Would you like to help add this feature?

I could offer part of the current projects budget.

Plugin does not create page break on Contao 4.4.1

Hello,

I use the plugin on a Contao 4.4.1 installation, but the form element does not create a page break. I inserted two page break elements in my form, but they simply are not inserted. There are no additional elements in the page source code.

Is there any known fix to this problem?

Upload-Felder leeren sich beim zurückgehen

Hallo zusammen,
wir nutzen ein mehrseitiges Formular und haben folgendes Problem mit den Dateiuploads:

Im vorletzten Step haben wir Dateiuploads, im letzten Step die Übersicht der Formularfelder.
Wenn der Besucher nun in der Übersicht sieht, dass er "irgendwo" einen Fehler hat, zum Beispiel in Step 3, dahin springt und diesen behebt, sich dann wieder zum letzten Step (Übersicht) klickt, gehen die Uploads verloren. Im vorletzten Step sind die Uploadfelder leer. Somit wird auch keine Datei in die DB geschrieben oder versendet. Die Dateien werden korrekt hochgeladen, sind also im Filesordner zu finden.

Übersehe ich eine Einstellung? Wie kann der Upload erhalten bleiben, wenn mal in den Steps zurück geht und dann per "weiter" wieder bis zum Ende geht?

Vielen Dank für eine Rückmeldung!

Contao Version 4.13.6
Mehrseitige Formulare Version 4.2

keine Funktion

Hallo,
ich habe unter Contao4.4.36 das Modul in Version 3.0.8 installiert. Im Formular habe ich die Einstellung "step" so belassen. Wenn ich ein neues Element "Seiten-Umbruch" platziere und die Felder für zurück und Senden befülle sehe ich zwar im Backend das Feld ##Page Break## aber im Frontend hat sich nichts verändert. Weder die nachfolgenden Felder sind weg noch gibt es an der Stelle einen vor und Zurückbutton. Auch im Quelltext ist an der Stelle nichts.

File attachments broken after 3.0.4

The file attachments are not submitted after Version 3.0.4. I use Leads, MP Forms and Conditionalform Fields in combination. When i switched back to version 3.0.4 everything works fine. When i look in the commits i'm wondering why all fixes for issue #9 are removed in 3.0.5?

Upgrade-Hinweis von Version 4 auf 5 ergänzen

Moin!

Mir ist aufgefallen, dass beim Upgrade von Version 4 auf 5 bei den Inserttags nicht mehr der ID-Name zugelassen ist.

Vorher: {{mp_forms::calculator::step::current}}

wobei calculator die ID des Formulars ist. Das Ergebnis:

Uncaught PHP Exception InvalidArgumentException: "Could not load form ID "0"." at /html/contao/vendor/terminal42/contao-mp_forms/src/FormManager.php line 377 {"exception":"[object] (InvalidArgumentException(code: 0): Could not load form ID \"0\". at /html/contao/vendor/terminal42/contao-mp_forms/src/FormManager.php:377)"} []

In Version 5: {{mp_forms::5::step::current}}

Vielleicht könnt ihr noch einen Hinweis in die UPGRADE.md aufnehmen oder die Verwendung des ID-Feldes wieder berücksichtigen.

Weiterleitung auf Folgeseite

Teilweise funktioniert der Seitenwechsel nicht 100%ig. Jetzt komme ich z.B. ganz normal von Seite 1 auf Seite 2, aber anschließend lädt Seite 3 ewig und Chrome bringt mir folgende Fehlermeldung:
Fehler 310 (net::ERR_TOO_MANY_REDIRECTS): Zu viele Umleitungen.

Habe die Extension real_url im Einsatz, aber ich kann mir kaum vorstellen das es daran liegt, sonst würde der switch von Seite 1 auf 2 schon nicht klappen.

Enter triggers back submit button

Pressing "enter" while being inside an input field triggers the submit button.

In contao-mp_forms the back button is triggered, which is also a button of type submit.

Keep form fields array key intact

I am using Contao Hook, prepareFormData. When I install contao-mp_forms, the 3rd argument passed to the hook function $fields which originally has array keys is removed.

mp-form

Pages always marked as active

Hello,

I am not sure if this is an error on my side but I want to check it with you. I am using Contao 4.4.57 for testing and I installed your extension.

I created a form in the form generator and added the steps module into a page, so I can see the steps of the form. My form includes the following element list:

  • HTML-Code
  • Explanation
  • Page Break
  • HTML-Code
  • Grid-Start
  • Textfield
  • Textfield
  • Grid-Stop
  • Textfield
  • Textfield
  • Select
  • HTML-Code
  • Checkbox
  • Page Break
  • Radio Button
  • Page Break
  • HTML-Code
  • Page Break

So in total I have 4 steps. Now when reaching the first step of the form, I see Step 1/3/4 marked as active. I already deleted my cache, but didn't work. When I make every element within the page breaks invisible except the ones from the first step, only the first step is marked as active. I can display the HTML-code element before the last page break, still Step 1 active but when I display the radio button in the third step, I see Step 4 marked as active. If I make any form element in Step 2 visible, then Step 3 and 4 is marked as active.

When every element is visible and I go to the second Step, Step 2/3/4 is marked as active. On step 3, step 3/4 is active and on step 4 only step 4.

Do you have an idea what's wrong here?

Show data of all steps before submitting

Is it possible to show all data entered in the previous steps? This way the user could confirm it before finally submitting the form.

I already tried using {{post::*}} and $_SESSION['FORM_DATA'] but both seem to get filled only after the form is submitted.

Step Parameter falsch

Ich habe mp_forms unter Contao 4.13.0 installiert.
Wenn ich auf die "Weiter" Schaltefläche klicke, steht in der URL nicht step=2#form, sondern ?step=f93fdf6cb60e434cd4657a77d92d017f#form

mp_forms does not submit file attachements

mp_forms does not submit file attachements. The entry is missing in the session $_SESSION['MPFORMSTORAGE‘].

Label:

//...
  [description] => Test file
  [upload_file] => File upload
)

Submitted:

//...
  [description] => This is a test
)

no saving by pressing "back" button

When pressing the "back" button the values not getting saved. The "next" button work.
Testet on version 3.5.27 and 4.4.1. mp_forms version 3.0.3.

Is there a way to save values on pressing the "back" button? Or is it not supported jet?

Thanks a lot for this great extension!!!

Dateiupload und Notification Center

Erst einmal danke für die großartige Erweiterung!
Es scheint ein Problem in Verbindung mit dem Notificaton Center zu geben: In einem mehrseitigen Formular ist ein Dateiupload-Feld enthalten. Die hochgeladene Datei soll via NC als Anhang einer Benachrichtigung gesendet werden. Also in der Benachrichtigung über "Dateianhänge via Tokens". Der Token ##form_upload## (wobei "upload" der Name des Upload-Feldes ist) hat jedoch keine Auswirkung, die Datei wird nicht an die Benachrichtigung angehängt. Entfernt man den PageBreak, so dass das Formular nur noch einseitig ist, greift der Token.

Mehrfachabsenden unterbinden

Hallo Toflar
Sorry, dass ich hier auf Deutsch schreibe.
Besten Dank für die Entwicklung von mp_forms. Ich habe einen kl. Wunsch für ein Feature.

Mich stört es, dass es mit dem jetzigen Modul möglich ist, das Formular mehrfach abzusenden. Nach dem Absenden des Formulars wird der User auf die Bestätigungsseite weitergeleitet. Soweit alles klar. Jetzt ist es aber möglich via Browser-Zurück-Navigation (window.history.go(-1)) zurück ins Formular zu springen und so ein Mehrfachabsenden des Formulars einzuleiten.

Würde es nicht Sinn machen, im letzten Step via processFormData-Hook die entsprechenden Felder in der Session zu löschen?

Der Benutzer würde dann beim Versuch zurückzuspringen automatisch zu step 1 des Formulars weitergeleitet und müsste die Eingaben von vorn betätigen.

Vielen Dank für deine/eure super Arbeit.

Liebe Grüsse

Marko

Do not use global namespaces in type constraints

The type constraints for function arguments in MPFormsFormManager.php point to the old global-namespaced Contao classes.

For example \Widget instead of Contao\Widget:

private function checkWidgetSubmittedInCurrentStep(\Widget $widget)
{

This unfortunately crashs when using custom widgets that actually extend from Contao\Widget. Any objections changing this? BC?

Checkbox with Standard Option resets when going back steps

I noticed that a checkbox, which is declared as Standard-Option will always be active, as soon as I return to its step of the Form, even if it is deactivated in process.

The Value is saved correctly though, if I go through the form without retracing steps, it works fine.

Tested with:
terminal42/contao-mp_forms 5.0.1
Contao 4.13.20

Summary values are not updated

Contao: 4.13.5
MP-Forms: 4.4.0

Steps to reproduce:
Backend:

  1. add field on page 1
  2. add summary on page 2 with ##mp_forms_debug##

Frontend:

  1. go to page 1, add value, press submit to go to page 2
  2. go back to page 1 and change value
  3. press submit to go to page 2

Result: the value hasn't changed

Contao 4.5.7 - Fehlermeldung

Ich bekomme unter Contao 4.5.7 eine Fehlermeldung, sobald ich auf "Formulargenerator" klicke. PHP Version 7.1 auf einem vServer von Hostingwerk.

[2018-04-05 14:19:13] app.CRITICAL: An exception occurred. {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Type error: preg_match() expects parameter 2 to be string, null given at /var/virtual/user/public/customer/vendor/contao/core-bundle/src/DataContainer/PaletteManipulator.php:220)"} []

Sobald mp_forms deinstalliert ist, kann ich wieder in den Formulargenerator.
Weitere installierte Erweiterungen:

        "madeyourday/contao-rocksolid-antispam": "^2.0",
        "madeyourday/contao-rocksolid-custom-elements": "^2.2",
        "jrgregory/m17-sticky-backend-footer": "^2.0",
        "contao-bootstrap/bundle": "^2.0",
        "christianbarkowsky/tabcontrol": "^3.0",
        "delahaye/dlh_googlemaps": "^2.3",
        "terminal42/contao-easy_themes": "^2.2",
        "bugbuster/contao-cron-bundle": "^1.3",
        "fipps/contao-rssimport-bundle": "^4.0",
        "terminal42/contao-leads": "^1.4"```

A back bouton ?

Everything is in the subject ;-) There could be a back button two.
Thanks

Brackets in select menus delete all input in form and email

As discussed with Yanick at the CK2017:

I have created a 3 page form with mp_forms.

On the first page I have a select menu containing brackets in the value and description fields:

bildschirmfoto 2017-06-17 um 15 59 36

When I fill in the fields of page 1 and select "Endkunden (B2C)" and go further to page 2, fill in the next fields and for example go then again back to page 1, I notice that all previously inserted fields are now empty. That means that mp_forms can not handle the brackets in the select menu.

Furthermore then no field values of page 1 are submitted to notification center. The submitted email contains all fields of page 2 and 3, but all fields values of page 1 are also empty.

I made another two tests:

  • Choosing "Fachhandel" in the select menu does not lead to the deletion of all fields of page one and the following email via the notification center also contains the value of the select menu.

  • A form containing no mp_forms but a select menu with brackets does Contao handle the form right.

Defined steps are not available

Hello guys,
I get an incomprehensible error when I try to get to the second page of my mp_form ... My logfile throw the following error: "Step "x" is not available!". Interesting abut that is, every time it throws the error, a different step-number is logged (from 4 to 122137 and every number in between :D). I only have two pages created, so I have two pagebreaks in usage. One to divide the two pages and the other at the very end.
Do you get any idea why this error shows up?

[...] request.INFO: Matched route "tl_page.3". {"route":"tl_page.3","route_parameters":{"_token_check":true,"_controller":"Contao\\FrontendIndex::renderPage","_scope":"frontend","_locale":"de","pageModel":"[object] (Contao\\PageModel: {})","parameters":"","_route":"tl_page.3"},"request_uri":".../kontakt?step=122137d1a05f11dcfbb4cc27109199fe","method":"GET"} []
[...] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
[...] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "Step "122137" is not available!" at .../vendor/terminal42/contao-mp_forms/MPFormsFormManager.php line 142 {"exception":"[object] (InvalidArgumentException(code: 0): Step \"122137\" is not available! at .../vendor/terminal42/contao-mp_forms/MPFormsFormManager.php:142)"} []

Field validation prevents next step when using contao-conditionalformfields

For realy complex form both of your extensions contao-mp_forms and contao-conditionalformfields are great! Thank you for that!

Now I'm in trouble with the following form-setup

Form:

  • Radiobutton-Menu "radio"
  • - Radio Button with value "1"
  • - Radio Button with value "2"
  • Fieldsset 1 with condition $radio == '1'
  • - Textfield A required
  • Fieldsset 2 with condition $radio == '2'
  • - Textfield B required
  • pagebreak

In this case I'm stuck at the first step because:

  • with radio=1 Textfield B throws an error because it is empty and vis versa
  • with radio=2 Textfield A throws an error because it is empty.

Is there any way to get both extension working together?

Nach Installation kann Install Tool nicht mehr aufgerufen werden

@Toflar
terminal42/contao-mp-forms ist schon mal recht hilfreich, hat bis jetzt auch immer super funktioniert, doch nun nach der Installation mit Contao Manager funktioniert das Install Tool nicht mehr (das heisst wenn ich nach der Installation auf Install Tool klicke geht zwar ein neuer Tab auf, aber es wird direkt auf das BE Login weitergeleitet).

Ich hab auch schon probiert das Install Tool manuell mit dev.meinedomain.tld/contao/install aufzurufen (Browser Cache usw. gelöscht), aber auch da ist das gleiche Problem -> Ich betätige die Enter Taste nach Eingabe von dev.meinedomain.tld/contao/install und es wirde direkt wieder weitergeleitet auf das BE Login.

Kannst Du das irgendwie reproduzieren (im Einsatz habe ich die Contao 4.4.9) und mir eventuell sagen wie ich das beheben kann ?

multiple form submissions

If the submit button "back" or "continue" is clicked fast multiple times, the form is successfully submitted just as many times.
This happens until the server answers to the first click.

If on the last step, the form is also saved in Contao – if saving is setup.
But in this case only the first "click" saves the form with complete data.
On further clicks only the last step data is submitted.

To solve this for now, I temporary added some JS to disable the buttons after the first click.

form.querySelectorAll('button').forEach( el => {
            el.disabled = true;
        });

But I think this should also be catched somehow in the backend.

Label is missed in the Page break form field

May be I am just missing something really obvious, but...

The docs say:

Note that by default steps will just be named Step x in every language. The Page break form field label field will be used for the navigation if you provide it.

The problem is – the "Page break" form field palette doesn't have label field. If I edit it directly in the database, everything works as expected.

Zurück-Button + Wertänderung wirkungslos

Ich nutze mp_forms und conditionalformfields in Kombination und konnte damit ein herrlich komplexes Formular aufbauen. Allerdings bin ich jetzt über ein Problem gestolpert:

Feld mit Radio-Menü (ja/nein)
-> Bei "ja" wird ein Fieldset eingeblendet
-> Bei nein wird nichts einblendet
// PAGE BREAK
-> Wenn vorher "ja" gewählt wurde, wird Fieldset X mit ein paar Feldern eingeblendet
-> Wenn vorher "nein" gewählt wurde, wird einfach nur ein Text eingeblendet
// PAGE BREAK

Soweit, so gut...

Wenn ich aber auf der zweiten Seite den zurück-Button drücke und mich beim Radio-Menü umentscheide, "ja" auswähle (und dann Werte in die Felder des dann erscheinenden Fieldsets eintrage), hat das nach dem Pagebreak keine Wirkung.

Ich habe auf der zweiten Seite zum Prüfen mal ein verstecktes Feld eingebaut, das mir den Session-Wert ausgibt - in der php Datei über

$formDataArray = $_SESSION['MPFORMSTORAGE']['1']['1']['submitted'];
echo $formDataArray['value'];

Da kommt nur "nein" an, der Wert wird nicht geändert.

Ich hoffe, das war verständlich und ist irgendwie lösbar.

No attachement when mp_forms is installed (but not used)

I have installed notification_center and leads. Both works fine with file-upload. but when mp_forms is installed (i didn't used it) there where no attachment in the mail, no path in the mail and no field with the uuid ore the path in leads. I just disabled mp_forms and it works fine for me.
(I don't need mp_forms here so I am fine with this)

Inserttags with steps not working with contao-ajaxform & mp_forms

I have integrated a multi-page form via contao-ajaxform. This works very well so far. Only the output of the inserttags ({{mp_forms::<form id>::step::numbers}})is not updated. Is this a known technical limitation or is there something that needs to be considered during the implementation?

  • MP-Forms: 4.2.1
  • contao-ajaxform: 1.1.2
  • Contao 4.9.16

Manuelles Zurückspringen

Hallo
Ist es gewollt, dass bei manuellem zurückspringen die Formularfelder geleert sind?

Hintergrund:
Ich würde gerne auf der letzen Seite die eingetragenen Formulardaten auflisten, jeweils mit einem Link zum zurückspringen. Es wäre praktisch, wenn die Felder dann noch ausgefüllt wären.

Improve the way a valid mp_form is determined

Currently it's only valid if the very last form field is a page switch form field.
This causes issues with e.g. grid elements.

We should improve that. The only thing that really matters is that there is no regular submit button field used.

no attachements via notification_center

I know there are already several related closed issues.

  • A multipage form sends attachments if the core send-via-email procedure is used #9
  • A singlepage form (no PageBreaks and a regular submit) sends attachments just as fine and you can replace the sending procedure with notification-center without problems #20
  • If you use contao-mp_forms in combination with contao-notification_center a file-upload wont be send whatsoever.
    Putting the file-input on the last page (like suggested in the forum) doesn't help either.
    I don't see a string-representation of the filename in the e-mail-text nor any attachment.

Feel free to move this issue to the contao-notification_center if it needs to be fixed there atm i just don't know how to debug this any further.

Eigenes Template nicht wählbar ?

Hallo,

mit C4.9 und neuester mp_forms Version, lässt sich kein anderes Template im "Pagebreak" wählen... es steht nur das standard Template zur Verfügung.

Error file upload widget and mandatory attribute

it is not possible to move to the next step if you have an upload field as mandatory and this is not the last step - the file is loaded on the server, but there is always an error message that the file is missing...

e.g. is this a solution: set hack before validate the widget - works at me...
https://github.com/terminal42/contao-mp_forms/blob/master/MPFormsFormManager.php#L434

    public function validateField(FormFieldModel $formField, $step)
    {
// ....
+        // Special hack for upload fields because they delete $_FILES and thus
+        // multiple validation calls will fail - sigh
+        if ($widget instanceof \uploadable && isset($_SESSION['FILES'][$widget->name])) {
+            $_FILES[$widget->name] = $_SESSION['FILES'][$widget->name];
+        }
        
        $widget->validate();

        // HOOK: validate form field callback
        if (isset($GLOBALS['TL_HOOKS']['validateFormField']) && is_array($GLOBALS['TL_HOOKS']['validateFormField'])) {
            foreach ($GLOBALS['TL_HOOKS']['validateFormField'] as $callback) {

                $objCallback = System::importStatic($callback[0]);
                $widget = $objCallback->{$callback[1]}($widget, $this->getFormId(), $this->formModel->row(), $form);
            }
        }

        // Reset fake validation
        if ($fakeValidation) {
            Input::setPost($formField->name, null);
        }
        
-        // Special hack for upload fields because they delete $_FILES and thus
-        // multiple validation calls will fail - sigh
-        if ($widget instanceof \uploadable && isset($_SESSION['FILES'][$widget->name])) {
-            $_FILES[$widget->name] = $_SESSION['FILES'][$widget->name];
-        }

        return !$widget->hasErrors();
    }

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.