fbrnc / aoe_jscsststamp Goto Github PK
View Code? Open in Web Editor NEWAutomatic Versioning of JS and CSS files for Magento
License: GNU General Public License v3.0
Automatic Versioning of JS and CSS files for Magento
License: GNU General Public License v3.0
Hi,
We get the following error when we try to print an order from customer account. The rest of the website works fine. How we can solve this issue?
a:5:{i:0;s:92:"Error while merging css files to path: css/u.c9e8c24e69b48f87892f75296f579491.1503562810.css";i:1;s:808:"#0 /Applications/MAMP/htdocs/orientalwebshop.loc/.modman/Aoe_JsCssTstamp/app/code/community/Aoe/JsCssTstamp/Model/Package.php(220): Mage::throwException('Error while mer...')
#1 /Applications/MAMP/htdocs/orientalwebshop.loc/.modman/Aoe_JsCssTstamp/app/code/community/Aoe/JsCssTstamp/Model/Package.php(182): Aoe_JsCssTstamp_Model_Package->generateMergedUrl('css', Array, '/Applications/M...', 'c9e8c24e69b48f8...')
#2 [internal function]: Aoe_JsCssTstamp_Model_Package->getMergedCssUrl(Array)
#3 /Applications/MAMP/htdocs/orientalwebshop.loc/.modman/Aoe_JsCssTstamp/app/code/community/Aoe/JsCssTstamp/Block/Head.php(163): call_user_func(Array, Array)
#4 /Applications/MAMP/htdocs/orientalwebshop.loc/app/code/core/Mage/Page/Block/Html/Head.php(208): Aoe_JsCssTstamp_Block_Head->_prepareStaticAndSkinElements('";s:3:"url";s:34:"/sales/order/print/order_id/16073/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:2:"nl";}
Given we have a system with the following configuration:
All assets (media|skin) are loaded by our CDN at request
when they not exist in the CDN. On non-secure sessions
the user receives his assets from the CDN. In secure sessions
we deliver the assets from our default media folder.
Given this scenario:
Given a request via HTTP, if the extension need to dump
fresh assets to the filesystem, they get dumped to
/%root%/media/(css|js)/hash.timestamp.(css|js),
later the assets is loaded by our CDN at request,
the base media url is http://cdn.domain.tld/media.
Given a request via HTTPS, the extension dumps to the same
file like in un-secure the unsecure environment.
Combined assets get overwritten vise-versa.
Un-secure: http://cdn.domain.tld/media/(css/js)/hash.timestamp.(css|js)
Secure: https://domain.tld/media/(css/js)/hash.timestamp.(css|js)
Question:
Should it not dump to different files? One for secure,
one for non-secure environments?
Hi Fabrizo,
when I enable your module and merge CSS and js files my Magento page is loaded without CSS/js files. I suppose the problem is in my .htaccess configuration. Please look into my .htaccess file and help me to configure it right. .htaccess Thx!
When In the backend storage as database is chosen there are errors
Integrity constraint violation: 1062 Duplicate entry 'css-' for key 'IDX_DIRECTORY_PATH', query was: INSERT INTO core_directory_storage
(name
, path
, parent_id
) VALUES (?, ?, ?)
Integrity constraint violation: 1062 Duplicate entry 'js-' for key 'IDX_DIRECTORY_PATH', query was: INSERT INTO core_directory_storage
(name
, path
, parent_id
) VALUES (?, ?, ?)'
As the field are unique but here we are trying to insert same values. That's why these errors are appearing
It should be possible to include timestamps for .css / .js files which are not merged.
Is it already possible?
I have tested this on a local copy of my store running on xampp and it is working as intended. However if I move it to my live server, all functionality is removed. The only difference I can think of is the fact that my live server uses subdomains for css, js and media urls. Could this be the cause of my problems? Thank you
hi,
with an alternative admin url in the local.xml file
frontName:
the loginpage http://www.example.com/admin_11_2014 try to load a versioned reset.xxx.css and a versioned boxes.xxx.css file. both are empty. the js files are loaded correct and the login is working but it looks very bad wihtout the correct css.
On CE 1.9.1.0 you get a Fatal Error:
PHP Fatal error: Call to a member function getFallbackScheme() on a non-object in /app/code/core/Mage/Core/Model/Design/Package.php on line 447
The cause is that $this->_fallback is NULL
Root cause is that Aoe_JsCssTstamp_Model_Package constructor is not calling parent constructor, which has the code to prevent null in $this->_fallback
Was there a reason for not calling the parent class constructor?
Add a composer.json and add the package to http://packages.firegento.com.
Hi,
today I noticed an error causing failing up the checkout. No sure how the environment is related, but the site is working with Apache and failing with Nginx.
I find the cause of the error:
Method getProtocolSpecificTargetFileName in file app/code/community/Aoe/JsCssTstamp/Model/Package.php is calling $this->getStore() from /app/code/core/Mage/Core/Model/Design/Package.php which apart from store object can also return integer or string. There's no validation of the object in getProtocolSpecificTargetFileName method before calling ->isSecure which in my case thrown a fatal error because the returned value was store id - not object.
Quick fix was to change line 309 from $store = $this->getStore() to $store = Mage::app()->getStore();
Edit: worth noting is that we're using IDev Onestepcheckout module, and the only use case when the checkout is failing is when the giftcard is used to pay for the full amount of order. Everything works as expected with normal payments
If I activate this extension and open my page via secure connection, none of my css and js is being loaded. If I remove this extension, it is working again.
It looks like dev/css/addTstampToAssets can not be configured from the backend?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.