Re: File Upload Feld speichert nicht korrekt in JetEngine Meta Field (funktioniert mit JetFormBuilder)

Hallo Daniele
Hallo BricksForge Support Team,

ich habe ein Kompatibilitätsproblem zwischen dem BricksForge Pro Forms File Upload Feld und JetEngine Media Custom Fields festgestellt.
Da ich auf mein Forum Eintrag noch keine Antwort erhalten habe, versuche ich auf diesen Weg

Mein Setup:

  • BricksForge Version: 3.1.6
  • JetEngine: Aktuelle Version
  • Feld-Konfiguration:
    • File Upload Field Name: new_speisekarte_pdf
    • JetEngine Meta Field: speisekarte_pdf (Type: Media)
    • Upload to Server: Aktiviert
    • Form Action: Update Post mit Meta Field Mapping konfiguriert

Problem:

Wenn eine PDF-Datei über das File Field des BricksForge-Formulars hochgeladen und abgesendet wird, wird die Datei erfolgreich in die WordPress Media Library hochgeladen, aber der Wert wird nicht korrekt im JetEngine Meta Field gespeichert bzw. nicht in einem Format, das JetEngine erkennen kann.

In den Post Meta Daten ist erkennbar, dass etwas gespeichert wird, aber das JetEngine Media Field zeigt die Datei nicht korrekt an - es sieht so aus, als wären Daten vorhanden, aber sie sind nicht richtig verknüpft/verbunden.

Was ich getestet habe:

  • :white_check_mark: JetEngine Field auf “URL” Format → Funktioniert nicht
  • :white_check_mark: JetEngine Field auf “ID” Format → Funktioniert nicht
  • :white_check_mark: JetEngine Field auf “Both (ID and URL)” Format → Funktioniert nicht
  • :white_check_mark: Field Names stimmen exakt zwischen BricksForge und JetEngine überein
  • :white_check_mark: Form Action hat korrektes Meta Field Mapping konfiguriert
  • :white_check_mark: Datei wird erfolgreich in Media Library hochgeladen
  • :white_check_mark: Alle Einstellungen mehrfach überprüft

Wichtiger Befund:

Wenn ich JetFormBuilder mit exakt derselben JetEngine Meta Field Konfiguration verwende, funktioniert der File Upload einwandfrei und speichert korrekt.
Das deutet darauf hin, dass das Problem spezifisch mit der Art und Weise zusammenhängt, wie BricksForge die hochgeladenen Dateidaten formatiert/speichert.

Technische Analyse:

Im generierten Field-Code habe ich gesehen, dass storeAsFile: true in der FilePond-Konfiguration verwendet wird.
Möglicherweise speichert BricksForge die Datei als File-Objekt statt als Attachment-ID oder URL, was JetEngine nicht interpretieren kann.

Frage:

In welchem Format speichert BricksForge hochgeladene Dateien in Post Meta? Gibt es eine spezifische Konfiguration, ein Attribut oder einen Hook, um die Kompatibilität mit JetEngines erwartetem Datenformat sicherzustellen?

Erwartetes Verhalten:

Die hochgeladene Datei sollte in einem Format gespeichert werden, das JetEngine erkennt - entweder als:

  • Attachment ID (Integer): 123
  • URL (String): https://example.com/file.pdf
  • Both (ARRAY): {"id":123,"url":"https://example.com/file.pdf"}

Aktuelles Verhalten:

Das Meta Field enthält Daten, aber JetEngine kann sie nicht korrekt interpretieren oder anzeigen.

Mögliche Lösung (Vorschlag):

Wäre es möglich, eine der folgenden Optionen zu implementieren:

  1. Option im File Upload Feld hinzufügen:
  • “Return Value Type” mit Optionen: ID / URL / Both
  • Oder Custom Attribute wie data-store-as="id" unterstützen
  1. Filter/Hook bereitstellen, um das Rückgabeformat anzupassen:
add_filter('bricksforge/forms/upload/return_value', function($value, $field_name) {
    if ($field_name === 'new_speisekarte_pdf') {
        // Konvertiere zu Attachment ID für JetEngine
        if (is_array($value) && isset($value['attachmentId'])) {
            return intval($value['attachmentId']);
        }
    }
    return $value;
}, 10, 2);
  1. Dokumentation zur JetEngine-Kompatibilität, falls es bereits eine Lösung gibt, die ich übersehen habe.

Da dies mit JetFormBuilder problemlos funktioniert, gehe ich davon aus, dass es sich um eine Datenformat-Inkompatibilität zwischen BricksForge-Output und JetEngine-Input handelt.

Könntet ihr bitte zur korrekten Konfiguration beraten oder einen Hook/Filter bereitstellen, um sicherzustellen, dass BricksForge File Uploads in einem JetEngine-kompatiblen Format speichert?

Vielen Dank für eure Unterstützung!

Beste Grüße
David

Hey :slight_smile: Please use English in the public categories. In the private support area, you are welcome to create tickets in German.

Kind regards

Hello Daniele
Hello BricksForge Support Team,

I’ve identified a compatibility issue between the BricksForge Pro Forms File Upload field and JetEngine Media Custom Fields.

Setup:

  • BricksForge Version: 3.1.6
  • JetEngine: Latest version
  • Field Configuration:
    • File Upload Field Name: new_speisekarte_pdf
    • JetEngine Meta Field: speisekarte_pdf (Type: Media)
    • Upload to Server: Enabled
    • Form Action: Update Post with Meta Field Mapping configured

Problem:

When a PDF file is uploaded through the BricksForge form and submitted, the file is successfully uploaded to the WordPress Media Library, but the value is not correctly saved to the JetEngine Meta Field, or at least not in a format that JetEngine can recognize.

In the post meta data, I can see that something is being stored, but the JetEngine Media Field doesn’t display the file correctly - it appears as if data is present, but it’s not properly linked/connected.

What I’ve Tested:

  • :white_check_mark: JetEngine Field set to “URL” format → Not working
  • :white_check_mark: JetEngine Field set to “ID” format → Not working
  • :white_check_mark: JetEngine Field set to “Both (ID and URL)” format → Not working
  • :white_check_mark: Field names match exactly between BricksForge and JetEngine
  • :white_check_mark: Form Action has correct Meta Field Mapping configured
  • :white_check_mark: File is successfully uploaded to Media Library
  • :white_check_mark: All settings verified multiple times

Important Finding:

When I use JetFormBuilder with the exact same JetEngine Meta Field configuration, the file upload works perfectly and saves correctly. This indicates that the issue is specifically related to how BricksForge formats/stores the uploaded file data.

Technical Analysis:

In the generated field code, I noticed that storeAsFile: true is used in the FilePond configuration. BricksForge may be storing the file as a File object instead of as an Attachment ID or URL, which JetEngine cannot interpret.

Question:

In what format does BricksForge save uploaded files to post meta? Is there a specific configuration, attribute, or hook to ensure compatibility with JetEngine’s expected data format?

Expected Behavior:

The uploaded file should be saved in a format that JetEngine recognizes - either as:

  • Attachment ID (Integer): 123
  • URL (String): https://example.com/file.pdf
  • Both (ARRAY): {"id":123,"url":"https://example.com/file.pdf"}

Current Behavior:

The meta field contains data, but JetEngine cannot correctly interpret or display it.

Possible Solution (Suggestion):

Would it be possible to implement one of the following options:

  1. Add an option to the File Upload field:
  • “Return Value Type” with options: ID / URL / Both
  • Or support custom attributes like data-store-as="id"
  1. Provide a filter/hook to customize the return format:

php

Copy

add_filter(‘bricksforge/forms/upload/return_value’, function($value, $field_name) { if ($field_name === ‘new_speisekarte_pdf’) { // Convert to Attachment ID for JetEngine if (is_array($value) && isset($value[‘attachmentId’])) { return intval($value[‘attachmentId’]); } } return $value; }, 10, 2);

  1. Documentation on JetEngine compatibility, in case there’s already a solution I’ve overlooked.

Since this works seamlessly with JetFormBuilder, I assume there’s a data format incompatibility between BricksForge’s output and JetEngine’s input.

Could you please advise on the correct configuration or provide a hook/filter to ensure that BricksForge file uploads are saved in a JetEngine-compatible format?

Thank you for your support!

Best regards
David