Title: Http Headers + WPML = Crash
Last modified: August 22, 2020

---

# Http Headers + WPML = Crash

 *  [danvy](https://wordpress.org/support/users/danvy/)
 * (@danvy)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/http-header-wpml-crash/)
 * Hi,
    Once again I get a crash when I use HTTP Headers with WPML, editing an Access-
   Control-Allow-Origin rule. It Works when I deactivate WPML.
 * Here’s the message :
    Fatal error: Uncaught Error: Call to a member function 
   switch_to_locale() on null in /var/www/html/wp-includes/l10n.php:1665 Stack trace:#
   0 /var/www/html/wp-admin/includes/misc.php(132): switch_to_locale(‘en_US’) #1/
   var/www/html/wp-content/plugins/http-headers/http-headers.php(1181): insert_with_markers(‘/
   var/www/html/….’, ‘HttpHeaders’, Array) #2 /var/www/html/wp-content/plugins/http-
   headers/http-headers.php(670): update_headers_directives() #3 /var/www/html/wp-
   includes/class-wp-hook.php(289): http_headers_option(‘_transient_time…’) #4 /
   var/www/html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)#
   5 /var/www/html/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #6 /var/
   www/html/wp-includes/option.php(625): do_action(‘added_option’, ‘_transient_time…’,
   1598132862) #7 /var/www/html/wp-includes/option.php(884): add_option(‘_transient_time…’,
   1598132862, ”, ‘no’) #8 /var/www/html/wp-content/plugins/wpml-string-translation/
   classes/upgrade/class-wpml-st-upgrade.php(225): set_transient(‘wp in /var/www/
   html/wp-includes/l10n.php on line 1665
    -  This topic was modified 5 years, 9 months ago by [danvy](https://wordpress.org/support/users/danvy/).

Viewing 1 replies (of 1 total)

 *  Thread Starter [danvy](https://wordpress.org/support/users/danvy/)
 * (@danvy)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/http-header-wpml-crash/#post-13298691)
 * Workaround :
    – Deactivate WPML String Translation – Do you modifications to 
   HTTP Headers – Reactivate WPML String Translation

Viewing 1 replies (of 1 total)

The topic ‘Http Headers + WPML = Crash’ is closed to new replies.

 * ![](https://ps.w.org/http-headers/assets/icon-128x128.png?rev=1413576)
 * [HTTP Headers](https://wordpress.org/plugins/http-headers/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/http-headers/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/http-headers/)
 * [Active Topics](https://wordpress.org/support/plugin/http-headers/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/http-headers/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/http-headers/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [danvy](https://wordpress.org/support/users/danvy/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/http-header-wpml-crash/#post-13298691)
 * Status: not resolved