• Resolved Francois Lamotte

    (@francoislamotte)


    Hello,

    After the latest update 1.4.1, the back-end is recovered.

    But there is strange behavior on the front-end where many fields coming from objects are not rendered anymore.

    The template is here :

    If you look on the the left side (dark menu) it will open => the menu displays an empty list : it counts well the objects … but nothing is displayed.

    In the center of the page, it displays different objets (image, title, …) but no others (video, … ) who are missing.

    In the array of the connected_item (that is display above on the page), it looks to a year 2525 …

    YEAR(wp_posts.post_date)='2525'

    Frankly I don’t understand why (and where this figure is coming).

    Does anyone has a clue or a way to investigate on this case?

    Thank you for your support

    http://ww.wp.xz.cn/extend/plugins/posts-to-posts/

Viewing 15 replies - 16 through 30 (of 30 total)
  • Plugin Author scribu

    (@scribu)

    Right, so it returns a ‘formation’ post.

    Therefore, only the ‘formations_to_chapitres’ query could return anything.

    Will try to set it up on my test install.

    Thread Starter Francois Lamotte

    (@francoislamotte)

    if you want an access or a dump … don’t hesitate. I could share something through dropbox.

    Thread Starter Francois Lamotte

    (@francoislamotte)

    Previously, every connexion was sending back something …

    maybe the way I was structuring the cascade was heretic πŸ™‚

    If you look here, on an other install WP, the page is full with objects coming from the 3 queries

    http://dev2.pointben.net/formation/iphoto-debutant

    Plugin Author scribu

    (@scribu)

    I meant the 3 new WP_Query calls at the top. They all use the same get_queried_object().

    Thread Starter Francois Lamotte

    (@francoislamotte)

    How can I differentiate them?

    I’ve seen an example with get_queried_object_id()

    I’m sorry, I’m not a dev and a poor PHP culture πŸ™‚

    Plugin Author scribu

    (@scribu)

    You don’t even use the other 2; just remove them.

    I tried to replicate your setup on WP 3.4.1 and each_connected() seems to work fine.

    Add var_dump( $chapitres->request ); after defining it. This should produce the raw SQL query.

    Thread Starter Francois Lamotte

    (@francoislamotte)

    Aaah OK, I see what you want to see.

    I’ve added a

     tag to add more readability.
    
    And you've got 2 levels : request and then the full var
    
    Here the previous URL
    
    The thing I've noted is the YEAR set up to :
    
    YEAR(wp_posts.post_date)='2525'
    
    Here is another URL with the same date published
    
    http://dev2.pointben.net/membres/formation/apercu-2

    Plugin Author scribu

    (@scribu)

    You need to upgrade to P2P 1.4.1.

    And remove $Lecons and $Videos already. I told you they’re useless.

    Thread Starter Francois Lamotte

    (@francoislamotte)

    In fact I’ve downgraded to 1.3.1 because it is worst with 1.4.1

    If you look here > on the sidebar in the dark grey area, you still got a list of item but no Title and no links …

    Here is a simple view with a complete sidebar and the list of items below.

    here on the template I’ve removed $Lecons and $Videos but I think that the structure of the code for the main template is not accurate.

    Thread Starter Francois Lamotte

    (@francoislamotte)

    Excuse me, but if I understand well (as the $Lecons and $Videos are useless), does it mean that it is not possible to handle such template?

    To display parts of every object connected in this waterfall?

    training -> chapters -> lessons -> videos

    How could I build such queries ?

    Thank you.

    Plugin Author scribu

    (@scribu)

    No, it means that you only need to call each_connected() – it will construct a WP_Query instance internally.

    I’m having the same problems as Francois, the back-end is fine but connections are missing on the front-end.

    Plugin Author scribu

    (@scribu)

    The main problem in Francois’ case was that each_connected() was outputting wrapped post objects, instead of raw post objects. This is fixed in the latest development version (1.4.2-alpha2).

    Thread Starter Francois Lamotte

    (@francoislamotte)

    Thank you very much Scribu for this update.

    Hi scribu,

    I installed the development version and still have the same problem:

    Here is my code:

    The function:

    function my_connection_types() {
    
    		p2p_register_connection_type( array(
    			'name' => 'pages_to_pages',
    			'from' => 'page',
    			'to' => 'page',
    			'reciprocal' => true,
    			'sortable' => 'any'
    	) );
    }
    add_action( 'p2p_init', 'my_connection_types' );

    Printing connected pages:

    $connected = new WP_Query( array(
      'connected_type' => 'pages_to_pages',
      'connected_items' => get_queried_object(),
      'nopaging' => true,
    ) );
    
    // Display connected pages
    if ( $connected->have_posts() ) :
    ?>
    <h3>Related pages:</h3>
    <ul>
    <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
    	<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endwhile; ?>
    </ul>
    
    <?php
    // Prevent weirdness
    wp_reset_postdata();
    
    endif;

    And i still get the error:

    Warning: Could not find direction(s). in /public_html/wp-content/plugins/posts-to-posts/core/query-post.php on line 16

Viewing 15 replies - 16 through 30 (of 30 total)

The topic ‘[Plugin: Posts 2 Posts] Still missing data after 1.4.1’ is closed to new replies.