We were going trough the regular maintenance of our web site (updating core and plugins) when we noticed a PHP Warnings related to BP Edit plugin, in our stage production. Please take a look at the pictures below.
Error is “Warning: A non-numeric value encountered” and this warning should be visible in any development environment with PHP 7.1+
Both reported lines have the same code:
$allowed_time = bp_editable_activity_get_setting( ‘activity_allowed_time’ ) * 60;
Seems like problem is that ‘activity_allowed_time’ will not be recognized as definite int. I have solved this problem by adding implicit conversion to parameter, changing a lines to this
$allowed_time = (int)bp_editable_activity_get_setting( ‘activity_allowed_time’ ) * 60;
Could you make these changes (both on lines 17 and 100) and include it in the next update so the warnings would go away. Or you can handle this is any other way that you find appropriate.
Bdw, plugin is fantastic, good job! 🙂
The topic ‘ [Resolved] PHP Warning within BuddyPress Editable Activity plugin’ is closed to new replies.