Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Attempt to read property name on bool #830

Merged
merged 2 commits into from
Feb 22, 2024
Merged

[Fix] Attempt to read property name on bool #830

merged 2 commits into from
Feb 22, 2024

Conversation

mebishalnapit
Copy link
Collaborator

This PR includes:

  • PHP warning to be logged into debug log file if (AnsPress) Breadcrumbs widget is used in the (AnsPress) Question List Top widgetized area and viewing the individual tag page
  • Fixes the display of the single tag item in the single tag page and Tags item in the tags archive page for the (AnsPress) Breadcrumbs widget
  • Fixes the condition to check for currently viewing page is either a tag page or tags archive page

PHP Warning: Attempt to read property name on bool in /addons/tags/tags.php on line 447
Current tag page name display in the breadcrumb
Condition to check for the current page is either tag or tags page
@mebishalnapit mebishalnapit linked an issue Aug 11, 2023 that may be closed by this pull request
@@ -443,7 +443,7 @@ public function page_title( $title ) {
$title = ap_opt( 'tags_page_title' );
} elseif ( is_question_tag() ) {
$tag_id = sanitize_title( get_query_var( 'q_tag' ) );
$tag = get_term_by( 'slug', $tag_id, 'question_tag' ); // @codingStandardsIgnoreLine.
$tag = $tag_id ? get_term_by( 'slug', $tag_id, 'question_tag' ) : get_queried_object();
$title = $tag->name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mebishalnapit Add a if check here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rahularyan Added.

addons/tags/tags.php Show resolved Hide resolved
@rahularyan rahularyan merged commit a3a679c into master Feb 22, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attempt to read property name on bool
2 participants