BuddyDev

Search

[Resolved] PHP Warning within BuddyPress Editable Activity plugin

  • Participant
    Level: Enlightened
    Posts: 34
    Milan Latinovic on #25342

    Hi everyone,

    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.

    https://ibb.co/ZXrRJSD
    https://ibb.co/MRr6zt6

    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! 🙂

    Thanks!
    Milan

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #25343

    Thank you Milan.
    Your typecasting is the right approach we should have used. I will update the plugin.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 34
    Milan Latinovic on #25350

    Hi Brajesh,

    No problem, I enjoy working with your plugins and contributing when I can.
    I have one more question but I will create a separated ticket for it.

    Thanks and all best!
    Milan

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #25352

    Thank you Milan.

The topic ‘ [Resolved] PHP Warning within BuddyPress Editable Activity plugin’ is closed to new replies.

This topic is: resolved