• Resolved robbiejackson

    (@robbiejackson)


    Hi. I’ve created a post type of Walk and added a field to that post type called “gpx filename” which represents GPS track of the Walk (basically a series of lat/long coordinates in XML format in a text file with extension .gpx).
    I’ve set the field type to File / Image / Video and under Additional Field Options set Restrict File Types to Other and set Allowed File Extensions to gpx.
    However when I use this to create a Walk and click on the file button beside gpx filename, it doesn’t show me the gpx files which are in the media library. It lets me upload a gpx file and select it, but after clicking the Add File button it doesn’t appear back in the Walks pod.

    If however I set the Allowed File Extensions to gpx,pdf then I see the gpx files in the media library (as well as pdf and doc files) and I can select them ok. Uploading the file works ok. Add file works ok, and I can see the file when it puts me back to Walks.

    So I know that I can manage things this way, but it would be nice to have the finer level of file extension validation when the administrator is adding Walks. Am I missing something? Is there something else I need to do to make this work?

    I’m running pods version 2.6.7, on both my local machine (windows 10) and a server. I needed to change wp-config.php on the server to allow gpx uploads (where I set the mime type to application/gpx+xml) but nothing was needed on my localhost.

    Thanks for your help
    Robbie

    https://www.ads-software.com/plugins/pods/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Jim True

    (@jimtrue)

    This may have something to do with the upload_mimes filter for WordPress that allows you to ‘extend’ what’s allowed to be uploaded into the Media Library since Pods obeys that process, and possibly to this particular bug/enhancement request:

    https://github.com/pods-framework/pods/issues/3326

    You may need to also add it to this filter:
    https://codex.www.ads-software.com/Plugin_API/Filter_Reference/upload_mimes

    Thread Starter robbiejackson

    (@robbiejackson)

    Well if I’m not doing anything obviously wrong I do reckon it might well be a bug. It sounds very similar to the issue mentioned in issue 2031. Although that issue mentions just uploads, and I’m having a problem selecting the right sort of file from the media library as well.

    Regarding the filter – yes I had already done that.

    Plugin Contributor Jim True

    (@jimtrue)

    Media Library is pretty much out of the jurisdiction of Pods; that’s all WordPress CORE. Take Pods out of the equation (ie deactivate it and other plugins in WordPress) and see if you’re having the same issue you’re describing above (selecting the right sort of file from the media library)

    Thread Starter robbiejackson

    (@robbiejackson)

    Well I can’t really deactivate Pods, because the issue occurs whenever an administrator is filling in the fields of a Pod.

    However, we’ll be able to manage ok by just not restricting the types of files that can be selected.

    Thanks for your support.

    Robbie

    Plugin Contributor Jim True

    (@jimtrue)

    You can feel free to tack onto that particular bug report above, because I’m guessing it’s related. We don’t really perform ‘filtering’ for the Media Library, which it sounds like what you’re expecting our behavior to do. It would help to have your input into that bug report:

    https://github.com/pods-framework/pods/issues/3326

    Thread Starter robbiejackson

    (@robbiejackson)

    Thanks Jim, I did add some comments to that issue and hope it helps.

    Robbie

    Plugin Contributor Jim True

    (@jimtrue)

    Thanks I saw that and I appreciate it! ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Problem with setting specific field type of gpx file’ is closed to new replies.