We are getting "a.tmpl.complete is not a function" with v1.9 - mvc-mini-profiler

We are getting the following error with v1.9 of the profiler.
a.tmpl.complete is not a function
Search and tried looking into issue but so far no luck on what to do to correct it.
Anyone else know what to do?

This is collateral damage caused by the never ending fight for jQuery to get a templating engine.
What happened was that jQuery.tmpl was going to be the templating engine the jQuery team were going to bless. However stuff happened and for whatever reason the current contender may be jsRender.
If for any reason you depended on a particular different implementation of $.tmpl depending on ordering Mini Profiler would either break you or you would break Mini Profiler.
To overcome this I just patched MiniProfiler to use an unobtrusive version of jQuery and jQuery.tmpl. This means you can load whatever version of jQuery you want into your page but MiniProfiler will only use a special "renamed" version of jQuery (stored in the global jQueryMP)
See also: Unobtrusive jQuery html templating

Related

Oracle Apex hide version

In Oracle Apex, is there a way to keep technology profiler tool to extract the versions? For example, RequireJS, jQuery, jQuery Migrate, jQuery UI. Once the profiler run, these technologies should not be displayed on the said profiler.
There is not likely a way to block a profiler tool from identifying the versions of the libraries and such because they are built right into the libraries. For example, running this in the browser console will output the version of jQuery:
console.log( 'You are running jQuery version: ' + $.fn.jquery );
Unless Oracle modifies the libraries (which seems highly unlikely) to remove any abilities to return the version of the library, there's not much you can do. If someone was very determined, they could still just download the javascript, css, etc. files from your server and compare them against the known releases of the libraries to match them to a version.

What to do about "The Components object is deprecated. It will soon be removed." in dev tools Console

For almost every page I open in Firefox, I see this error in the Console of the developer tool bar:
(!) The Components object is deprecated. It will soon be removed.
The source is the html page. It happens with pages I create, but also on many common websites.
I found this documentation on Components object on MDN web docs, but that does not clarify a lot. Note that even that page shows this message(!)
It looks like a warning, but according to the Console filter, it is an error.
My main questions are:
Is this something for me, as a developer of the page reporting this, to solve?
If so, how do I go about that?
I am not aware of any problems as a result of this. For now, that is.
I have seen this for over a year, maybe longer. I mostly ignore this, but every now and then it starts nagging me again. I don't want my code to break suddenly and would like to get rid of this message obscuring other messages.
This is not for the developer of the page to solve.
While biking back home, a possible cause popped up in my mind: could one of the add-ons I use cause this and yes, that appears to be the case.
I restarted with disabled add-ons and the message was gone.
Then I enabled them one at a time and the culprit is
Selenium IDE.
A bug report on this issue was closed with Won't fix, with the message:
This error will resolve itself when we move to a native app later this year.
In a MozillaZine topic of 2012, it is explained how it could have been solved.
The first one is just a warning that the addon is using "Components"
directly, which won't necessarily always be possible when using the
Add-on SDK. (The preferred way to do it is to access the aliases for
Components.classes and Components.interfaces and such that the SDK
provides by requiring the "chrome" module.) It shouldn't be a problem
right now, but might become one in the future.
it happened for me after installing Selenium plugin in my FireFox.

How to debug a program that doesn’t throw any error

I’m having trouble to find a bug in my application.
The problem is random and don’t throw any error. The web site just keeps loading and loading and eventually gets a timeout.
Is a web application using MVC 3 in VS 2010 Pro.
Some time ago, I see a friend to write something in the url, and gets all the trace of the program…
Sadly, I don’t remember what the command was.
Anyone has an idea of what command is it?
Any suggestion on what to use to debug?
Thanks!
Edgar.
UPDATE!
I finally found the command... is trace.axd
But Its behave the same way... sometimes load without problems and show me all the trace info... and sometimes.. it keep loading and loading...
Maybe something related with IIS?
Turn on break on every thrown exception, run your application in debug mode and wait. If it executes too long then pause application and check where you are or wait for exception that is handled somewhere.
Your friend may have had something like the following built into his application, to dynamically set tracing on.
Trace.IsEnabled = Request.QueryString["trace"] != null ? true : false;
This provides info only if the page is fully loaded. It's probably best if you use the VS debugger to step through code.
If all you loops look ok, investigate code that could result in circular references or deadlocks. These can be difficult to spot sometimes, look for functions or constructors that require results from a calling class. So code that needs the result from a function which in turn need results from the first.
Well, this sounds like you have an infinite loop somewhere.
Look at the code that runs when you visit the URL that gives you trouble. See if there is any loops in there (for/while). If yes, see why if they never exit. You can do this by putting a breakpoint inside the loop and examining its behavior over the iterations.
in MVC the bugs you do not see are most of time (especially in Razor and Ajax work) view compile errors. Sometimes syntax bugs on views just does not show that view and do not stop working.
Try that:
put a breakpoint in view.
If program stops in there it means this view is working. Othervise there is a syntax error in this view.
Another way to see some bug information more than in visual studio is use browser tools.
I use google Chrome. Just open developer tools in it. Open network. And do your request. It will list the requests and responses. Click the response and see the information. After style (it is written Verdana etc) read exception details. Sometimes there is more information :)
I am using MVC 3 in Razor from start. So this is a small bug in asp.net mvc.

Magento sites in IE9, prototype bugs

Internet Explorer 9 was released today, and I decided to check a few Magento sites we build in the last couple of months to see if everything continues to work with the new version.
But unfortunately it doesn't. I came across one particular problem that is caused by the version of the prototype library which is shipped with Magento, version 1.6.0.3.
It looks like the cancelling events in eventhandlers isn't working.
For example, if you try to log in to a Magento shop, and just leave the login and password fields empty, IE9 submits the form even if there were errors, and the errors disappear after the refresh.
So that's quite a big problem I think.
So my question is: how can we deal with this problem? I see a couple of ways to deal with this:
Wait for Magento to release a new version with fixes
Upgrade the prototype library to the latest version which probably already has fixed the issue
Mess around in the existing library and try to fix the bug in there
Waiting for a new Magento release isn't a good idea because it probably will take a few weeks before there is one, and because it will cause a whole lot of other problems if you are running a very old version of Magento.
Upgrading to the latest prototype library is probably the best idea, but will everything in Magento continue to work with the latest version of prototype, does anybody has any experience with this?
So what's everybody's opinion about this problem?
Any ideas other than mine?
As upgrading Prototype has the potential to break a lot of things in Magento (and, honestly, doing anything in Magento has the potential to break a lot of things in Magento), I created a theme override for my
app/code/design/frontend/{package}/{theme}/template/page/html/head.phtml
file and slapped the following as the first element under the head tag:
<meta http-equiv="X-UA-Compatible" content="IE=8" />
This tells IE to pretend as if it is IE 8, where possible. This solved an issue where, for example, you could not check out and complete the payment process if you only have one payment method enabled, as in IE 9 the fields will all be grayed out.
Note that it really must be the first tag underneath the <head>.
Since upgrading Magento in any way has the potential to cause problems, I feel this is the least intrusive way to solve the issue in the near term.
Solved: http://www.alexanderinteractive.com/blog/2011/10/solving-the-ie-7-ie-9-magento-prototype-validation-bug/
I spent a couple days on this, and discovered the only thing that truly works is disabling things at the form level. This should solve all your problems.
As a quick fix, I think I would take the same approach you are advocating, and upgrade Prototype to a version that does not contain this issue. However, Magento will be coming along with a patch (this is too big to ignore), and at that point, it would be wise to undo your changes and apply the patch they provide to keep in line with normal upgrades.
It is rarely worth it to manually dig in the internals of Magento's JS, so that option seems a bit off to me. There are probably several places where this semantic is used and you may miss some of them.
Hope that helps!
Thanks,
Joseph Mastey
I've updated the prototype.js file to 1.7 and so far it's correct. I dont see any errors. If you apdate and find errors please notify!
The proper fix is in the Magento forums.
In template/catalog/product/view/tabs.phtml, change the line that reads:
ul.select('li', 'ol').each(function(el){
to
ul.select('li').each(function(el){

flXHR - getting started (a simple question)

I am trying to use the flXHR javascript library for making cross-domain calls.
I got stuck at the begining.
As they say in the docs, I copied the /deploy directory's content to a /scripts directory.
All the dependencies are supposed to be included in the flXHR download.
This is my html, which returns several errors:
the errors:
y.base_path is undefined
y.checkplayer is undefined
y.ua is undefined
E.attachEvent is not a function
thanks
flXHR is tested and works (AFAIK) on all major browsers' latest released versions. I don't revalidate the test-suite every single new release of any browser, but I do so from time to time.
With respect to the "base_path is undefined" error... the problem is not with flXHR (or CheckPlayer), but with how Firebug traps for JS errors.
I have a try/catch block around access of that variable, and if it's not present, then I take an alternate action. From a normal JS perspective, this is not a JS error, because the try/catch block catches it and deals with it. But Firebug still registers it as an error. This error is erroneous, and as far as I know is not going to affect any behavior in the rest of your code.
Again, to my knowledge, flXHR is currently working in all browsers. If you have issues, please visit the flXHR forum on http://flXHR.flensed.com.
I noticed the "y.base_path is undefined" error sometimes, but only when Firebug is open. Try closing firebug (or use a different browser) and see what happens.

Resources