Events Made Easy › Forums › Generic › Media and Appearance->Customize do not load fully with EME and WP-4.9.1
- This topic has 13 replies, 2 voices, and was last updated 6 years, 11 months ago by Franky.
-
AuthorPosts
-
Thu 14 Dec 2017 at 16:35 #57157AnonymousInactive
Since the upgrade to WP-4.9.1, backend links, e.g. Media and Appearance->Customise do not load when EME is activated. I am using Themegrill Spacious Pro v 2.1.5 theme (latest version).
I am using EME 2.0.11 but the problem occurs with EME versions back at least to 1.9.4. (I have not tested earlier). I guess nothing has changed in EME to cause this, but something has changed in WP during the upgrade from 4.8-4.9.
If I can run any diagnostics, please let me know and I have a test site if you want access.
Thu 14 Dec 2017 at 23:42 #57162FrankyKeymasterIf something doesn’t load, check your browser console for hints. A javascript error of some kind might explain this.
Fri 15 Dec 2017 at 11:09 #57174AnonymousInactiveI checked the browser console and the first error that gets thrown up is:
“TypeError: Language code must have format 2-3 letters and. optionally, hyphen, underscore followed by 2 more letters”, in mediaelement-and-player.min.jsI then noticed that when EME is activated the opening lines of the page HTML are:
<!DOCTYPE html>
<!–[if IE 8]>
<html xmlns=”http://www.w3.org/1999/xhtml” class=”ie8 wp-toolbar” >
<![endif]–>
<!–[if !(IE 8) ]><!–>
<html xmlns=”http://www.w3.org/1999/xhtml” class=”wp-toolbar” >whereas with EME deactivated, the <html> tag omits the “lang” attribute (set to en-GB for me)
<!DOCTYPE html>
<!–[if IE 8]>
<html xmlns=”http://www.w3.org/1999/xhtml” class=”ie8 wp-toolbar” lang=”en-GB”>
<![endif]–>
<!–[if !(IE 8) ]><!–>
<html xmlns=”http://www.w3.org/1999/xhtml” class=”wp-toolbar” lang=”en-GB”>Fri 15 Dec 2017 at 11:10 #57175AnonymousInactiveCORRECTION
I checked the browser console and the first error that gets thrown up is:
“TypeError: Language code must have format 2-3 letters and. optionally, hyphen, underscore followed by 2 more letters”, in mediaelement-and-player.min.jsI then noticed that when EME is activated the opening lines of the page HTML are:
<!DOCTYPE html>
<!–[if IE 8]>
<html xmlns=”http://www.w3.org/1999/xhtml” class=”ie8 wp-toolbar” >
<![endif]–>
<!–[if !(IE 8) ]><!–>
<html xmlns=”http://www.w3.org/1999/xhtml” class=”wp-toolbar” >whereas with EME deactivated, the <html> tag includes the “lang” attribute (set to en-GB for me)
<!DOCTYPE html>
<!–[if IE 8]>
<html xmlns=”http://www.w3.org/1999/xhtml” class=”ie8 wp-toolbar” lang=”en-GB”>
<![endif]–>
<!–[if !(IE 8) ]><!–>
<html xmlns=”http://www.w3.org/1999/xhtml” class=”wp-toolbar” lang=”en-GB”>Fri 15 Dec 2017 at 12:02 #57176FrankyKeymasterI have no influence on that header whatsoever, and in my theme the lang=”en-US” appears just fine with EME loaded (check out this forum-site).
Your theme should call language_attributes() in it’s header.php file (see twentyseventeen as an example), and that function definition can be found in wp-includes/general-template.php.
The only reason for the language part not to be present would be your blog having no language set … (which is impossible I think)Fri 15 Dec 2017 at 12:13 #57177AnonymousInactiveThe theme is OK. It has the following in header.php:
<?php
/**
* Theme Header Section for our theme.
*
* Displays all of the <head> section and everything up till <div id=”main” class=”clearfix”> <div class=”inner-wrap”>
*
* @package ThemeGrill
* @subpackage Spacious
* @since Spacious 1.0
*/
?><!DOCTYPE html>
<!–[if IE 7]>
<html class=”ie ie7″ <?php language_attributes(); ?>>
<![endif]–>
<!–[if IE 8]>
<html class=”ie ie8″ <?php language_attributes(); ?>>
<![endif]–>
<!–[if !(IE 7) & !(IE 8)]><!–>
<html <?php language_attributes(); ?>>
<!–<![endif]–>I will look into the language_attributes() function.
Fri 15 Dec 2017 at 12:21 #57178FrankyKeymasterSorry, in the backend the header is generated by the function _wp_admin_html_begin, which also calls language_attributes().
Fri 15 Dec 2017 at 12:28 #57179AnonymousInactiveThe lang attribute is missing in all the backend pages, but it is present in the public facing pages.
Fri 15 Dec 2017 at 12:54 #57180FrankyKeymasterThen maybe your theme is doing something with the language_attributes filter. Like I said: I don’t influence that header in any way. Maybe you can check your theme support, or check out if any other plugin might cause this. And check your wordpress language settings. If your theme requires something specific, I’ll gladly take a look at that requirement but I can’t support any pro-themes myself.
Fri 15 Dec 2017 at 13:43 #57181AnonymousInactiveI did further testing.
I am running 25 plugins. I deactivated and reactivated in various combinations and found that the the lang attribute disappears only when BOTH the EME and polylang plugins are activated. Deactivating either plugin causes the lang attribute to reappear. So it seems there is a clash between these 2 plugins.
Given polylang is clearly messing around with the lang attribute, I will report the issue there and see if it can be resolved. I will let you know what happens.
Fri 15 Dec 2017 at 14:13 #57182FrankyKeymasterI’ll check out polylang+EME here too.
Fri 15 Dec 2017 at 22:56 #57183FrankyKeymasterOk, I think I got it. Although I don’t play with that header, apparently (in the past), this was implemented:
add_filter('locale','eme_redefine_locale',10);
and the said function:function eme_redefine_locale($locale) { if (function_exists('pll_current_language') && function_exists('pll_languages_list')) { $languages=pll_languages_list(); if (!$languages) return $locale; $locale=""; foreach ($languages as $tmp_lang) { if (preg_match("/^$tmp_lang\/|\/$tmp_lang\//",$_SERVER['REQUEST_URI'])) $locale=$tmp_lang.'_'.strtoupper($tmp_lang); } if (empty($locale)) $locale=pll_current_language('locale'); } return $locale; }
I think it had to do with polylang stuff in the past (but don’t ask me why again, it was version 1.5.18 or so (3 years ago …).
But even version 1.7.x had this code (and all newer), so it didn’t really change the last years. Maybe polylang changed stuff (as they are entitled to do of course).
So currently: remove line 181 in events-manager.php (saying:
add_filter('locale','eme_redefine_locale',10);
).
Check if that fixes it. Of course EME still needs to detect somehow the lang by polylang, so it should be the setting “The language is set from content” apparently (again: something from years ago …). EME is not fully polylang compliant, although using EME templates you can go far already …Fri 15 Dec 2017 at 23:41 #57184AnonymousInactiveHi Franky,
I confirm that your suggestion worked.
Thanks.
Sat 16 Dec 2017 at 00:59 #57185FrankyKeymasterThank for confirming this. It will be in the next version.
-
AuthorPosts
- The forum ‘Generic’ is closed to new topics and replies.