Skip to:
Content

bbPress.org

Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#2308 closed defect (fixed)

Php Warnings with bbPress 2.3 and WP 3.5.1

Reported by: nbquidditch Owned by: johnjamesjacoby
Milestone: 2.4.1 Priority: normal
Severity: normal Version: 2.4
Component: API - Feeds Keywords: has-patch
Cc:

Description

These are the PHP Warnings that are regularly being thrown up running bbPress 2.3 running on WP 3.5.1 and the Atahualpa Theme:

Apr 15, 18:44:09	 PHP Warning: Illegal offset type in /home/waterway/public_html/alrewasplan.co.uk/wp-content/plugins/bbpress/includes/common/functions.php on line 1503
Apr 15, 18:44:09	 PHP Warning: Cannot modify header information - headers already sent by (output started at /home/waterway/public_html/alrewasplan.co.uk/wp-content/plugins/bbpress/includes/common/functions.php:1503) in /home/waterway/public_html/alrewasplan.co.uk/wp-content/plugins/xml-sitemap-feed/includes/feed-sitemap-news.php on line 9
Apr 16, 05:53:54	 PHP Warning: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in /home/waterway/public_html/alrewasplan.co.uk/wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php on line 1106


Attachments (2)

2308.patch (1.6 KB) - added by alex-ye 7 years ago.
2308.2.patch (1.5 KB) - added by johnjamesjacoby 7 years ago.

Download all attachments as: .zip

Change History (13)

#1 @johnjamesjacoby
8 years ago

  • Component changed from General to Feeds
  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Atahualpa is a pretty strange theme, that has some incompatibilities with bbPress other than debug notices. That said, I'm not seeing the notices that you're seeing. Line 1503 in that file is pretty innocuous, only building an array from an existing value that's already checked to exist.

I'm closing this as worksforme, pending more information and duplication steps to trigger the notice.

#2 @Funkatronic
7 years ago

Running into this error myself and its showing up in one of my rss feeds, making it malformed xml. I just moved to a new server, so that may have triggered it

#3 @Funkatronic
7 years ago

  • Keywords needs-patch added
  • Resolution worksforme deleted
  • Status changed from closed to reopened

Found the problem:

$select_query_vars = array(
				'p'                      => false,
				'name'                   => false,
				$query_vars['post_type'] => false
			);

The code in line 1540 assumes that the query var 'post_type' will be a string; that is only one post type. If you have a more than one post type in that var as an array, it breaks the code and gives that error because you are trying to make an array the index.

Don't have a solution yet but that is the problem right there. Illegal offset type is the error given when you try use an array or object as the index of an array. In my case, I have a few custom post types in another plugin which can show up in the main feed so 'post_type' ends up being an array instead of string

#4 @netweb
7 years ago

  • Milestone set to Awaiting Review
  • Version changed from 2.3 to 2.4

#5 @alex-ye
7 years ago

Nice catch @Funkatronic ! I will work on patch now.

#6 @alex-ye
7 years ago

  • Milestone changed from Awaiting Review to 2.4.1

@alex-ye
7 years ago

#7 @alex-ye
7 years ago

can you test the patch above?

#8 @Funkatronic
7 years ago

As far as I can tell, no more errors. Don't know how I can test if the code still does what its supposed to do but it fixed the bug. Thanks.

#9 @alex-ye
7 years ago

  • Keywords has-patch added; needs-patch removed

#10 @johnjamesjacoby
7 years ago

  • Owner set to johnjamesjacoby
  • Resolution set to fixed
  • Status changed from reopened to closed

In 5122:

In bbp_request_feed_trap(), check that post type being requested is a bbPress post type before proceeding. Improves compatibility with other custom feed handlers. Props alex-ye. Fixes #2308. (2.5)

#11 @johnjamesjacoby
7 years ago

In 5123:

In bbp_request_feed_trap(), check that post type being requested is a bbPress post type before proceeding. Improves compatibility with other custom feed handlers. Props alex-ye. Fixes #2308. (2.4.1)

Note: See TracTickets for help on using tickets.