Error in adding feild "download file" in a Form

Permalink
I have an error : Class 'Concrete\Block\Form\FileImporter' not found -- version 5.7.2.1 How can I fixed it. In edit mode there is one answer 'no' for question Add downloaded images into set?

theana27
 
WebcentricLtd replied on at Permalink Reply
I think you mean upload.

It looks like there is a possible bug in the form block when using a file upload type field on the form.

If I'm correct you have added a form to your web page which includes a file upload field and when you go to upload a file as a website user you get the error message.

Will check if it is already logged as a bug and if not will log it.
WebcentricLtd replied on at Permalink Reply
ok - there is a temporary fix to this but it relies on having access to the filesystem.

You need to create an override for the form block controller.

Create a new folder called form under:

application/blocks

so you now have

application/blocks/form

Copy file:

/concrete/blocks/form/controller.php

to your new directory so you now have

/application/blocks/form/controller.php

open up your new controller and edit:

change the first line of code:

namespace Concrete\Block\Form;


to

namespace Application\Block\Form;


and then after the line

use Exception;


add the new line

use FileImporter;


then save. This override will let the controller use the FileImporter.
theana27 replied on at Permalink Reply
theana27
Thank you, Andy. It helped. It appear in a file manager, but not in Form Result. There is 'still file not found'. And in btFormAnswer is NULL. What must be there? I don't know. Anyway, for start is good. Thank you again.