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

IE6 error when clicking on menu: flash object not destroyed properly #798

Closed
mattab opened this issue Jun 13, 2009 · 3 comments
Closed

IE6 error when clicking on menu: flash object not destroyed properly #798

mattab opened this issue Jun 13, 2009 · 3 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Jun 13, 2009

From Marc Trudel by email

the solution came to me. Here is the patch, its basically 3 lines - the part in sectionLoaded is just be reindenting :D

root@mushin:/var/www/dev.mu-shin.ca/piwik/plugins/CoreHome# svn diff ./templates/broadcast.js
Index: templates/broadcast.js
===================================================================
--- templates/broadcast.js    (revision 1200)
+++ templates/broadcast.js    (working copy)
@@ -158,15 +158,20 @@
     $('#loadingPiwik').show();
     $('#content').hide();

+    // OFC ofc_resize call fix - remove the object before the container
+    $("object").each(function(){
+        $(this).remove();
+    });
+
     broadcast.lastUrlRequested = urlAjax;

     function sectionLoaded(content)
     {
         if(urlAjax == broadcast.lastUrlRequested) {
-        $('#content').html( content ).show();
-        $('#loadingPiwik').hide();
-        broadcast.lastUrlRequested = null;
-    }
+            $('#content').html( content ).show();
+            $('#loadingPiwik').hide();
+            broadcast.lastUrlRequested = null;
+        }
     }
     piwikMenu.activateMenu(
         broadcast.getParamValue('module', urlAjax),

Basically, here's why you had a problem - ofc implements an ExternalInterface so that if you resize the flash container, it can call a javascript function. This is good for, say, a flash with 100% width and a jquery ui resizeable container. Problem comes when you destroy the container: that triggers the resize function (beccause the container "changes size"), but when it comes back to make the externalinterface js call, the internal script does a document.getElementById with the flash object id... and returns null.

So to avoid the resize call, you must destroy implicitly the object first, and the container later.

@anonymous-matomo-user
Copy link

Just a note - this is also a bug in other versions of IE - IE7 and IE8 are also having this problem.

Also, I know the fix should have been reduced to

$("object").remove();

but... well, that could go in too :).

@robocoder
Copy link
Contributor

Confirmed that this fixes the "'null' is null or not an object" error. Thanks.

@robocoder
Copy link
Contributor

(In [1235]) Fixes #798 - null is null or not an object error

@mattab mattab added this to the Piwik 0.4.1 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

3 participants