SOLVED: Form action "Create post" - duplicate post when media is chosen

Hi,
I have a form in pop-up. I want to create a media file in media library by this form.

What do I have?

The popup

What’s the problem?

When I confirm the form, it uploads the file and creates duplicate “post”/element in media library:

The wrong one:

The correct one:

Hi Leo,
Thanks so much for your report!

Unfortunately, I can’t replicate the issue. Assumingly, some of your settings are not correct.
Let me show you my setup, which works perfectly fine:

I have two fields: a text field (for the post title) and a file field (with “save in media library enabled”).

For the create post action, my settings look like this:

The file is not mapped in your screenshot, as far as I can see, which might lead to this issue. In my case, it’s an ACF field called “File attachment”, which is assigned to my “movie post type”.

Best regards,
timmse

Hi,
thanks for fast reply.

In Create post action I have Post type = Media file not another one, because I only want to upload the file from front-end (something like RapidShare). I don’t want create post (blog post or something).

Ok, please change the form action to custom and ensure “Save in media library” is enabled for the file field, as shown in my first screenshot.

That should work fine :slight_smile:

That works, but that’s not what I wanted. :slight_smile:

I want to let user to upload file, set the title of the file and set the media category (for media categories I’m using Admin and Site Enhancements by Bowo).

In my form settings there is a problem that form saves 2 objects - “post” and media file. The “post” has the correct media category and correct title. The second object is the media file without any other attributes from the form. From my point of view there is a problem in form action Create post with Post type = media and my Field mapping.

My (exported) template is here, to give you full “context”. :slight_smile:

{
  "id": 2656,
  "name": "pridani-souboru",
  "title": "Přidání souboru",
  "date": "2025-10-15 07:52:51",
  "date_formatted": "15. 10. 2025",
  "author": {
    "name": "-",
    "avatar": "https://secure.gravatar.com/avatar/8bc8e75e407fce43a3c20dbd2f4669f00910633cb73a651f76b3a4e05c39f4f4?s=60&d=mm&r=g",
    "url": "anonymized"
  },
  "permalink": "anonymized",
  "thumbnail": null,
  "bundles": [],
  "tags": [],
  "type": "popup",
  "content": [
    {
      "id": "adcmak",
      "name": "section",
      "parent": 0,
      "children": [
        "xmaxlz"
      ],
      "settings": []
    },
    {
      "id": "xmaxlz",
      "name": "container",
      "parent": "adcmak",
      "children": [
        "uocaxd"
      ],
      "settings": []
    },
    {
      "id": "uocaxd",
      "name": "form",
      "parent": "xmaxlz",
      "children": [],
      "settings": {
        "fields": [
          {
            "type": "text",
            "label": "Název souboru",
            "placeholder": "Název souboru",
            "id": "begmsk",
            "required": true
          },
          {
            "type": "textarea",
            "label": "Popis",
            "placeholder": "Popis souboru",
            "id": "3395c3"
          },
          {
            "type": "file",
            "label": "Soubor",
            "placeholder": "Your Name",
            "id": "uqkfxe",
            "fileUploadLimit": "1",
            "fileUploadStorage": "attachment",
            "fileUploadAllowedTypes": "pdf,jpg,jpeg,png,gif,bmp,doc,docx,xls,xlsx,ppt,pptx,txt,csv,zip,rar,7z,mp3,mp4,avi,mov,mkv",
            "required": true
          },
          {
            "type": "email",
            "label": "Email",
            "placeholder": "Email",
            "id": "brbfzh",
            "isHoneypot": true
          },
          {
            "type": "select",
            "label": "Category",
            "id": "sfdnzs",
            "value": "verejne"
          }
        ],
        "submitButtonStyle": "primary",
        "successMessage": "Soubor byl úspěšně nahrán.",
        "emailSubject": "Contact form request",
        "emailTo": "admin_email",
        "fromName": "anonym",
        "emailErrorMessage": "Submission failed. Please reload the page and try to submit the form again.",
        "htmlEmail": true,
        "mailchimpPendingMessage": "Please check your email to confirm your subscription.",
        "mailchimpErrorMessage": "Sorry, but we could not subscribe you.",
        "sendgridErrorMessage": "Sorry, but we could not subscribe you.",
        "horizontalAlignFields": "center",
        "submitButtonWidth": "100",
        "redirectTimeout": "2000",
        "redirect": "/soubory/",
        "actions": [
          "redirect",
          "create-post"
        ],
        "createPostTitle": "begmsk",
        "createPostContent": "3395c3",
        "createPostTaxonomies": [
          {
            "id": "osokax",
            "taxonomy": "asenha-media-category",
            "fieldId": "sfdnzs"
          }
        ],
        "createPostType": "attachment"
      },
      "themeStyles": []
    }
  ],
  "templateType": "popup",
  "globalVariables": [
    {
      "name": "task-divider-size",
      "value": "1rem",
      "id": "ukzoee"
    },
    {
      "id": "xedmqx",
      "name": "meta-data-font-size",
      "value": "1.4rem"
    }
  ]
}

Check, I understand and created an internal task. We’ll update this thread once it’s fixed :v:

1 Like

We fixed this issue in Bricks 2.2 RC, now available as a manual download in your account (see changelog).

Please let us know if you are still experiencing issues.

As with any pre-stable release, please do not use it on a production website. It is intended for testing in a local or staging environment only.