Skip Navigation

Resolved

Reported for: WPML Multilingual CMS 4.5.3

Resolved in: 4.5.4

Overview of the issue

If you format your URL to use a different domain per language, you may see the following fatal error after updating to WPML 4.5.3:

PHP Fatal error: Uncaught Error: Call to a member function add_hooks() on null in …/wp-content/plugins/sitepress-multilingual-cms/classes/action-filter-loader/class-wpml-action-filter-loader.php:154

Workaround

Our developers are aware of this situation and it was fixed in WPML 4.5.4.

Alternatively, in case you can’t update your WPML, and only after making sure you have a full back up of your site:

  1. Edit file /plugins/sitepress-multilingual-cms/classes/url-handling/wpml-wp-login-url-converter-factory.php on line 17
  2. Replace:
  3. ? [ $wpml_url_converter->get_wp_login_url_converter( $sitepress ), $rules ]
    

    with

    ? array_filter( [ $wpml_url_converter->get_wp_login_url_converter( $sitepress ), $rules ] )
    

3 Responses to “After updating to WPML 4.5.3 there is a PHP Fatal error: Uncaught Error: Call to a member function add_hooks()...”

  1. The issue is not fully resolved in WPML 4.5.4. With 4.5.4. I get the following error:

    Fatal error: Uncaught Error: Class ‘WPML\Language\Detection\CookieLanguage’ not found in /home/ppcsbeta/domains/petplan.csbeta.nl/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/wpml_load_request_handler.php:18 Stack trace: #0 /home/ppcsbeta/domains/petplan.csbeta.nl/public_html/wp-content/plugins/sitepress-multilingual-cms/sitepress.php(281): wpml_load_request_handler() #1 /home/ppcsbeta/domains/petplan.csbeta.nl/public_html/wp-settings.php(357): include_once(‘/home/ppcsbeta/…’) #2 /home/ppcsbeta/domains/petplan.csbeta.nl/public_html/wp-config.php(148): require_once(‘/home/ppcsbeta/…’) #3 /home/ppcsbeta/domains/petplan.csbeta.nl/public_html/wp-load.php(50): require_once(‘/home/ppcsbeta/…’) #4 /home/ppcsbeta/domains/petplan.csbeta.nl/public_html/wp-admin/admin.php(34): require_once(‘/home/ppcsbeta/…’) #5 /home/ppcsbeta/domains/petplan.csbeta.nl/public_html/wp-admin/network/admin.php(13): require_once(‘/home/ppcsbeta/…’) #6 /home/ppcsbeta/domains/petplan.csbeta.nl/public_html/wp-admin/network/plugin in /home/ppcsbeta/domains/petplan.csbeta.nl/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/wpml_load_request_handler.php on line 18

    • Sorry, my bet. We are working with GIT and the case change was not recognized by GIT. So the change was not committed to the repository. To solve this I deleted the folder wp-content/plugins/sitepress-mulitlangual-cms/classes/Language and committed that change. Then I added the folder with lower case and the content and committed that change. Then the problem was solved.