• Resolved portlandian

    (@portlandian)


    I’m using the shortcode like this:

    [pods name="stage" form="1" fields="stage_location,stage_contact_name,stage_contact_email]

    I expected that to create a blank form that when filled out and submitted would create a new entry for the post type. What happens instead is that the form is pre-populated with fields from a previous entry, and if I click the ‘Save’ button it saves over that entry.

    Something wrong with my shortcode, or am I expecting the wrong behavior?

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • I was confronted with the same issue when I updated Pods to the latest version. After a bit of code digging, I figured that id parameter needs to be set to -1 for a blank form to show.

    It works for me, this is what the shortcode should look like :

    [pods name="stage" form="1" fields="stage_location,stage_contact_name,stage_contact_email id="-1"]

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    That’s a bug, we’ll take a look at the exact cause and get it resolved.

    Plugin Contributor Josh Pollock

    (@shelob9)

    This is the issue that you can track for this bug:

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

    Thread Starter portlandian

    (@portlandian)

    Setting the id to -1 did not work for me.

    Plugin Contributor Josh Pollock

    (@shelob9)

    @portlandian Can you please try updating to Pods 2.5.2 (https://pods.io/latest) and let us know if that resolves the issue or gives you an error?

    Thread Starter portlandian

    (@portlandian)

    @josh Pods 2.5.2 neither resolves the issue nor gives an error.

    I just noticed the form is pre-populated with the entry having the oldest creation date. If I delete that one it then pre-populates with the next entry having the oldest creation date.

    Thread Starter portlandian

    (@portlandian)

    OK I’ve learned a few things,

    1. In the first post, this
    [pods name="stage" form="1" fields="stage_location,stage_contact_name,stage_contact_email]

    looks like I missed a quote mark, should look like this
    [pods name="stage" form="1" fields="stage_location,stage_contact_name,stage_contact_email"]

    Oops, sorry.

    2. With the corrected shortcode, the behavior reported is still the same: rather than a blank form, the form is pre-populated with the entry having the oldest creation date.

    3. It also doesn’t matter if I use the "stage_location,stage_contact_name,stage_contact_email", using just [pods name="stage" form="1"] gives the same behavior

    4. Adding id="-1" actually does resolve it. I was mistaken because of the missing quote mark noted above.

    5. I tried in Pods 2.5.1, 2.5.1.1, and 2.5.2 and it’s all the same.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    I found the issue, will have it fixed in the next release (2.5.2), patch is pending passing a unit test, once it does I’ll merge it into the current 2.5.2 working release at https://pods.io/latest/ so expect in an hour or so.

    Thread Starter portlandian

    (@portlandian)

    Yep, that fixed it. Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Blank form for creating new entries’ is closed to new replies.