Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML Profiler and pub/static Resources #850

Closed
astorm opened this issue Dec 21, 2014 · 2 comments
Closed

HTML Profiler and pub/static Resources #850

astorm opened this issue Dec 21, 2014 · 2 comments

Comments

@astorm
Copy link

astorm commented Dec 21, 2014

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.

  1. Add SetEnv MAGE_MODE developer to your .htaccess file
  2. Add SetEnv MAGE_PROFILER html
  3. Confirm profiler added to the bottom of your root page
  4. Load a file through static.php via a URL like pub/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

@antonmakarenko
Copy link

That's a good one. Thank you for report. I have reported to the internal issue tracker (MAGETWO-32092)

@muasir muasir added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jan 23, 2015
@sshrewz sshrewz added in progress and removed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development labels Mar 2, 2015
@sshrewz
Copy link

sshrewz commented Mar 23, 2015

@astorm, this has been resolved in 0.74.0-beta1. Thank you again for submitting this issue. Should you have any other questions, feel free to reach out to us by opening a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants