WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
[resolved] Still missing data after 1.4.1 (31 posts)

  1. Francois Lamotte
    Member
    Posted 1 year ago #

    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://wordpress.org/extend/plugins/posts-to-posts/

  2. Francois Lamotte
    Member
    Posted 1 year ago #

    In enabling

    define('WP_DEBUG', true)

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

  3. econofast
    Member
    Posted 1 year ago #

    I am seeing the same problem - I haven't checked with debug on, but rolling back to 1.3 shows all of my connections on front end and admin, while 1.4/1.4.1 both only show them on the admin side.

  4. Francois Lamotte
    Member
    Posted 1 year ago #

    Oh good idea ... i've searched on my computer and found back an 1.3.1 version.

    Previously I was rolling back with 1.2... but without success.

    I'll wait until the 1.4.1 is updated :-)

  5. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    Francois, showing us the rendered template doesn't help much. Show us the PHP code behind it (using pastebin and preferably trimmed of the irrelevant parts).

  6. Francois Lamotte
    Member
    Posted 1 year ago #

    Hi Scribu,

    Thank you for your comment :

    The body part (trimmed) is here.

    Tell me if you want a version without that indentation (it is difficult to read it online).

    The sidebar part is here

    If you need more details or anything else don't hesitate to ask it.

    Regards,

    François

  7. nnelson
    Member
    Posted 1 year ago #

    I was getting this error as well with 1.4.1, and it turned out that the connected_type name was wrong or missing.

  8. Francois Lamotte
    Member
    Posted 1 year ago #

    Another strange behavior that I can't explain, from the rollback from 1.4.1 to 1.3.1, is that the newest posts have a strange behavior.

    Here is an "old" post : where connexion are displayed on 2 templates (sidebar + page)

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

    And here is a "new" post (created after the update/roll-back) :

    http://dev2.pointben.net/membres/formation/apercu

    On that page only the sidebar display the connexion, but the core of the page doesn't show up anything.

    This is the same code, the same kind of connexion in the backend, ...

  9. Francois Lamotte
    Member
    Posted 1 year ago #

    Hi Scribu,

    I know that you already giving a lot of free support. I'm stuck here with my problem above and I don't know how to handle it. Just a little bit stressed because that part of the site needs to be delivered next week.

    How could I track / debug that kind of error?

    Thank you very much for your answer.

    Regards

    F

  10. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    Francois, as always, I'm also going to need the p2p_register_connection_type() calls.

  11. Francois Lamotte
    Member
    Posted 1 year ago #

    Hello Scribu,

    Here they are on pastebin

  12. Francois Lamotte
    Member
    Posted 1 year ago #

    in that template I use

    formations_to_chapitres

    lecons_to_chapitres

    videos_to_lecons

    p2p_register_connection_type( array(
                            'name' => 'videos_to_lecons',
                            'from' => 'video',
                            'to' => 'lecon',
                            'reciprocal' => true, // the relation has no hierarchy
                    ) );
    p2p_register_connection_type( array(
                    'name' => 'lecons_to_chapitres',
                    'from' => 'lecon',
                    'to' => 'chapitre',
                    'reciprocal' => true, // the relation has no hierarchy
                    'sortable' => 'any',
            ) );
    p2p_register_connection_type( array(
                    'name' => 'formations_to_chapitres',
                    'from' => 'formation',
                    'to' => 'chapitre',
                    'reciprocal' => true, // the relation has no hierarchy
                    'sortable' => 'any'
            ) );
  13. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    Right; what about get_queried_object()?

    Does it return a post object, something else or null?

    Add var_dump( get_queried_object() ); before the WP_Query calls.

  14. Francois Lamotte
    Member
    Posted 1 year ago #

    You could see it here :

    http://dev2.pointben.net/membres/formation/apercu

    object(stdClass)#4716 (25) { ["ID"]=> int(332) ["post_author"]=> string(1) "4" ["post_date"]=> string(19) "2012-08-20 12:20:14" ["post_date_gmt"]=> string(19) "2012-08-20 12:20:14" ["post_content"]=> string(0) "" ["post_title"]=> string(13) "Apercu (Lion)" ["post_excerpt"]=> string(144) "Un petit outils très pratique pour voir vos images, pour lire vos documents PDF ou autre, mais également pour les annoter, transformer, signer" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(6) "apercu" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-08-21 10:03:00" ["post_modified_gmt"]=> string(19) "2012-08-21 10:03:00" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://dev2.pointben.net/membres/formation/apercu" ["menu_order"]=> int(0) ["post_type"]=> string(9) "formation" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["ancestors"]=> array(0) { } ["filter"]=> string(3) "raw" }

  15. Francois Lamotte
    Member
    Posted 1 year ago #

    Do I have to add it for every query? As I use 3 queries?

  16. Francois Lamotte
    Member
    Posted 1 year ago #

    Ok I've pasted it 3 times.

    object(stdClass)#4712 (25) { ["ID"]=> int(332) ["post_author"]=> string(1) "4" ["post_date"]=> string(19) "2012-08-20 12:20:14" ["post_date_gmt"]=> string(19) "2012-08-20 12:20:14" ["post_content"]=> string(0) "" ["post_title"]=> string(13) "Apercu (Lion)" ["post_excerpt"]=> string(144) "Un petit outils très pratique pour voir vos images, pour lire vos documents PDF ou autre, mais également pour les annoter, transformer, signer" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(6) "apercu" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-08-21 10:03:00" ["post_modified_gmt"]=> string(19) "2012-08-21 10:03:00" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://dev2.pointben.net/membres/formation/apercu" ["menu_order"]=> int(0) ["post_type"]=> string(9) "formation" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["ancestors"]=> array(0) { } ["filter"]=> string(3) "raw" } object(stdClass)#4712 (25) { ["ID"]=> int(332) ["post_author"]=> string(1) "4" ["post_date"]=> string(19) "2012-08-20 12:20:14" ["post_date_gmt"]=> string(19) "2012-08-20 12:20:14" ["post_content"]=> string(0) "" ["post_title"]=> string(13) "Apercu (Lion)" ["post_excerpt"]=> string(144) "Un petit outils très pratique pour voir vos images, pour lire vos documents PDF ou autre, mais également pour les annoter, transformer, signer" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(6) "apercu" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-08-21 10:03:00" ["post_modified_gmt"]=> string(19) "2012-08-21 10:03:00" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://dev2.pointben.net/membres/formation/apercu" ["menu_order"]=> int(0) ["post_type"]=> string(9) "formation" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["ancestors"]=> array(0) { } ["filter"]=> string(3) "raw" } object(stdClass)#4712 (25) { ["ID"]=> int(332) ["post_author"]=> string(1) "4" ["post_date"]=> string(19) "2012-08-20 12:20:14" ["post_date_gmt"]=> string(19) "2012-08-20 12:20:14" ["post_content"]=> string(0) "" ["post_title"]=> string(13) "Apercu (Lion)" ["post_excerpt"]=> string(144) "Un petit outils très pratique pour voir vos images, pour lire vos documents PDF ou autre, mais également pour les annoter, transformer, signer" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(6) "apercu" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-08-21 10:03:00" ["post_modified_gmt"]=> string(19) "2012-08-21 10:03:00" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://dev2.pointben.net/membres/formation/apercu" ["menu_order"]=> int(0) ["post_type"]=> string(9) "formation" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["ancestors"]=> array(0) { } ["filter"]=> string(3) "raw" }

  17. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  18. Francois Lamotte
    Member
    Posted 1 year ago #

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

  19. Francois Lamotte
    Member
    Posted 1 year ago #

    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

  20. scribu
    Member
    Plugin Author

    Posted 1 year ago #

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

  21. Francois Lamotte
    Member
    Posted 1 year ago #

    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 :-)

  22. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  23. Francois Lamotte
    Member
    Posted 1 year ago #

    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
  24. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    You need to upgrade to P2P 1.4.1.

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

  25. Francois Lamotte
    Member
    Posted 1 year ago #

    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.

  26. Francois Lamotte
    Member
    Posted 1 year ago #

    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.

  27. scribu
    Member
    Plugin Author

    Posted 1 year ago #

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

  28. Twansparant
    Member
    Posted 1 year ago #

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

  29. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    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).

  30. Francois Lamotte
    Member
    Posted 1 year ago #

    Thank you very much Scribu for this update.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.