• Resolved toraji

    (@toraji)


    Form doesn’t show name field after updating to 2.8.2.

    Here is my code.

    $fields = array('name' => array( 'label' => 'Name'));
    echo $mypod->form( $fields );

    It shows name field on 2.8.1

    2.8.3 has the same problem.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @toraji

    This is due to our new React based fields.
    You have two options:

    Include our JS code for forms:
    add_filter( 'pods_enqueue_dfv_on_front', '__return_true' );

    Or disable the newer scripts and revert to plain HTML by adding 'disable_dfv' => true.
    Example:
    $fields = array('name' => array( 'label' => 'Name', 'disable_dfv' => true));

    Cheers, Jory

    Thread Starter toraji

    (@toraji)

    Hi @keraweb

    Thank you for the reply.

    I tried the both options but the name field is still not displayed.

    Here is my code for the second option.

    $fields = array('name' => array( 'label' => 'Name', 'disable_dfv' => true));
    echo $mypod->form( $fields );

    Am I missing something?

    My Pods version is 2.8.3.

    Thanks

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    What kind of Pod is this? Is the field supposed to be post_title?

    Thread Starter toraji

    (@toraji)

    Hi @sc0ttkclark

    >What kind of Pod is this?
    This pod is Custom Post Type.

    >Is the field supposed to be post_title?
    Yes, it is.

    Plugin Author Jory Hogeveen

    (@keraweb)

    Can you please share how you instantiate the $mypod variable? What parameters are you passing to the pods() function?

    Thread Starter toraji

    (@toraji)

    Here is the code.

    if($service_id == 0){ /* New */
        $mypod = pods( 'service');
    }else { /* Edit */
        $mypod = pods( 'service', $service_id );
    }

    The field isn’t displayed whether there is $service_id parameter or not.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    Be sure to use the post_title as the field key there:

    $fields = array('post_title' => array( 'label' => 'Name', 'disable_dfv' => true));

    Also you may need to pass in ‘name’ => ‘post_title’ into that array along with the label. You won’t need to worry about disable_dfv or the filter pods_enqueue_dfv_on_front

    Thread Starter toraji

    (@toraji)

    Hi @sc0ttkclark

    I changed ‘name’ to ‘post_title’ and now the field shows up.

    I have been using ‘name’ for over 3 years.

    The sample on the official site says so as well.
    https://docs.pods.io/code/pods/form/

    It says.

    // Only show the 'name', 'description', and 'other' fields.
    $fields = array( 'name', 'description', 'other' );

    Is ‘name’ no longer supported?
    Until 2.8.1, the field is displayed.

    I would greatly appreciate it if you could put ‘name’ back into use.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    At some point our support for using aliases broke. The name example on our docs is for a different content type and I’ll be sure to update it accordingly so it matches the most common custom post type usage.

    I’ll take a look at adding alias support back in this area.

    Thread Starter toraji

    (@toraji)

    Hi @sc0ttkclark

    >I’ll take a look at adding alias support back in this area.
    That’s very kind of you.
    Thank you so much.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    This has been added to Pods 2.8.4, I’ll let you know when that’s released.

    Thread Starter toraji

    (@toraji)

    @sc0ttkclark

    Thanks a lot for your help.
    I’m looking forward to the release.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    Pods 2.8.4 went out today and it includes the fix for the issue reported here.

    Thread Starter toraji

    (@toraji)

    @sc0ttkclark

    Thank you for fixing it!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Form doesn’t show name field after updating to 2.8.2’ is closed to new replies.