Undefined $term_id PHP notice
-
Hi,
just before outputting any ad on page, there is a PHP notice:
Notice: Undefined property: stdClass::$term_id in /srv/www/xxx/htdocs/wp-content/plugins/advanced-ads/modules/display-by-query/display-by-query.class.php on line 54Is this known issue? How to avoid this?
-
Hi andrejm,
thank you for your message. This is not a known issue and I am not able to reproduce it.
Which add-ons are you using and how does your ad setup look like?
You can also contact me directly through the Support page of the plugin (from within your Dashboard).
Thanks
ThomasOK, I’ll try to provide more info for you to reproduce, thanks for a quick reply!
Since I can’t produce it you either have a complex setup that I didn’t test before or it is a conflict with another plugin. If possible, please try to disable other plugins to test this.
Thanks
ThomasI tried to disable advanced ads addons until only core advanced ads plugin stayed active – still notice.
I then deactivated all other plugins – notice is there.
It happens both logged in/out.
Also, it seems to happen only on CPT archive pages.
$query just before the line 54 looks like this:
stdClass Object ( [labels] => stdClass Object ( [name] => Téma [singular_name] => Téma [add_new] => Pridať novýú tému [add_new_item] => Pridať novýú tému [edit_item] => Upraviť tému [new_item] => Pridať novú tému [view_item] => Zobraziť tému [search_items] => Hľadať %s [not_found] => Neboli nájdené žiadne témy [not_found_in_trash] => V koši nie sú žiadne témy [parent_item_colon] => [all_items] => Všetky Témy [featured_image] => Prezentačný obrázok [set_featured_image] => Nastaviť prezentačný obrázok [remove_featured_image] => Odstrániť prezentačný obrázok [use_featured_image] => Použiť ako prezentačný obrázok [menu_name] => Témy [name_admin_bar] => Téma ) [description] => [public] => 1 [hierarchical] => [exclude_from_search] => [publicly_queryable] => 1 [show_ui] => 1 [show_in_menu] => 1 [show_in_nav_menus] => 1 [show_in_admin_bar] => 1 [menu_position] => [menu_icon] => dashicons-media-document [capability_type] => post [map_meta_cap] => 1 [register_meta_box_cb] => [taxonomies] => Array ( [0] => category [1] => post_tag ) [has_archive] => 1 [rewrite] => Array ( [slug] => longread [with_front] => [pages] => 1 [feeds] => 1 [ep_mask] => 1 ) [query_var] => longread [can_export] => 1 [delete_with_user] => [_builtin] => [_edit_link] => post.php?post=%d [name] => longread [cap] => stdClass Object ( [edit_post] => edit_post [read_post] => read_post [delete_post] => delete_post [edit_posts] => edit_posts [edit_others_posts] => edit_others_posts [publish_posts] => publish_posts [read_private_posts] => read_private_posts [read] => read [delete_posts] => delete_posts [delete_private_posts] => delete_private_posts [delete_published_posts] => delete_published_posts [delete_others_posts] => delete_others_posts [edit_private_posts] => edit_private_posts [edit_published_posts] => edit_published_posts [create_posts] => edit_posts ) [label] => Téma )What other details would help you investigate this?
Ahoj andrejm,
thank you, this was all I needed to identify the cause.
The error is not critical and should not break the plugins functionality.
It should also only be displayed if WP_DEBUG is enabled, so you are probably on a development environment.
I fix it with the next update of the plugin – maybe end of next week or later.
If you need the fix before that then please contact me directly and I will provide you with the untagged version.
Thanks again for your great help!
ThomasDakujem 😉
For the time being, I’ll just suppress the notice (you are right it only shows on dev environment) and wait for the update.
Thanks again for great support.
The topic ‘Undefined $term_id PHP notice’ is closed to new replies.