• Hello,

    When you assign an File Upload field in the Custom Fields section of a Post Data field, the custom field is saved as empty.

    After we discovered this issue, we made different tests on a blank WordPress 6.1.1 install (only Twenty Twenty-Three 1.0 + Forminator 1.22.1) and the issue persists. Our hosting is WPEngine.

    After some debugging, and trying to get the most possible information we can get for you, we discovered that this issue can be solved by editing the following:

    File: library/modules/custom-forms/front/front-action.php
    Line: 2214
    Before: if ( 'transfer' === $mode ) {
    After: if ( 'transfer' === $mode || 'upload' === $mode ) {

    This is important, because otherwise, the file_url is never passed to self::$info[‘upload_in_customfield’][ $cf_key ][‘uploads’] when the file upload is in “upload” mode; only on “transfer” mode; and that file_url is needed later in the execution.

    I hope you can implement this fix in the next version.

    Thank you very much!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @aebs90

    I hope you’re well today!

    This is a bug that’s already known to our developers and there’s a work on a permanent fix for it. I don’t have an ETA but it should be released soon with one of upcoming releases.

    As a “hot patch” for now, you can add this code as MU plugin to the site:

    https://gist.github.com/wpmudev-sls/9f1a22896e7318dd26d06872b8467419

    Note:

    1. you will need to set your own form IDs (form ID is the same number as in form shortcode) in these lines of the code

    $form_ids = array( 4126, 2910 ); //Please change form IDs to your form IDs

    and

    $form_ids = array( 4126, 2910 ); //Please change form IDs to your form IDs

    2. and in this line you’d need to replace “test_image” with the name of your custom field that you want URL to be saved to

    if ( $post_val['key'] == 'test_image' ) { //Please change test_image to your custom field name

    Kind regards,
    Adam

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @aebs90 ,

    We haven’t heard from you for several days now, so it looks like hotfix helped with the issue.

    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

    Thread Starter Aaron Barraza

    (@aebs90)

    Hello @wpmudev-support2

    It worked like a charm! Thank you!

    I just had to replace the update_field() function with update_post_meta() as we are not using ACF on this site and that caused a PHP fatal error.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘BUG: Uploaded file url not saving as Custom Field.’ is closed to new replies.