#7392 closed defect (bug) (fixed)
PHP 7.1 compat
Reported by: | DJPaul | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 2.8.3 | Priority: | highest |
Severity: | normal | Version: | |
Component: | Core | Keywords: | |
Cc: | tom@…, support@… |
Description
There are problems - on the website, and also in the unit tests.
Attachments (2)
Change History (32)
#2
@
8 years ago
The tests are failing because of a quirky bug in PHP 7.1 to do with gallery shortcode parsing. The tests on our end are probably not actually any use, but I'm going to talk to Core and let them know, and see what they want to do.
#5
@
8 years ago
The 2.8 branch has a fix in place for the "admin_bar_menu" PHP fatal error that occurs on PHP 7.1 (r11298). We are waiting on fixes in WordPress (#WP39277) to fix a very-likely-but-not-confirmed issue in the Activity Stream (in the media extractor, and shortcode parsing, code); this is also breaking a unit test. (Aside: I don't know how useful this failing test is for BuddyPress, but it has proven this regression in WordPress itself).
#6
@
8 years ago
For those reading via email, I edited my last comment to fix some important dates/versions.
#7
@
8 years ago
But we ought to backport that fix into 2.7 branch, and ship that (once we know there isn't anything else to fix on our ends -- so we need to wait for WordPress 4.7.x).
This ticket was mentioned in Slack in #buddypress by netweb. View the logs.
8 years ago
#9
@
8 years ago
In r11391:
Build: allow tests on Travis-CI's PHP 7.1 to fail temporarily.
There is an upstream bug in WordPress causing fatal errors for one of our tests in PHP 7.1.
It has not been fixed yet, and as I suspect the test itself is better suited for WordPress than BuddyPress (BuddyPress ought to assume that basic shortcode parsing is functional), I think this is a worthwhile tradeoff for now.
See https://core.trac.wordpress.org/ticket/39277 and #7392
Props netweb
FYI: The commit missed the ticket for some reason /shrug
#11
@
8 years ago
- Priority changed from normal to highest
BP won't load on PHP 7.1 because of an issue with the way our components set up the admin bar. See http://php.net/manual/en/migration71.incompatible.php "The empty index operator is not supported for strings anymore". bp_setup_admin_bar()
does the following:
do_action( 'bp_setup_admin_bar' );
which WordPress, since the introduction of WP_Hook
, converts to $hook->apply_filters( '', $args )
- the first ''
is an empty string passed as the missing "value" in a do_action()
call. This means that all instances of 'bp_setup_admin_bar'
are passed an empty string, overriding the $wp_admin_nav = array()
in the function definition. When components try adding items to the array ($wp_admin_nav[] = ...
), a fatal is thrown.
The smallest fix I can see is to change bp_setup_admin_bar()
so that it does this instead:
apply_filters( 'bp_setup_admin_bar', array() );
But this changes the semantics a bit - our 'bp_setup_admin_bar' callbacks don't actually use the value returned from the filter, which makes it somewhat misleading to call it a "filter". Another option is to have an explicit check in each 'bp_setup_admin_bar'
callback:
if ( '' === $wp_admin_nav ) { $wp_admin_nav = array(); }
or to remove the default $wp_admin_nav
from the function definition altogether, and rely on a local variable. But neither of these will fix the problem in third-party plugins.
I'm glad to spin this off into another ticket - it's important enough that it should be fixed in the next minor release.
#15
@
8 years ago
- Milestone changed from Future Release to 2.8.1
Found another one: You cannot close a notice on PHP 7.1 if you don't already have closed notices, for similar reasons ([]
operator on a string). Patch incoming.
#18
@
8 years ago
- Milestone changed from 2.8.1 to 2.8.2
I think I found another odd one, but it can wait.
#19
@
8 years ago
Log in WP_DEBUG mode
PHP Notice: Trying to get property of non-object in /site_path/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php on line 884
WordPress 4.7.2
BuddyPress 2.8.1
PHP 7.1.2-3+deb.sury.org~xenial+1
https://airat.biz
#20
@
8 years ago
@airathalitov Thanks for the report. Do you have a complete stack trace on this? The error you're reporting is not PHP 7.1-specific, and suggests that a theme or plugin is doing something abnormal outside of an activity loop.
#21
@
8 years ago
- Cc support@… added
- Version set to 2.8.2
Got this error on accessing View All Forums option from Dashboard
PHP Fatal error: Uncaught Error: [] operator not supported for strings in /home/***/wordpress/wp-content/plugins/bbpress/includes/forums/functions.php:1800
System Information
Wordpress: 4.7.3
BBPress: 2.8.2
#22
@
8 years ago
@saiashirwad - Your report is related to bbPress and not BuddyPress.
It looks like bbPress has fixed things up in their development branch:
https://bbpress.trac.wordpress.org/ticket/3031
This ticket was mentioned in Slack in #buddypress by hnla. View the logs.
8 years ago
#27
@
8 years ago
- Owner set to boonebgorges
- Status changed from new to assigned
Per June 7 dev chat. Thank you :D
In 11298: