• Resolved popeating

    (@popeating)


    I have the following scenario:
    – a custom post that will be used as repeater (as advanced contenty type in its own table) named “allegato” with id 997
    – a custom post type that is using the ‘allegato’ repeater field with name ‘allegato_1’, ID: 1005, the custom post type is called “corso” and have id 125

    i saved in a custom post a couple of repeater field, the post itself have as id 617

    when i show the post on fontend im trying to display the list of “allegato” linked to it, and im using the following:

    $cid=617;
    print_r(pandarf_items_fn( array( 'name'=>'allegato_1', 'child_pod_name' => 'allegato', 'parent_pod_id' => 125, 'parent_pod_post_id' => $cid, 'parent_pod_field_id' => 1005 ),$atts, true ));

    as a debug query i got the following debug quey:
    SELECT * ,( SELECT GROUP_CONCAT( psl0_tb.related_item_id ORDER BY psl0_tb.weight ASC SEPARATOR "," ) FROMzay_podsrelAS psl0_tb WHERE psl0_tb.pod_id = "997" AND psl0_tb.field_id = "1001" AND psl0_tb.item_id = pod_tb.id GROUP BY psl0_tb.item_id ) AS author,( SELECT GROUP_CONCAT( psl1_tb.related_item_id ORDER BY psl1_tb.weight ASC SEPARATOR "," ) FROMzay_podsrelAS psl1_tb WHERE psl1_tb.pod_id = "997" AND psl1_tb.field_id = "1003" AND psl1_tb.item_id = pod_tb.id GROUP BY psl1_tb.item_id ) AS file_allegato FROMzay_pods_allegatoAS pod_tb WHERE 1=1 ANDname= 'allegato_1' ANDpandarf_parent_pod_id= 125 ANDpandarf_parent_post_id= 617 ANDpandarf_pod_field_id= 1005 ORDER BY CAST( pandarf_order AS UNSIGNED ) ASC

    but an empty array…
    what am i missing? whats wrong with my api call?
    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Coding Panda

    (@codingpanda)

    Hi @popeating

    Would you remove ‘name’=>’allegato_1’ from the code. Also, have you defined $atts? If you haven’t, would you replace it with array()? So it will be:

    $cid=617;
    print_r(pandarf_items_fn( array( ‘child_pod_name’ => ‘allegato’, ‘parent_pod_id’ => 125, ‘parent_pod_post_id’ => $cid, ‘parent_pod_field_id’ => 1005 ), array(), true ) );

    If you have defined $atts and it works, that is fine, just leave it.

    Alternatively, you could use
    pods_field( ‘allegato_1’ ); // If you are on a corso page.
    pods_field( ‘corso’, 617, ‘allegato_1’ ); // To get the data wherever you are.

    Let me know if it works.

    Best Regards

    Plugin Author Coding Panda

    (@codingpanda)

    Considered as solved.

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

The topic ‘cant make pandarf_items_fn work’ is closed to new replies.