Support » Plugin: Translate Multilingual sites - TranslatePress » CRITICAL Uncaught Error: Call to a member function is_available() on null

  • Resolved supportadtribes

    (@supportadtribes)


    When calling this function:
    $translation = $translator->process_strings(array($value),$target_language);

    And making sure that the variable $value is a string, not empty and not null and making sure the variable $target_language contains a valid value we still get this critical error every now and than:

    2022-03-28T12:14:47+00:00 CRITICAL Uncaught Error: Call to a member function is_available() on null in /home/clients/edb42069f88ddac51e5a43b0da358b52/sites/bollybellyshop.com/wp-content/plugins/translatepress-multilingual/includes/class-translation-render.php:1365

    Could you tell us how to prevent this from happening?

Viewing 9 replies - 1 through 9 (of 9 total)
  • antanast

    (@antanast)

    Any news on this?

    • This reply was modified 8 months ago by antanast.
    Plugin Support Alex

    (@alexcozmoslabs)

    Hi,

    Make sure that your code never runs earlier than the hook ‘plugins_loaded’ priority 3. The object TRP_Machine_Translator is not available sooner than that.
    We’re going to adjust that code, in one of the next versions of the plugin, too to avoid throwing a fatal error and instead just not use machine_translator.

    Thread Starter supportadtribes

    (@supportadtribes)

    Thanks for your reply. Our plugin is not calling that hook.
    When do you expect the new version to be released?

    Plugin Support Alex

    (@alexcozmoslabs)

    Hi again,

    We release a new version once every two weeks. The next release will be the next week, but w don’t guarantee that this improvement will be available in the next version. However, you can consult our Changelog to see what improvements each version brings once it is released: https://wordpress.org/plugins/translatepress-multilingual/#developers.

    Thread Starter supportadtribes

    (@supportadtribes)

    The new release pushed out yesterday did not fix the issue, still seeing this in our client logs:

    2022-04-05T09:56:40+00:00 CRITICAL Uncaught Error: Call to a member function is_available() on null in /home/clients/edb42069f88ddac51e5a43b0da358b52/sites/xxx.com/wp-content/plugins/translatepress-multilingual/includes/class-translation-render.php:1365
    Stack trace:
    #0 /home/clients/edb42069f88ddac51e5a43b0da358b52/sites/xxx.com/wp-content/plugins/woo-product-feed-elite/classes/class-get-products.php(4462): TRP_Translation_Render->process_strings(Array, 'sv_SE')
    #1 /home/clients/edb42069f88ddac51e5a43b0da358b52/sites/xxx.com/wp-content/plugins/woo-product-feed-elite/woocommerce-sea.php(5073): WooSEA_Elite_Get_Products->woosea_get_products(Array)
    #2 /home/clients/edb42069f88ddac51e5a43b0da358b52/sites/xxx.com/wp-includes/class-wp-hook.php(307): woosea_elite_continue_batch('9Oo0RlqtVe6T93a...')
    #3 /home/clients/edb42069f88ddac51e5a43b0da358b52/sites/xxx.com/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    #4 /home/clients/edb42069f88ddac51e5a43b0da358b52/sites/xxx in /home/clients/edb42069f88ddac51e5a43b0da358b52/sites/xxx.com/wp-content/plugins/translatepress-multilingual/includes/class-translation-render.php on line 1365

    any updates?

    Thread Starter supportadtribes

    (@supportadtribes)

    None unfortunately, we are still waiting for TranslatePress to push out a new release with a fix for the issue.

    Plugin Support Alex

    (@alexcozmoslabs)

    Hi,

    Just want to let you know that our developers fixed this issue in the latest version of our plugin, v.2.2.5

    Thread Starter supportadtribes

    (@supportadtribes)

    Perfect, thanks for the heads-up! We will test and see if the issue at hand has been resolved.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘CRITICAL Uncaught Error: Call to a member function is_available() on null’ is closed to new replies.