• Resolved misterixas111

    (@misterixas111)


    Hi, today Im updated polylang plugin, and after this some warning apeared on website, everywhere where are used get_field acf (Advanced custom fields plugin) functions.

    call_user_func() expects parameter 1 to be a valid callback, class 'PLL_Model' does not have a method 'get__language' in wp-content/plugins/polylang/include/model.php on line 401

    https://www.ads-software.com/plugins/polylang/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Chouby

    (@chouby)

    Hi!

    It seems that there is a misuse of an internal function of Polylang. However, it seems that it is not coming from ACF. I just downloaded it and did not find any Polylang function in ACF code.

    Hello,

    I’ve got the same problem. Any idea what to do about it?

    Thread Starter misterixas111

    (@misterixas111)

    for example if I am using second ACF function:

    get_field('some_field', 'options')

    then, warnings will be…

    I have the same issue. The problem arises from this addition to ‘polylang/include/model.php:401’:

    if (empty($translations) && $lang = call_user_func(array(&$this, 'get_'.$type.'_language'), $id))

    when the $type parameter is neither ‘post’ nor ‘term’. The comment of the function states that only ‘post’ or ‘term’ are supported, but this is nowhere checked. A violation of this comment happens with the Advanced Custom Fields plugin. Here is a stack trace that illustrates the problem:

    #0 PLL_Model->get_translations(acf, 136) called at [wp-content/plugins/polylang/include/model.php:379]
    #1 PLL_Model->get_translation(acf, 136, en) called at [wp-content/plugins/polylang/include/wpml-compat.php:173]
    #2 icl_object_id(136, acf, 1, en) called at [wp-content/plugins/advanced-custom-fields/core/fields/_functions.php:352]
    #3 acf_field_functions->load_field(, field_5536aca143e36)
    #4 call_user_func_array(Array ([0] => acf_field_functions Object (),[1] => load_field), Array ([0] => ,[1] => field_5536aca143e36)) called at [wp-includes/plugin.php:213]
    #5 apply_filters(acf/load_field, , field_5536aca143e36) called at [wp-content/plugins/advanced-custom-fields/core/api.php:278]
    #6 get_field_object(my_field, 177, Array ([load_value] => 1,[format_value] => 1)) called at [wp-content/plugins/advanced-custom-fields/core/api.php:214]
    #7 get_field(my_field, 177)

    Plugin Author Chouby

    (@chouby)

    @jx73

    Yes you are right, it’s not checked and was not an issue in previous versions. I will improve this.To be exact, it works with ‘post’, ‘term’ and any *translated* post type or taxonomy.

    Debugging this in the same time as you, I noticed that ACF is calling icl_object_id with ‘acf’ as post type, while ‘acf’ is not a “translated” post type. That’s why it breaks.

    Thread Starter misterixas111

    (@misterixas111)

    Okay, we will wait for plugin update. Can i close this topic?

    Plugin Author Chouby

    (@chouby)

    I just uploaded a new development version which should fix this warning (1.7.4.1).
    https://downloads.www.ads-software.com/plugin/polylang.zip

    Can i close this topic?

    I am not sure you can close it but you can mark it as resolved if it is ??

    Great, thank you for the fast resolution! ??

    We had the same Problem and now ist gone. Thank you very much for your great help. :-)))

    @chouby : Can u guess how long it takes to get this fix distributed via usual WP update? ??

    Thanks in advance

    Thread Starter misterixas111

    (@misterixas111)

    I’m too awaiting for official plugin update ??

    Or you can just use the link Chouby provided and overwrite the polylang folder using FTP. Or if you don’t have that/dont know how just delete the plugin then reinstall via new plugin > upload zip.

    The official update hasn’t gone through for me either but I just threw it in via FTP ??

    Just for the record though if you delete the old one and upload the zip file provided above, you’ll have to set it up all over again. Fortunately I hadn’t started using it but all of my languages are gone.

    Plugin Author Chouby

    (@chouby)

    Just for the record though if you delete the old one and upload the zip file provided above, you’ll have to set it up all over again.

    Never use the red delete link in the plugins list table as, as stated in the message, the plugin will delete all its data (this is the way all plugins should offer to delete all their data).

    For a manual upgrade, you just have to delete the plugin via FTP and upload the new version.

    @chouby

    Thanks for that Chouby. It works great now!

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘After update apeared warnings’ is closed to new replies.