Skip to:

Opened 8 days ago

Last modified 17 hours ago

#3059 new enhancement

Non-numeric value issue

Reported by: padrenola Owned by:
Milestone: 2.6 Priority: normal
Severity: major Version:
Component: Tools - Code Improvements Keywords: commit


Version 2.6-beta-2

“Warning: A non-numeric value encountered in . . . /wp-content/plugins/bbpress/includes/forums/template.php on line 1441”

Here is line 1441 $retval = $replies + $topics;

This kind of thing is out of my knowledge base. Is it something I did, or a bad line in the install?

Change History (11)

#1 @padrenola
8 days ago

I am using 2.6-beta-2 because the 2.6 version that is promoted in my X Theme bundle lacks any functional links/tabs in the WordPress Dashboard after install.
X Theme version 4.6.4
WordPress version 4.7.2

#2 @johnjamesjacoby
7 days ago

There are improvements to make here, but... bbp_get_forum_topic_count() should always at least return an int value, and it appears like it works correctly in all cases.

I looked at _bbp_total_reply_count and _bbp_total_topic_count meta-data updates, and everything gets stored as an integer, so there isn't a case where a number-formatted value is getting passed around.

#3 @johnjamesjacoby
7 days ago

In 6289:

Queries: Return empty array if no parent ID or no post-type are passed.

See #3059.

#4 @johnjamesjacoby
7 days ago

  • Component changed from Tools - Warnings/Notices to Tools - Code Improvements
  • Keywords commit added
  • Milestone changed from Awaiting Review to 2.6
  • Priority changed from high to normal
  • Type changed from defect to enhancement

#5 @johnjamesjacoby
28 hours ago

In 6296:

Meta: Filter _count_int and enforce integer values.

Also use convenience functions for forum post counts, to ensure proper filters are ran against all meta values.

See #3059.

#6 @johnjamesjacoby
27 hours ago

In 6297:

Meta: Missed bbp_get_user_topic_count_int in r6296.

Props @thebrandonallen. See #3059.

#7 @netweb
20 hours ago

Anything else to do here before marking as fixed?

#8 @padrenola
20 hours ago

I wish any of the above made sense to me. What I know is that I still have the same problem. please see warning on this page.

#9 @johnjamesjacoby
18 hours ago

@padrenola We haven't pushed any updated beta releases yet. Are you keeping up with trunk on your own? If so, it might be easiest if I could somehow see your installation directly (if you're comfortable with that.)

This ticket was mentioned in Slack in #bbpress by thebrandonallen. View the logs.

17 hours ago

#11 @thebrandonallen
17 hours ago

@padrenola The issue you are seeing is related to how X Theme adds styling to forum topic|reply|post counts. They are filtering on all iterations of bbp_get_forum_{type}_count and bbp_get_forum_{type}_count_int, and returning the count wrapped in a span element.

This is fine for the non-integer counts, but causes the issue you are seeing when applying the same logic to the filters with the _int suffix.

Note: See TracTickets for help on using tickets.