• ResolvedPlugin Contributor MatKus

    (@matkus2)


    Hello.

    Using this plugin on server with PHP 7.2 and latest wordpress causes error.

    The problem is function loadTextDomain in language.php file and is caused by line 34, that looks like this:

    if (self::load(apply_filters('plugin_locale', get_locale()))) {

    Problem is missing parameter for apply_filter.
    In PHP before 7.1 it could be ignored, but 7.1 throws an error in case of missing argument.

    In my case changing it to:
    if (self::load(apply_filters('plugin_locale', get_locale(),''))) {
    fixed problem, but I’m not sure what really should be the that parameter.

    • This topic was modified 5 years, 8 months ago by MatKus.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor pewgeuges

    (@pewgeuges)

    Hi @matkus2,

    The WP Code Reference does not require more parameters:

    https://developer.ww.wp.xz.cn/reference/functions/apply_filters/

    PHP 7.3 does not throw that error AFAIKS.

    Anyway, glad that you’ve got a fix, and thanks for sharing. I’ve just added your code to the bug fixes in the footnotes plugin.

    • This reply was modified 5 years, 7 months ago by pewgeuges.
    • This reply was modified 5 years, 7 months ago by pewgeuges.

    I think it’s not always called, so it does not throw that error always, probably this function is called only if you have some multilanguage addon installed, in my case it was not thrown until i’ve installed MapsMarker.

    https://www.php.net/manual/en/migration71.incompatible.php

    Plugin Contributor pewgeuges

    (@pewgeuges)

    I’m trying MapsMarker Pro for that purpose, after the free Leaflet Maps Marker went unchallenged, and it throws that fatal error until the empty argument is added as you advise.

    Thanks a lot! I’ve duly sourced your contribution in language.php(34).

    And thanks for the link to the documentation. (It just shows how PHP is intentionally moved farther away from lenience.)

    Plugin Contributor pewgeuges

    (@pewgeuges)

    Fixed in footnotes 2.0.0.

    Thanks again!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Error (missing parameter) if using PHP 7.1 or later’ is closed to new replies.