• Resolved authentico

    (@authentico)


    When I add a File / Image / Video field to my custom pod…

    In the settings for the field under the File / Image / Video Options tab…

    If you have File Uploader > Upload only (Plupload) selected…

    There is an option to set Custom Upload Directory, which has the help tooltip: “Magic tags are allowed for this field. The path is relative to the /wp-content/uploads/ folder on your site.

    How are you supposed to use Magic Tags in this field?

    No matter what I try, I can’t get the Magic Tags to render. When I try something like {@id} it is replaced with nothing.

    For example, if I have it set as “custom_folder/post_{@id}”, the file will be uploaded to the folder “custom_folder/post_”.

    What Magic Tags are allowed here?

    I would like to do something like “/u_{@username}/p_{@id}” (where @id I’m assuming is the post/page id…?)

    Any suggestions?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter authentico

    (@authentico)

    Also, one more issue with the Upload only (Plupload).

    In File / Image / Video Options I have Upload Limit > Single File.

    Issues:

    1. Even though I have a file already uploaded in the field, the “Upload” button is still visible (expected: this button should be hidden, until the user clicks “X” to delete the existing uploaded image).
    2. When the user clicks this “Upload” button and selects a file, it is uploaded and stored on the web server. But, the pod does nothing with this new file that was uploaded (does not overwrite the existing upload, does not display it in the list of available images/files). But the file does get uploaded to the /wp-content/uploads folder, wasting space on the server.

    Additional issues:

    1. When user clicks “X” to delete an uploaded file/image, it is removed from the Pod, but the file continues to exist on the web server (expected: file should be removed from the web server at some point).
    Plugin Support Paul Clark

    (@pdclark)

    • Try {@ID} instead of {@id}.
    • Are you using a frontend form, or a backend form? If a frontend form, the upload should be associated with a new post, unless you specify an ID or slug for your form, in which case it would associate with the given post.
    Thread Starter authentico

    (@authentico)

    I’m logged into /wp-admin EDITING a new “post” (post already exists), within the custom post type I created using Pods.

    {@ID} did not help either.

    I did some debugging.

    The issue seems to be: when I upload a photo using File / Image / Video field using Plupload, the API request which uploads the file, it does not have any $post information accessible.

    I’m also seeing PHP errors:

    [30-Apr-2023 20:36:14 UTC] PHP Warning: Undefined property: stdClass::$item_id in \wp-content\plugins\pods\classes\fields\file.php on line 1189
    [30-Apr-2023 20:36:14 UTC] PHP Warning: Undefined property: stdClass::$item_id in \wp-content\plugins\pods\classes\fields\file.php on line 1244

    Those seem to be trying to get $params->item_id, where $params references the Ajax file upload request parameters.

    But it looks like none of the request parameters have a value item_id anywhere.

    • This reply was modified 1 year, 6 months ago by authentico.
    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @authentico

    This might be a bug in the Plupload uploader. Could you report this at GitHub and provide all information asked so we can reproduce?

    pods.io/submit

    Closing here in favor of GitHub.

    Cheers, Jory

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Magic Tags not working in “Custom Upload Directory”’ is closed to new replies.