Skip to content

Advanced Forms File Upload Issue #128

@ateufel

Description

@ateufel

Advanced Forms (Pro) seems to have issues when you are using ACF and ACF Extended to allow multi file uploads. Uploads keep diappearing if you save the form again, so each previous uploaded file gets cleared.

The solution: AF calls "acf_upload_files" from the ACF plugin directly, while instead it should call "acf_save_post" instead (according to ACF support).

core/forms/forms-submission.php/load_submission_data():

if ( isset( $_FILES['acf'] ) ) {
    $this->clear_upload_errors();
    acf_upload_files();
    $this->handle_upload_errors();
}

If you change this to the following code, everything works perfectly fine - even multi uploads in combination with ACF Extended:

if ( isset( $_FILES['acf'] ) ) {
    $this->clear_upload_errors();
    acf_save_post();
    $this->handle_upload_errors();
}

It would be nice to have this fixed in the core, so we can remove our workaround and activate Updates for Advanced Forms again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions