• I’ve tried to post it as bug report on the Hypestudio contact/help page (as suggested here by Dejan), but the form refuses to send (probably my browser causing this).

    So, if you turn DEBUG to TRUE in wp-config.php, you get two warning Notices for every post that WP loops through, if it has a CPT-onomy-term. (So on an Archive page that can be hundreds or thousands, on a single Post/Page that’s just two.)

    The specific notice is always:

    Notice: Trying to get property ‘term_id’ of non-object in [your_webroot]/wp-includes/post.php on line 6736
    Notice: Trying to get property ‘term_id’ of non-object in [your_webroot]/wp-includes/post.php on line 6737

    You can test this by installing a blank WP, installing the plugin, making a CPT (e.g., “Country”) via the plugin (just a name, label and apply to e.g. “post”) and making one instance of this CPT (e.g., “Australia”), then in Admin use the plugin to link the custom post “Australia” to the default “Hello World!”-post: The warning will appear when you refresh your frontpage. Deactivate plugin and the warning disappears.

    So, if you go to that post.php line from the warning and insert a var_dump(..); line or two on the variables in question, you learn from the output that CPT-onomies inserts a NULL into (line 6732) $terms = get_object_term_cache( $post->ID, $taxonomy );

    So the temporary solution (until the next update of WordPress overwrites it!) is to change line 6735 from
    if ( ! isset( $term_ids[ $term->term_id ] ) ) { (using $term != NULL && ) into
    if ( $term != NULL && ! isset( $term_ids[ $term->term_id ] ) ) {

    But editing core WP files is not the answer, clearly… I have no idea at exactly which point CPTonomy accidentally inserts the NULL and/or whether WordPress should actually always test for NULL at that point.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Dejan Markovic

    (@dejanmarkovic)

    Hi @marvinusmartianus, thank you for reporting the issue.
    I have tried to reproduce it on 2 instances and didn’t get the error.

    The only solution I see right now would be if you could make the coy of your environment with All-in-One WP Migration or BackWPup or something like that and then I can see what’s going on there.

    Thanks and have a great day!

    Dejan

    Thread Starter marvinusmartianus

    (@marvinusmartianus)

    Hi Dejan,

    I will have a look into doing that tomorrow. But a first idea: I had a similar situation with a Joomla site, when I changed from PHP7.1 to PHP7.3 — things that were fine in PHP7.1 and PHP7.2 suddenly give Warning/Notice in PHP7.3, I’m guessing because it’s stricter in checking typecasting.

    Thread Starter marvinusmartianus

    (@marvinusmartianus)

    Hello again — Here is a Dropbox link to a copy [20mb]: https://www.dropbox.com/s/f6pd1u3184774d1/site-localhost-20191022-200034bst.jpa?dl=0 — it’s .JPA (made with Akeeba Backup for WP) so you need to just put it in a folder together with Akeeba Kickstart (the kickstart.php script on its own suffices).

    As it is, it has one single user “tester” with password “tester” but you can install your own during configuration; that user has a nonsense email address; there is no personal info in the backup. For database & prefix use one that has db privileges on your system (mine was just user root with pwd root on localhost/MAMP, and prefix wp_).

    Let me know how you get on with it… If you deactivate CPT-onomies on my system the warning goes away, turn it back on it returns; the only other plugin now is AkeebaBackup so you can uninstall that as well without difference.

    I’m having the same issue. I’m using PHP 7.2.3

    I get the same issue on WP 5.3.2, php 7.3.13, the lines in post.php are now 6971 and 6972.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Minor bug: Appends a NULL to the term meta cache’ is closed to new replies.