Warning: OutputPage::getModuleStyles: style module should define its position explicitly: skins.xenf

Discussion in 'General Discussion and Feedback' started by Scharesoft, Mar 17, 2016.

  1. Scharesoft

    Scharesoft New Member

    I've updated the MediaWiki from 1.25 to version 1.26.2 and now the bridge seems to stop working correctly. Instead this error message appears on the top:

    Code:
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: ext.echo.badge ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: skins.xenforo.styles ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: ext.echo.badge ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: skins.xenforo.styles ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: skins.xenforo.styles ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: ext.echo.badge ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: skins.xenforo.styles ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: skins.xenforo.styles ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: skins.xenforo.styles ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    If I remove require_once($IP.'/../library/CMF/MediaWiki/LocalSettings.php'); from the LocalSettings, the wiki is working but of course without the bridge and the XenForo style.

    Here a picture how it looks in the moment:
    error.png

    I hope there is a solution for this error.


    EDIT: It seems the bug is not from the bridge, sorry for this thread. I need to investigate further before I know what it is.
     
    Last edited: Mar 17, 2016
    Yoskaldyr likes this.
  2. Yoskaldyr

    Yoskaldyr Administrator Staff Member

    Please write here how you resolve this bug.

    P.S. I will not remove the thread. Maybe someones will have the same problems as you.
     
  3. Scharesoft

    Scharesoft New Member

    I was wrong, it's a problem of the brige or at least the XenForo style of the bridge.

    This part was from an other Plugin:
    Code:
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: ext.echo.badge ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: ext.echo.badge ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    An update of the MediaWiki plugin Echo was missing.

    But this part is from the bridge and in the moment I haven't found out a solution:
    Code:
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: skins.xenforo.styles ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: skins.xenforo.styles ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: skins.xenforo.styles ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: skins.xenforo.styles ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: skins.xenforo.styles ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
    
    Warning: OutputPage::getModuleStyles: style module should define its position explicitly: skins.xenforo.styles ResourceLoaderFileModule [Called from OutputPage::getModuleStyles in /var/www/www.elderscrollsportal.de/wiki/includes/OutputPage.php at line 623] in /var/www/www.elderscrollsportal.de/wiki/includes/debug/MWDebug.php on line 300
     
    Last edited: Mar 18, 2016
  4. Scharesoft

    Scharesoft New Member

    I found something. With the help of this topic I could eliminate some errors.

    In the skin.json of the XenForo style you need to add
    Code:
    "position": "top",
    at line 20.

    Code:
        "ResourceModules": {
            "skins.xenforo.styles": {
                "position": "top",
                "styles": {
                  "../../resources/src/mediawiki.skinning/content.css": {
                        "media": "screen"
                    },
                    "../../resources/src/mediawiki.skinning/interface.css": {
                        "media": "screen"
                    },
                  "screen.less": {
                    "media": "screen"
                  },
                  "screen-hd.less": {
                    "media": "screen and (min-width: 982px)"
                  }
                }
            },
            "skins.xenforo.js": {
                "scripts": [
                    "collapsibleTabs.js",
                    "vector.js"
                ],
                "position": "top",
                "dependencies": [
                    "jquery.throttle-debounce",
                    "jquery.tabIndex"
                ]
            }
        },
     
    Yoskaldyr likes this.
  5. Yoskaldyr

    Yoskaldyr Administrator Staff Member

    Thank you. You fixed all errors with this patch?
     
  6. Scharesoft

    Scharesoft New Member

    The problems explained above are fixed with this, yes. But there is an other problem, XenForo uses an other version of jQuery than the MediaWiki. Because of this the tabs in the options of the MediaWiki are not working for me. We are working on a patch for this on our skin.
     
    Yoskaldyr likes this.
  7. Scharesoft

    Scharesoft New Member

    We've created a small patch which bypasses the problem. This js-file must be included into the skin:

    PHP:
    $(window).load(function(){
        
    /*Popup close fix*/
        
    jQuery.easing.def 'swing';
      
        
    /*Anchor fix*/
        
    $("a[href*=#]").each(function(){
            
    /* Get Page URL */
            
    var target = $(this).attr('href');
            var 
    url window.location.href;
            var 
    href url.split("#");
          
            
    /* Get Anchor */
            
    $(this).data('href'target);
          
            if(
    target.length 1) {
                
    /* Prepend full URL to Anchor */
                
    target href[0] + target;
                $(
    this).attr('href'target);
            }
            else {
                
    /* Remove '#'-only anchors */
                
    $(this).removeAttr('href');
            }
        });
      
        
    /*Tab fix*/
        
    $('#preftoc li a').on('click', function(event) {
            
    /*Prevent Redirect*/
            
    event.preventDefault();

            
    /*Get New URL*/
             
    var target = $(this).attr('aria-controls');
             var 
    url window.location.href;
             var 
    href url.split("#");
             
    targeturl href[0] + '#' target;

            
    /*Change Tab*/
             
    $('#preftoc li a').attr('aria-selected'false);
             $(
    '#preftoc li').removeClass('selected');
             $(
    this).parent().addClass('selected');
             $(
    this).attr('aria-selected'true);
             $(
    '#preftoc + div > *').hide().attr('aria-hidden'true);
             $(
    '#'+target).show().attr('aria-hidden'false);

            
    /*Adjust URL without reloading*/
            
    if(history.pushState) {
                
    history.pushState(nullnulltargeturl);
            }
            else {
                
    location.hash targeturl;
            }
        });
    });
    But it is important that this is only a workaround.
     
    Yoskaldyr likes this.
  8. Yoskaldyr

    Yoskaldyr Administrator Staff Member

    @Scharesoft I've released a new version of the add-on. Add-on must works without any additional hacks. But new version (1.1.0) works only with mediawiki 1.26 (not 1.25)
     
  9. Scharesoft

    Scharesoft New Member

    Thanks, but it seems that the patch is still neccessary for the tabs and other anchor links.

    In the options the link of the tab is for exmaple http://www.DOMAIN.de/#mw-prefsection-rendering instead of http://www.DOMAIN.de/wiki/#mw-prefsection-rendering
    This is a general problem with anchor links.

    This is the latest version of our patch:
    PHP:
    $(window).load(function(){
        
    /*Popup close fix*/
        
    jQuery.easing.def 'swing';
       
        
    /*Anchor fix*/
        
    $(".preftoc a[href*=#], #filetoc a[href*=#], .reference a[href*=#]").each(function() {
            
    /* Get Page URL */
            
    var target = $(this).attr('href');
            var 
    url window.location.href;
            var 
    href url.split("#");
           
            
    /* Get Anchor */
            
    $(this).data('href'target);
           
            if(
    target.length 1) {
                
    /* Prepend full URL to Anchor */
                
    target href[0] + target;
                $(
    this).attr('href'target);
            }
            else {
                
    /* Remove '#'-only anchors */
                
    $(this).removeAttr('href');
            }
        });
       
        
    /*Tab fix*/
        
    $('#preftoc li a').on('click', function(event) {
            
    /*Prevent Redirect*/
            
    event.preventDefault();

            
    /*Get New URL*/
            
    var target = $(this).attr('aria-controls');
            var 
    url window.location.href;
            var 
    href url.split("#");
            
    targeturl href[0] + '#' target;

            
    /*Change Tab*/
            
    $('#preftoc li a').attr('aria-selected'false);
            $(
    '#preftoc li').removeClass('selected');
            $(
    this).parent().addClass('selected');
            $(
    this).attr('aria-selected'true);
            $(
    '#preftoc + div > *').hide().attr('aria-hidden'true);
            $(
    '#'+target).show().attr('aria-hidden'false);

            
    /*Adjust URL without reloading*/
            
    if(history.pushState) {
                
    history.pushState(nullnulltargeturl);
            }
            else {
                
    location.hash targeturl;
            }
        });
    });
     
    Yoskaldyr likes this.
  10. Yoskaldyr

    Yoskaldyr Administrator Staff Member

    @Scharesoft I think I can fix anchor links without js code
     
  11. Yoskaldyr

    Yoskaldyr Administrator Staff Member

    @Scharesoft Preferences page and anchor links issues have been fixed.
     
    Scharesoft likes this.
  12. Scharesoft

    Scharesoft New Member

    Thanks for the great support, it's working now :) How did you manage it?
     
    Last edited: May 28, 2016
  13. Yoskaldyr

    Yoskaldyr Administrator Staff Member

    New version of MediaWiki has a main compatibility problem - fully async loader that incompatible with sync XenForo scripts.
    So I've used some kind of loader from the previous versions of MediaWiki for normal work.

    Problem with anchors at the Preferences page was in the javascript code (because of different default base hrefs in MW and XF).
    I've used setting change for load my modified js code (skins/XenForo/mediawiki.special.preferences.js) instead of original one (resources/src/mediawiki.special/mediawiki.special.preferences.js).

    Also this bug can appear in other js modules. In that case it must be fixed similarly - add modified js file into the skin folder and add 1 line of the code in the CMF_MediaWiki_ResourceLoader php class.
     
    Scharesoft likes this.

Share This Page