• Resolved Vinit

    (@vinitpatil)


    Hi,

    I’m using Pods to have huge amount of custom fields.

    I’m trying to update the image field. but it’s not updating properly or storing random file

    Please check below screenshot for your reference.

    I’m using Version 3.3.9.2

    Also in console i’m seeing below error.

    Please help me fix this

    • This topic was modified 6 days, 3 hours ago by Vinit.
    • This topic was modified 6 days, 2 hours ago by Vinit.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support pd

    (@pdclark)

    Are you using the Pods Form block, Pods shortcode with form=1, or a different form system?

    See https://docs.pods.io/displaying-pods/pods-shortcode/

    Thread Starter Vinit

    (@vinitpatil)

    I’ve just created custom fields and post type using Pods and displaying them using PHP code.

    Screenshots for your reference –

    Plugin Support pd

    (@pdclark)

    ->field( 'project_image' ); will return the unmodified data, often an array or object, or the ID of an attachment or relationship.

    Use $project_image = $pod->display( 'project_image' ); if your intention is to have the image or images formatted for output on your behalf.

    See: https://docs.pods.io/code/pods/display/ (Which is different than ->field())

    If you have output formatting requirements different than the default output of ->display(), either check the field options to output as a gallery, or iterate the data returned by ->field(), which will usually be an array of attachment IDs.

    See:

    When working with fields which are images, there is also do notation for quick references to image thumbnail sizes, but be aware that when working with a field which allows multiple files, you will likely receive an array of values rather than a single value:

    See: https://docs.pods.io/code/pods/field/field-notation-options/ (For example ->display( 'project_image._img.sizename' ); …which will behave differently for a single-image field versus a multiple-image field, and again will behave differently for ->field() versus ->display()

    Plugin Support pd

    (@pdclark)

    Aside, noticing in your screenshot that there are more than 700 fields on a single post type…

    While that’s not causing the reported issue, and may be working fine for your use case at the moment, it important to note that fields on one post type will all appear in one administrative page load…

    Therefore, if a human is expected to load your data architecture with a browser, at some point the browser will crash, depending on the user’s resources (Consumer Laptop? Phone?)…

    Unless the architecture is meant for a machine, or the WP Admin edit screens are not being used, a user interface design which specifies “the user should see seven hundred choices on this screen” usually indicates new possibilities may require consideration.

    Thread Starter Vinit

    (@vinitpatil)

    As you mentioned, i’ll note down display method for images.

    Meanwhile, there’s a bug for images part specially this huge amount of fields in Pods.

    Plugin Support pd

    (@pdclark)

    Thanks, if you have found a separate reproducible bug separate from use of the API, please file details on the GitHub issues. If there is a sepecific item you need help with understanding, open a new ticket in the forum here.

    But overall, please differentiate between a bug in the plugin versus a bug in custom code you are writing with various expectations in contrast to reality documented in the open code or published examples. It may also be helpful to use error_log, print_r, or var_dump to inspect the contents of variables being worked with in PHP.

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.