• Resolved Chouby

    (@chouby)


    Hi Mikko Saari,

    A user reported a fatal error at line 15 in inc/common.php when using both Relevanssi and Polylang.

    Here is the line:

    if (function_exists('icl_object_id') && $sitepress->is_translated_post_type($hit->post_type)) {

    Polylang defines the function ‘icl_object_id’ as part of the WPML API compatibility but does not define the $sitepress object. So either you can modify the line to

    if (function_exists('icl_object_id') && !function_exists('pll_is_translated_post_type') && $sitepress->is_translated_post_type($hit->post_type)) {

    or even easier, just make this test after the next one (so Polylang before WPML)

    Frédéric

    https://wordpress.org/plugins/relevanssi/

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

    (@msaari)

    Thanks, will fix.

    Plugin Author Mikko Saari

    (@msaari)

    Actually, I just noticed the next version will already fix this, as the if clause has been changed to

    function_exists('icl_object_id') && !function_exists('pll_is_translated_post_type')

    in the first place and the $sitepress if clause has been moved inside that. So, anybody having this problem can just install the development version to get rid of the problem.

    Thread Starter Chouby

    (@chouby)

    OK thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Proposed fix for a fatal error with Polylang’ is closed to new replies.