JS errors on upgrade to G2.3 ( Plugins page blank )
floridave
Joined: 2003-12-22
Posts: 27300 |
Posted: Wed, 2008-12-03 04:41 |
Quote:
Has the architecture of G2.3 and its JavaScript changed completely since version G2.2.6? yes, it has. JavaScript files are no longer served one by one, delaying page loads dramatically, they're now combined and served as a single large JavaScript file. If you are having issues with getting JS errors when access the plugins section. Verify by testing if your combined combined Javascript works properly: Try one of these steps after asking your host to attempt to remedy the server issue:
Dave _____________________________________________ |
|
Posts: 3
I had same problem - when I try to move photos to another album, I had no chance to choose destination because it is managed by JS. And same situation was with plugins management in administration menu. It seems that JS file is send compressed by the server.
I tried to turn off zlib.output_compression in php.ini and now it works.
Maybe there is some relationship with check during upgrade of Gallery - this check thinks that zlib compression is off although it is turned on by phpinfo().
Posts: 32509
@floridave:
I haven't monitored this issue in the forums. is it usually related to zlib.output_compression?
if so, it's probably worth detecting if it's enabled and not ensure that g2 doesn't add gzip compression on top of that.
(the problem being, to my understanding, that you can't turn zlib.output_compression off at runtime in your script. once the script's execution started, you can only deal with it being enabled.)
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 27300
@valiant:
I believe it is. Would be nice to have some uses get back to us if they are using one of the above methods to fix the issue. I think that some get the host to fix the issue and never get back to us. Perhaps a modification to turn it off in the code would help, but you are the better one to answer that.
too bad that there is so many different hosts with different configs to keep track.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 7
Hi Floridave.
I have the same trubles getting the plugin action urls to work..
The problem is that i dont know how to set up my php.ini to work with the 2.3 version. I had zero problems when I was runnig 2.2.4 version of gallery embed in joomla 1.5 .. I did the above test but not sure of results..
What does gibberish mean? I just got a blank page..
Help hot to fix plugins page would really be appriciated.
Gallery URL = http://www.xxx.com/marketplace/main.php
Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.4 apache2handler
Webserver = Apache/2.2.6 (Win32) DAV/2 mod_ssl/2.2.6 OpenSSL/0.9.8e mod_autoindex_color PHP/5.2.4
Database = mysql 5.0.45-community-nt, lock.system=database
Toolkits = Exif, Thumbnail, Gd, LinkItemToolkit, Dcraw, NetPBM, ImageMagick, Ffmpeg, SquareThumb
Acceleration = none/900, none/1800
Operating system = Windows NT DATA 5.2 build 3790
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; sl; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 (.NET CLR 3.5.30729)
Rows in GalleryAccessMap table = 167
Rows in GalleryAccessSubscriberMap table = 146
Rows in GalleryUser table = 1077
Rows in GalleryItem table = 71
Rows in GalleryAlbumItem table = 30
Rows in GalleryCacheMap table = 0
My php.ini
Posts: 27300
Real url would help.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 7
Hi. Well i just wanted to say that this solution described above didnt worked for me.. Are there any other ideas that might help to fix this plugins issue? Anyone?
Posts: 7
Just wanted to let you know that my problem wasnt related to php.ini setings, but I was missing the files in gallery2/lib/yui folder. Download atachment from this post or gallery 2 developer package and upload files to above folder.. and here you go..problem fixed
Have to say I just love this gallery project! Keep up the good work guys!
Posts: 27300
Then this FAQ would help others that are missing files:
FAQ: How can I make sure that my installation files are all intact?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 39
Hi
I have exactly same problem on all g2 pages.
Thanks for the info but solutions described above did not work for me, I have all yui files and changing php.ini do not change anything (. I have my own server so I can tune anything.
I tried also to deactivate all modules one by one without any result.
Here is my error, even on main page:
YAHOO.util.CustomEvent is not a constructor
http://www.arnoult.com/gallery2/main.php?g2_view=core.CombinedJavascript&g2_key=83edbcf35785c9f34ed44b772b4c4095
Line 13
URL : http://www.arnoult.com/gallery2/main.php
This is driving me mad...
Any clue?
Thanks
URL de Gallery = http://www.arnoult.com/gallery2/main.php
Gallery version = 2.3 noyau 1.3.0
API = Noyau 7.54, Module 3.9, Thème 2.6, Intégré 1.5
PHP version = 5.2.0-8+etch13 apache2handler
Serveur Web = Apache/2.2.3 (Debian) DAV/2 PHP/5.2.0-8+etch13
Base de données = mysql 5.0.32-Debian_7etch8-log, lock.system=flock
Boîtes à outils = NetPBM, Exif, ImageMagick, Ffmpeg, Gd, jpegtran, Thumbnail, SquareThumb
Accélération = none/21600, none/21600
Système d'exploitation = Linux petitbeurre 2.6.18-6-686 #1 SMP Fri Dec 12 16:48:28 UTC 2008 i686
Thème par défaut = matrix
gettext = activé
Posts: 39
When deactivating exif module in components admin, problem just disappears! Seems that something has to do with it...
If anyone can find out why, I will be grateful...Because I need this module.
Thanks
Posts: 5
I finally fixed it by breaking that function you mentioned in the OP. i just changed "gzencode" to a nonexistant function "gzncode" and it works.
none of these solutions fixed the problem
Disabled zlib compression
replaced the code with the one in the OP
stopped and started apache 100 times
its still outputted gibberish. I dont know why this is happening i guess the file is getting gzip'd twice even with zlib and output buffering disabled. /shrug
Posts: 36
I have the errors as described above. I change my php.ini to zlib.output_compression = On and I changed the GalleryTemplateAdapter.class file as described above and it didn't work. I have all of the files in the "yui" folder and I have enabled and disabled all of my plugins with no luck.
Any ideas? I would appreciate any help you could provide.
I still get the following errors -
Error: YAHOO.util.CustomEvent is not a constructor
Source File: http://www.carefreetrip.com/gallery/?g2_view=core.CombinedJavascript&g2_key=a2b95a80ecc18ae93880a9f7238a6c31
Line: 47
Gallery URL = http://www.carefreetrip.com/gallery/
Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.8 apache2handler
Webserver = Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.8
Database = mysqlt 5.0.67-community, lock.system=flock
Toolkits = ArchiveUpload, Exif, ImageMagick, LinkItemToolkit, SquareThumb, Thumbnail, Gd
Acceleration = full/21600, full/21600
Operating system = Linux vps1103.henriemedia.com 2.6.18-028stab059.6 #1 SMP Fri Nov 14 14:01:22 MSK 2008 i686
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)
Rows in GalleryAccessMap table = 99
Rows in GalleryAccessSubscriberMap table = 1440
Rows in GalleryUser table = 2
Rows in GalleryItem table = 1431
Rows in GalleryAlbumItem table = 84
Rows in GalleryCacheMap table = 848
Posts: 27300
I surfed your gallery for a few clicks and did not see any JS errors. Perhaps it was a cache issue.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 36
I cleared all my browser cache, I cleared all of the Gallery cache and I rebooted. I open my Gallery with IE and Firefox and both show errors - see the attachments.
Posts: 27300
I don't think this is related to server side JS compression. Please start a new thread.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 36
It appears to be an issue with the Matrix theme version 1.1.6. I uninstalled the theme and then reinstalled the Matrix theme version 1.1.4 and the error goes away. Thanks again!
Posts: 39
Hi,
Just for info I solved my problem too by reinstalling EXIF module from 2.3, I forgot that I did a little hack for ISO code strings when upgrading.
Then I added my hack on the new file, and it worked!
David
Posts: 1
There was a comment earlier about wanting feedback from users as to what helped...
I found the link to check the CombinedJavascript file, and it was garbled. My hosting service has zlib.output_compression enabled by default. It might be helpful to include the literal statement for the php.ini file in the original post, for those who need it:
zlib.output_compression = On
Since I know my hosting service also has PHP running on IIS (Windows) servers, using the .htaccess solution wouldn't work, so I made the suggested edit to the modules/core/classes/GalleryTemplateAdapter.class file. After refreshing the Gallery2 cache, it worked.
So, unless my case is strange (which I don't think it is), there may need to be a change made to the Gallery2 code to test for this issue. This was not an issue for me prior to version 2.3.
Posts: 27300
Yes I agree, but development has stopped on G2.3 to work on G3. Only critical security issues will be addressed.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 1
I managed to cause similar symptoms by turning off file caching in modules/core/classes/GalleryDataCache.class, by editing the file like this:
Line 53: $cache['fileCacheEnabled'] = 0;
The telltale here is that the CombinedJavascript output is empty - zero bytes. Easily solved by not doing this. However it might get turned off temporarily by other means:
upgrade/index.php: GalleryDataCache::setFileCachingEnabled(false);
install/steps/DatabaseSetupStep.class: GalleryDataCache::setFileCachingEnabled(false);
install/steps/InstallCoreModuleStep.class: GalleryDataCache::setFileCachingEnabled(false);
install/steps/InstallOtherModulesStep.class: GalleryDataCache::setFileCachingEnabled(false);
lib/tools/phpunit/GalleryTestCase.class: GalleryDataCache::setFileCachingEnabled(false);
lib/tools/phpunit/GalleryTestCase.class: GalleryDataCache::setFileCachingEnabled(true);
Posts: 20
Thanks for posting the solutions, floridave. The hack to the GalleryAdapterTemplate.class is the only thing that worked for me. Let me also remind users that it's important to clear both the remote file cache and the browser cache each time you try one of these methods. I.E. go to http://server/pathtog2/lib/support/index.php?cache, clean the cache, then do whatever you need to do to clear your browsers cache. In the case that you're changing php.ini settings, you must also restart the web server (not reboot, just restart the web service/process so it reloads the php config).
I have to say, this is REALLY LAME! i'd consider this a critical bug as the upgrade causes your whole plugins area to break, and probably a bunch of other things too ... the plugins page is the most noticeable because the buttons are actually missing when javascript bombs.
I wish I had enough expertise to commit a patch.
Posts: 1
I had a similar problem.. I'm using gallery 2.3.1 and my plugin page (among others) didn't work as expected: the html code had all the management links on the right column, but all were disabled (display:none). I looked around and found that they should be enabled by the JS code, so I went looking there and I found (as you suggested) some gibberish content instead of the expected JS text code.
In other words I was receiving a compressed stream for my "all-in-one" JS file, but my browser didn't decompress it on the fly and so it had nothing good to execute and all the links were remaining hidden. And yes, my host has zlib.output_compression enabled but I cannot disable for the whole site (other parts are needing it) nor I was able to disable it through htaccess.
I tried this approach: I forced my browser (Firefox) not to accept compressed pages (about:config, then changed "network.http.accept-encoding" to "" instead of "gzip,deflate"). In such a way, after cleaning the cache, all started working.
Then I managed to change CombinedJavascript.inc (around row 61), in this way (my change is in bold):
So I avoid compressing only the "combined" JS, but I don't disable the caching engine in order to keep the whole thing responsive
I've spent several hours figuring it out, hope this helps someone out there :D
PS: I can't wait for Gallery3 to be ready ;)
Posts: 17
This should be in the known issues, I just lost several hours on this.
PS : 250 kB of CSS + HTML for a gallery page, lol !
Posts: 34
I have the same problem. Any solution?
My Webs: http://www.topiberian.com & https://www.solutein.com
Posts: 1
I had same problem - when I try to move photos to another album, I had no chance to choose destination because it is managed by JS. And same situation was with plugins management in administration menu. It seems that JS file is send compressed by the server.
I tried to turn off zlib.output_compression in php.ini and now it works.
Maybe there is some relationship with check during upgrade of Gallery - this check thinks that zlib compression is off although it is turned on by phpinfo().
spam link removed
Posts: 1
i had the same problem,now is ok.