• Resolved mairaforesto

    (@mairaforesto)


    Hello, I’m experiencing the following error and wanted to know if you could help me. Create a template to show a logo-type image that each user can upload to their PDF form.
    The code is as follows:

    https://ibb.co/4KV9znN

    It even works very well and uploads images with the option of the “images of entries” form, the problem arises if the user does not upload any images, instead of leaving the blank field producing a critical error on the web.

    What should be done so that the space remains blank if the user does not upload an image?

    I attach a link with the images of the problem

    This is how it works if an image is loaded:

    https://ibb.co/G0pJFQS

    https://ibb.co/BycSX72

    This is what it does when an image is not uploaded to the form

    https://ibb.co/nnFCMjD

    Since you are very grateful

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Hi @mairaforesto,

    Thanks for providing detailed information about the problem you are having.

    You can either make your File Upload field required, or, in the PDF template, you can check the file upload value is not empty before trying to output it:

    if ( ! empty( $form_data['field']['Logotipo']['url'] ) ) {
       //output your file here
    } else {
       //output something when no file uploaded
    }

    All the best with your project. ??

    • This reply was modified 11 months, 3 weeks ago by Jake Jackson. Reason: fix sentance structure so it is not ambiguous
Viewing 1 replies (of 1 total)
  • The topic ‘Image upload causes critical error’ is closed to new replies.