• Resolved andresgl

    (@andresgl)


    Hi there,

    I am using your plugin to change the base of my CPT.

    Instead of having

    www.domain.com/cpt-name/cpt-post-name

    I need to have the following

    www.domain.com/cpt-taxonomy-term-name/cpt-post-name

    The plugin is working fine changing the CPT base but, in some post of the CPT, the post shows the homepage of the site but having the correct url:

    www.domain.com/cpt-taxonomy-term-name/cpt-post-name

    The error log shows the following errors when I am trying to access to that post. It maintain the correct url that I need but it shows the homepage content.

    [16-Nov-2016 12:14:19 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 539
    [16-Nov-2016 12:14:19 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 540
    [16-Nov-2016 12:14:19 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 555
    [16-Nov-2016 12:14:19 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 562
    [16-Nov-2016 12:14:19 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 565
    [16-Nov-2016 12:14:19 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 539
    [16-Nov-2016 12:14:19 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 540
    [16-Nov-2016 12:14:19 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 555
    [16-Nov-2016 12:14:19 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 562
    [16-Nov-2016 12:14:19 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 565
    [16-Nov-2016 12:14:20 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 539
    [16-Nov-2016 12:14:20 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 540
    [16-Nov-2016 12:14:20 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 555
    [16-Nov-2016 12:14:20 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 562
    [16-Nov-2016 12:14:20 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 565
    [16-Nov-2016 12:14:20 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 539
    [16-Nov-2016 12:14:20 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 540
    [16-Nov-2016 12:14:20 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 555
    [16-Nov-2016 12:14:20 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 562
    [16-Nov-2016 12:14:20 UTC] PHP Notice:  Trying to get property of non-object in /public_html/wp-content/plugins/permalink-manager/permalink-manager.php on line 565

    Also I am attaching you the content of the file permalink-manager.php

    https://gist.github.com/034e16981a070f16a310309cbcf5e8e5

    Hope you can help me.

    Regards,

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi again andresgl,

    please replace your permalink-manager.php file with this code (there is a new debug function inside):
    https://gist.github.com/maciejbis/641f7f7611abe9435d21da05646cb55c

    After that please append this suffix (?debug_detect_post=1) to the URL of affected posts (where the plugin does not work correctly), eg.

    https://www.domain.com/cpt-taxonomy-term-name/cpt-post-name?debug_detect_post=1

    • This reply was modified 8 years, 4 months ago by Maciej Bis.
    Thread Starter andresgl

    (@andresgl)

    Hi @mbis

    Thank you sooo much for your help.

    Here you go the returned array in a post which is not working properly:

    Array
    (
        [original_post_id] => 110
        [original_post] => no object!
        [revision_post_id] => 
        [revision_post] => no object!
    )

    And here is the returned array of a post which is working fine:

    Array
    (
        [original_post_id] => 162
        [original_post] => WP_Post Object
            (
                [ID] => 162
                [post_author] => 1
                [post_date] => 2016-11-16 10:01:13
                [post_date_gmt] => 2016-11-16 10:01:13
                [post_content] => Post Content
                [post_title] => Post Title
                [post_excerpt] => 
                [post_status] => publish
                [comment_status] => closed
                [ping_status] => closed
                [post_password] => 
                [post_name] => Post Name
                [to_ping] => 
                [pinged] => 
                [post_modified] => 2016-11-16 10:01:13
                [post_modified_gmt] => 2016-11-16 10:01:13
                [post_content_filtered] => 
                [post_parent] => 0
                [guid] => https://mydomain.com/?post_type=seatings&p=162
                [menu_order] => 0
                [post_type] => seatings
                [post_mime_type] => 
                [comment_count] => 0
                [filter] => raw
            )
    
        [revision_post_id] => 
        [revision_post] => no object!
    )

    Thank you!

    Plugin Author Maciej Bis

    (@mbis)

    Hi @andresgl,

    it looks like there is some mismatch between the URIs saved in my plugin options and posts’ IDs.

    1. Please check if this URL works for you:
    /wp-admin/post.php?post=100&action=edit

    or “You attempted to edit an item that doesn’t exist. Perhaps it was deleted?” alert isdisplayed.

    2. Please also send me a list of your URIS (saved in my plugin options)
    /wp-admin/?debug_options=permalink-manager-uris

    Regards,
    Maciej

    Thread Starter andresgl

    (@andresgl)

    Hi Maciej

    1-

    /wp-admin/post.php?post=100&action=edit

    Yes, that URL (with the post ID 100) works (I can edit it). Also if I pass the post ID of the post are not working to that url, I can edit them.

    2-
    This is the URIS list

    https://gist.github.com/8535acb41b0502b3f1788e4e1066a543

    I guess the URI with %type% are the post I removed

    Thank you

    • This reply was modified 8 years, 4 months ago by andresgl.
    Plugin Author Maciej Bis

    (@mbis)

    Hi @andresgl,

    could you contact me via mail (contact[at]maciejbis.net) and create me a FTP account only with access to the directory where my plugin is stored /wp-content/plugins/permalink-manager/?

    Thread Starter andresgl

    (@andresgl)

    HI @mbis,

    I have send you the e-mail.

    Regards,

    Thread Starter andresgl

    (@andresgl)

    Hi @mbis,

    Did you see my e-mail? Still I have the problem ??

    Thank you,

    Plugin Author Maciej Bis

    (@mbis)

    Hi @andresgl,

    regarding our email conversation, can I close this topic or is anything else that I could help you with?

    Best Regards,
    Maciej

    Thread Starter andresgl

    (@andresgl)

    Sorry for the late answer Maciej,

    Yes. Thank you sooooo much for your help. The support experience has been amazing.

    Regards,

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘PHP Notice: Trying to get property of non-object in’ is closed to new replies.