• Notice

    get_post_language was called incorrectly in /vagrant/site/wp-content/plugins/relevanssi/lib/common.php on line 27: the call to $polylang->model->get_post_language() has been deprecated in Polylang 1.8, use PLL()->model->post->get_language() instead. Error handler

    Location

    wp-content/plugins/polylang/include/model.php:543

    Call Stack

    PLL_Model->__call()
    PLL_Model->get_post_language()
    relevanssi_wpml_filter()
    apply_filters(‘relevanssi_hits_filter’)
    relevanssi_do_query()
    relevanssi_query()
    apply_filters_ref_array(‘the_posts’)
    WP_Query->get_posts()
    WP_Query->query()
    WP->query_posts()
    WP->main()
    wp()

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Thanks for the info. Does it work if you just replace

    $polylang->model->get_post_language

    with

    PLL()->model->post->get_language

    ?

    Hey Mikko,
    I tested to switch “$polylang->model->get_post_language” to “PLL()->model->post->get_language” on line 27 in relevanssi/lib/common.php and the notice from the debugger disapered. Thanks!

    Plugin Author Mikko Saari

    (@msaari)

    Thanks, this’ll be fixed in the next version.

    Hey, Mikko, having same issue. Is there a quick work around (besides changing /lib/common.php)?

    Plugin Author Mikko Saari

    (@msaari)

    This is already fixed in the current version, so the quick workaround would be to updating to latest version.

    Hey, thanks for getting back. Still getting the error even on latest version of Relevanssi:

    Notice: get_post_language was called incorrectly in /srv/www/site.dev/current/web/app/plugins/relevanssi/lib/common.php on line 26: the call to $polylang->model->get_post_language() has been deprecated in Polylang 1.8, use PLL()->model->post->get_language() instead. Error handler in /srv/www/site.dev/current/web/app/plugins/polylang/include/model.php on line 595
    
    Notice: get_post_language was called incorrectly in /srv/www/site.dev/current/web/app/plugins/relevanssi/lib/common.php on line 26: the call to $polylang->model->get_post_language() has been deprecated in Polylang 1.8, use PLL()->model->post->get_language() instead. Error handler in /srv/www/site.dev/current/web/app/plugins/polylang/include/model.php on line 595
    
    Warning: Cannot modify header information - headers already sent by (output started at /srv/www/site.dev/current/web/app/plugins/polylang/include/model.php:595) in /srv/www/site.dev/current/web/wp/wp-includes/pluggable.php on line 1171

    Plugin Author Mikko Saari

    (@msaari)

    You’re running Relevanssi 3.5.3? The line 26 of common.php in 3.5.3 is

    if (PLL()->model->get_post_language($hit->ID)->slug == ICL_LANGUAGE_CODE) {

    so I can’t see where the $polylang->model->get_post_language() is on that line…

    Hm, I’m using composer to manage plugins, it ((https://wpackagist.org/search?q=relevanssi&type=any&search=) actually shows 3.5.4 as latest and 3.5.3 on WordPress plugins directory.

    Line 26:
    if (PLL()->model->get_post_language($hit->ID)->slug == ICL_LANGUAGE_CODE) {
    but error still says the same. Any guesses why it is so?

    Plugin Author Mikko Saari

    (@msaari)

    No idea. For starters you could start a new thread for this, as this thread is already marked resolved.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘PHP Notice – lib/common.php on line 27 – deprecated in Polylang 1.8’ is closed to new replies.