file upload validation clears database join multi-select

chris.paschen

Chris Paschen
We have several groups on the form.
One group has 3 database joins rendered as Multi select dropdown.
Another group has fileuploads (several), each with a different file type restriction (epub, mobi, pdf, etc.)

If a user first goes to the drop-downs and selects some options there then goes to the file upload and selects a non-valid format (i.e. selects a .mobi file for the .epub upload element), then the error notice is displayed to the user; however, all the selections in the database join/dropdowns are removed.

I've checked the data in the table and it appears that upon the initial error notice (and dropdown clearing) it is just removing them from the drop-down selection - NOT from the actual database. However, as soon as you save the form again (this time with a proper file type) the drop-down data is removed from the table (because they were removed from the drop-down selector and then saved I'm guessing).

The problem doesn't appear to effect single-select dropdowns and we have several on various groups on the form and they are not experiencing this issue.

Also, one of these dropdowns has some validation rules applied; however, one doesn't have any validation rules and it's still being effected in the same way.
 
I'm unable to replicate this. I have a form with two joins (a checkbox and a multiselect), a couple of fields and a file upload. I have validations on the fields and the upload. The checkbox and multiselect joins retain their selections across a validation failure.

https://www.screencast.com/t/e5UDRdS0QW

-- hugh
 
Well, I now can't replicated on a clean J! install with the latest Fabrik.
I did some further testing and it isn't limited to these elements (that were already there) or to that group.
I added another databasejoin and set it up exactly like the others. I set it to pull from a different table and added it to a completely different group - to take away the possibility that some code somewhere was effecting the group, the specific elements, the datastore, etc.
I have also disabled ALL of the form plugins (including the ones that load onLoad and onBeforeProcess and onAfterProcess). And I've also disabled WIP from the global fabrik options.
All the fields are getting wiped - IF they are multi-select database joins. The single-selects are not being effected.

So I'm guessing that it is related to some custom code that has been added to the form/system.
The question is where else could any code be added that might have this effect?
I've disabled all the form plugins.
I've disabled all validation and jS for the databasejoin as well as the fileupload elements.

Is there anywhere else where code could be hiding somewhere that would have the effect of clearing the selections within a dbjoin/multiselect at the point that the validation is failing on the fileupload element?

Could some validation or JS on a different element be causing this?

Is there a way within PHP storm that I could debug this and track down where this is happening?
(I'm still not quite up-to-speed on using PHP storm for Joomla Dev yet)
 
Yes, that's exactly what you'd use PHP Storm for. Did you get xdebug enabled in your WAMPP stack?

And are you setup to do something like TeamViewer? It'd probably be easier for me to show you how, if you have any issues getting xdebug going.

BTW, I still have your site set up here, if you think the issue was present when I installed it.

-- hugh
 
Unfortunately not yet (PHP Storm/WAMP).
I must say, this is probably part of the reason more youth have no interest in coding. It takes so long and so 'bug prone' just trying to get the dev environment set up.
Not sure why a company like jetbrains can't just create one installable package that installs both PHP storm and WAMP and configures it all to work together with a xdebug.
 
After several hours of following several different docs (none of which had a very complete and concise set of instructions) and the help of one of our JUG team, I FINALLY have PHP Storm working, and I've been able to begin doing some debugging; however, I'm still not seeing anything call any custom code of my own throughout the process when it actually attempts to save (and therefore error) and clear the elements.

One other thing that we talked about in our JUG last night - could this be happening at the JS level?

Any tips on specific files to watch or how best to track potential JS issues (other than chrome and watch the sources)?
 
BTW ... Yes, this issue appears to have been present in the previous version of the site.
But still can't track it down.
 
OK, so which form?

But yes, it could be at the JS level, if some JS is somehow removing the elements prior to submit.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top