-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Description
When a user enabled the HTML profiler, the pub/static.php
file adds HTML code to the bottom of non-HTML resources. For example, if you load
http://127.0.0.1:8080/pub/static/adminhtml/Magento/backend/en_US/prototype/prototype.js
The end of the file will contain code like the following
findChildElements: function(element, expressions) {
var selector = expressions.toArray().join(', ');
return Prototype.Selector.select(selector, element || document);
}
});
})();
<table border="1" cellspacing="0" cellpadding="2">
<caption>Code Profiler (Memory usage: real - 7340032, emalloc - 7024160)</caption>
<tr>
This HTML code causes javascript execution errors, which breaks application functionality. While this can be worked around using other profiler modes (csvfile), enabling the HTML profiles should not break the application's functionality.
Steps to Reproduce.
- Add
SetEnv MAGE_MODE developer
to your.htaccess
file - Add
SetEnv MAGE_PROFILER html
- Confirm profiler added to the bottom of your root page
- Load a file through
static.php
via a URL likepub/static/adminhtml/Magento/backend/en_US/prototype/prototype.js
Expected Behavior: Magento loads executable Javascript, preserving application functionality
Actual Behavior: Magento loads Javascript with HTML profiler code at the end, breaking application functionality