https://bugzilla.wikimedia.org/show_bug.cgi?id=37203

       Web browser: ---
             Bug #: 37203
           Summary: error adding external style sheets
           Product: MediaWiki
           Version: 1.19.0
          Platform: All
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Unprioritized
         Component: ResourceLoader
        AssignedTo: wikibugs-l@lists.wikimedia.org
        ReportedBy: ppre...@uab.edu
                CC: krinklem...@gmail.com, roan.katt...@gmail.com,
                    tpars...@wikimedia.org
    Classification: Unclassified
   Mobile Platform: ---


This bug report is in response to the reply from Platonides on not being able
to add external stylesheets -
http://lists.wikimedia.org/pipermail/mediawiki-l/2012-May/039318.html

Details:
Cannot load external style sheets ie., style sheets with a path like,
'http://mysite.com/css/screen.css'. This was seen when creating a new theme
with mediawiki-1.18.1 and 1.19.0 code base and passing http urls to the styles
array to $wgResourceModules, like this:

$wgResourceModules['skins.uabvector'] = array(
      'styles' => array(
    'http://mysite.com/css/layout.css' => array( 'media' => 'screen' ),
    'http://mysite.com/css/positional.css' => array( 'media' => 'screen' ),
      ),
        'remoteBasePath' => &$GLOBALS['wgStylePath'],
    'localBasePath' => &$GLOBALS['wgStyleDirectory'],
);

Following is the error in the apache error log for the external style sheet.

For 1.18.1, the error is:

[error] [client ::1] PHP Warning:  filemtime(): stat failed for
/home/user/public_html/mw-1.18.1/skins/https://mysite.com/brand/styles/3.0/css/bg/backsplash-green_bg.css
in
/home/user/public_html/mw-1.18.1/includes/resourceloader/ResourceLoaderFileModule.php
on line 380

For 1.19.0, the error is:
error] [client ::1] PHP Warning:  array_map(): An error occurred while invoking
the map callback in
/home/user/public_html/mediawiki-1.19.0/includes/resourceloader/ResourceLoaderFileModule.php
on line 589

The style sheets are loaded if they are downloaded locally and a local file
path is mentioned instead to the styles array.

As Roan Kattouw mentioned in this bug - 
https://bugs.php.net/bug.php?id=55416&edit=1, 

the above errors originate from the array_map in the function 'readStyleFile'
in the includes/resourceloader/ResourceLoaderFileModule.php -


https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes/resourceloader/ResourceLoaderFileModule.php;h=f0892ec2a82daa849f4feed4c274e6ed5b534a31;hb=HEAD#l597.
 

The array_map returns empty when the stylesheet has a http path.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to