Piwigo Bugtracker

Piwigo bug tracker has moved to Github

This bugtracker is kept to provide history on old issues.


View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003119Piwigotemplatepublic2014.08.14 11:502014.09.19 10:48
Reportermmoy 
Assigned Toplg 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version2.7.0 
Summary0003119: allow @import(external URL) when combine css
DescriptionI wanted to use some external font, hence add this

@import url(http://fonts.googleapis.com/css?family=Architects+Daughter [^]);

to my rules.css (using LocalFiles Editor). Doing this, I get this error when loading a page:

Warning: file_get_contents(././locals/9/2/c/92c0o9s0qi/css/url(http://fonts.googleapis.com/css?family=Architects+Daughter [^])): failed to open stream: No such file or directory in /home/sys/var/www/piwigo_master_26/include/template.class.php on line 2031

and the file is not imported. My understanding is that the template mechanism tries to inline the @import directive, but this inlining does not work for external URLS.

I think it should just leave the @import as-is for external URls.
Additional InformationThe obvious workaround for me was to add this instead

/* http://fonts.googleapis.com/css?family=Architects+Daughter [^] */
@font-face {
  font-family: 'Architects Daughter';
  font-style: normal;
  font-weight: 400;
  src: local('Architects Daughter'), local('ArchitectsDaughter'), url(http://fonts.gstatic.com/s/architectsdaughter/v5/RXTgOOQ9AAtaVOHxx0IUBOkI_DLF4EgbZt3mhU8gQFo.woff [^]) format('woff');
}

But I think my @import should have worked out-of-the-box.
TagsNo tags attached.
browserany
Database engine and version
PHP version
Web serverApache 1.3.x
Attached Files

- Relationships

-  Notes
(0007548)
flop25 (developer)
2014.08.14 14:08

linked to our css combination system
you can disable the css/js combination also
(0007558)
plg (manager)
2014.08.20 11:22

The best way to import a CSS from Google fonts is to use plugin Add <head> element http://piwigo.org/ext/extension_view.php?eid=582 [^]
(0007587)
mmoy (reporter)
2014.08.24 18:54

Honestly, if I want to change the font of every H1 elements, I don't see how using the "Add < head > element" plugin would be any better than doing this in the CSS:

@import url(http://fonts.googleapis.com/css?family=Architects+Daughter [^]);
h1 {
    font-family: 'Architects Daughter', cursive;
}

one has to write CSS code anyway, so putting the import next to the other CSS code seems the most natural to me. I'd call the plugin solution a workaround, but not "the best way".
(0007589)
plg (manager)
2014.08.24 19:06

Sorry, my sentence should have been "the best way in Piwigo...". @import doesn't work because of our merge&minify system.

In "Add <head> element", you can do:

<link href='http://fonts.googleapis.com/css?family=Architects+Daughter' [^] rel='stylesheet' type='text/css'>


This is quite simple. OK to admit it's a workaround :-)
(0007626)
svn (reporter)
2014.09.19 10:46

[Subversion] r29636 by plg on trunk

-----[Subversion commit log]----------------------------------------------------
bug 3119 fixed: patch by mmoy, allow @import url(http://... [^]); directives in minified CSS file.

- Issue History
Date Modified Username Field Change
2014.08.14 11:50 mmoy New Issue
2014.08.14 11:50 mmoy browser => any
2014.08.14 11:50 mmoy Web server => Apache 1.3.x
2014.08.14 14:08 flop25 Note Added: 0007548
2014.08.14 14:08 flop25 Summary @import(external URL) directives refused in CSS (e.g. LocalFiles Editor) => allow @import(external URL) when combine css
2014.08.20 11:22 plg Note Added: 0007558
2014.08.24 18:54 mmoy Note Added: 0007587
2014.08.24 19:06 plg Note Added: 0007589
2014.09.19 10:46 svn Checkin
2014.09.19 10:46 svn Note Added: 0007626
2014.09.19 10:48 plg Assigned To => plg
2014.09.19 10:48 plg Status new => closed
2014.09.19 10:48 plg Resolution open => fixed
2014.09.19 10:48 plg Fixed in Version => 2.7.0


Copyright © 2000 - 2019 MantisBT Team
Contact
Powered by Mantis Bugtracker