Events Made Easy Forums Generic Media and Appearance->Customize do not load fully with EME and WP-4.9.1

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #57157
    Anonymous
    Inactive

    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.

    #57162
    Franky
    Keymaster

    If something doesn’t load, check your browser console for hints. A javascript error of some kind might explain this.

    #57174
    Anonymous
    Inactive

    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.js

    I 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&#8221; class=”ie8 wp-toolbar” >
    <![endif]–>
    <!–[if !(IE 8) ]><!–>
    <html xmlns=”http://www.w3.org/1999/xhtml&#8221; 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&#8221; class=”ie8 wp-toolbar” lang=”en-GB”>
    <![endif]–>
    <!–[if !(IE 8) ]><!–>
    <html xmlns=”http://www.w3.org/1999/xhtml&#8221; class=”wp-toolbar” lang=”en-GB”>

    #57175
    Anonymous
    Inactive

    CORRECTION

    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.js

    I 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”>

    #57176
    Franky
    Keymaster

    I 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)

    #57177
    Anonymous
    Inactive

    The 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.

    #57178
    Franky
    Keymaster

    Sorry, in the backend the header is generated by the function _wp_admin_html_begin, which also calls language_attributes().

    #57179
    Anonymous
    Inactive

    The lang attribute is missing in all the backend pages, but it is present in the public facing pages.

    #57180
    Franky
    Keymaster

    Then 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.

    #57181
    Anonymous
    Inactive

    I 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.

    #57182
    Franky
    Keymaster

    I’ll check out polylang+EME here too.

    #57183
    Franky
    Keymaster

    Ok, 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 …

    #57184
    Anonymous
    Inactive

    Hi Franky,

    I confirm that your suggestion worked.

    Thanks.

    #57185
    Franky
    Keymaster

    Thank for confirming this. It will be in the next version.

Viewing 14 posts - 1 through 14 (of 14 total)
  • The forum ‘Generic’ is closed to new topics and replies.
Scroll to Top