xpertbot / craft-wheelform

Craft CMS 4 Form with Database integration
MIT License
66 stars 32 forks source link

Error when using file upload field #62

Closed uksitebuilder closed 5 years ago

uksitebuilder commented 6 years ago

When using the file field in a form and a file is selected, the following error is show after submitting the form:

Class 'wheelform\controllers\BadRequestHttpException' not found

If no file is chosen the form submits correctly as expected.

uksitebuilder commented 6 years ago

Seems it was related to a volume error. Not sure why as the volumes work fine everywhere else, but changing to a different volume got rid of the error.

xpertbot commented 6 years ago

@uksitebuilder Thank you for debugging the issue. If you have any more information, please don't hesitate to let me know, I am interested in trying to see if the plugin can be smarter about issues like that.

uksitebuilder commented 6 years ago

Hi @xpertbot,

Actually, I spoke too soon.

It certainly needs looking at. Even though I changed to a different volume, no image was saved

xpertbot commented 6 years ago

@uksitebuilder Can you test without a Volume selected and make sure it's uploading the files to the email message? Once I figure out what the volume problem is. I will push a patch for it.

uksitebuilder commented 6 years ago

Tested and the email works with attached file.

xpertbot commented 6 years ago

This is working on my test environments (mostly local folders in the servers), However I added a better error message logging to hopefully have more details about the problem. V1.16.1

uksitebuilder commented 6 years ago

Thanks for checking Roger

I get the error message "The target folder provided for uploading is not valid" when selecting any Volume and trying the form

and yet, it works no problem when a user is uploading assets via the CP to any of those volumes.

Very strange. Will do some more testing

xpertbot commented 6 years ago

@uksitebuilder Can you let me know your setup? as in what type of volume you are using? as well as OS, PHP version, etc?

uksitebuilder commented 6 years ago

Tried on local dev Mamp Pro (macos) and on Production server Ubuntu 18.04

Both running PHP 7.2 and Apache 2.4.x

Volumes are all 'local' volumes

Have tried with the following folder set-up inside the web directory:

assets/gallery assets/images assets/sponsors

xpertbot commented 6 years ago

@uksitebuilder Can you set an absolute path to the folders using aliases like in the Craft3 Example? @webroot/assets/images I wonder if it's not finding the path and it doesn't know what to do. I am mostly using Craft's helpers to upload the files so these are not really "Plugin" problems.

uksitebuilder commented 6 years ago

I was already using aliases

Have now also set-up volumes.php in the config folder. Same problem still.

However, I have just tried another plugin 'Freeform Lite' and it is functioning as expected

xpertbot commented 6 years ago

Sounds good, I will take another stab at it this weekend. Thanks for the report.