Issue 119357 - Sometimes no download link when JavaScript enabled in Firefox 12
Summary: Sometimes no download link when JavaScript enabled in Firefox 12
Status: CLOSED FIXED
Alias: None
Product: Infrastructure
Classification: Infrastructure
Component: Downloads (show other issues)
Version: current
Hardware: PC All
: P3 Normal (vote)
Target Milestone: ---
Assignee: Marcus
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-15 11:35 UTC by DonJaime
Modified: 2013-07-10 21:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description DonJaime 2012-05-15 11:35:26 UTC
At http://www.openoffice.org/download/ there is sometimes no download link for the application in Firefox 12 when Javascript is enabled. The JS error console shows the following:

Error: language is not defined
Source File: http://www.openoffice.org/download/download_new_dl.js
Line: 276

"Sometimes" means: when using one user account under Windows XP. Other user accounts on the same machine show the link. I don't know what the difference is. Disabling all add-ons did not help.


Whatever the reason, changing

if (language == "" || language == "null" || language == "en") language = "en-US";

to

if (typeof language == "undefined" || !language || language == "en") language = "en-US";


should fix it.
Comment 1 Marcus 2012-05-15 21:02:38 UTC
Thanks for the hint. Please can you give us some more information? Especially when the problem happens again, an output of the following webpage would be very helpful:

http://www.openoffice.org/download/test/analyze.html
Comment 2 DonJaime 2012-05-15 21:13:04 UTC
http://www.openoffice.org/download/test/analyze.html output:

navigator.platform: Win32
navigator.UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0
navigator.UserAgent lower case: mozilla/5.0 (windows nt 5.1; rv:12.0) gecko/20100101 firefox/12.0
navigator.UserAgent lower case: -1
getLink(): undefined
getPlatform(): Windows
Comment 3 Marcus 2012-05-15 22:40:11 UTC
I thought of all the output, not only the first lines. ;-)
Comment 4 Terry 2012-05-16 00:54:45 UTC
Ditto for me using a Linux system:

navigator.platform: Linux i686
navigator.UserAgent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20100101 Firefox/11.0
navigator.UserAgent lower case: mozilla/5.0 (x11; linux i686; rv:11.0) gecko/20100101 firefox/11.0
navigator.UserAgent lower case: -1
getLink(): undefined
getPlatform(): Linux
getLanguage(): English (British)
Comment 5 Terry 2012-05-16 00:57:07 UTC
(In reply to comment #4)
> Ditto for me using a Linux system:
> 
> navigator.platform: Linux i686
> navigator.UserAgent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20100101
> Firefox/11.0
> navigator.UserAgent lower case: mozilla/5.0 (x11; linux i686; rv:11.0)
> gecko/20100101 firefox/11.0
> navigator.UserAgent lower case: -1
> getLink(): undefined
> getPlatform(): Linux
> getLanguage(): English (British)

I do see links on the page.
Comment 6 DonJaime 2012-05-16 10:36:22 UTC
(In reply to comment #3)
> I thought of all the output, not only the first lines. ;-)

That was all of the output. Same bug as on the download page. The Error Console shows:

Error: language is not defined
Source File: http://www.openoffice.org/download/download2.js
Line: 14

The good news is that I've identified the reason for the difference: I have no preferred language defined in my "Content" options. Probably not a common choice, but it can happen.

The solution proposed above is still valid. Or you could declare the language variable with 'var' (good practice anyhow) and leave out the 'typeof' test, but you'd still need to change the condition to cover language == undefined. Taking the quotes off the "null" would do that:

if (language == "" || language == null || language == "en") language = "en-US";

but

if (!language || language == "en") language = "en-US";

would cover everything more elegantly.
Comment 7 Marcus 2012-05-17 14:54:57 UTC
@Terry + DonJaime:
I've reworked the "analyze.html" webpage. Could you please try again? Thanks.
Comment 8 Terry 2012-05-17 22:59:56 UTC
I should say that the links below the title page ('analyze') each point to a page.

I no longer see the paragraph towards the top left of the page (the one I quoted in my previous post).  I see this in the middle of the page:

Variables from the browser 	Values
navigator.platform 	Linux i686
navigator.platform.toLowerCase() 	linux i686
navigator.language 	en-GB
navigator.userLanguage 	undefined
navigator.systemLanguage 	undefined
navigator.userAgent 	Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20100101 Firefox/11.0
navigator.userAgent.toLowerCase() 	mozilla/5.0 (x11; linux i686; rv:11.0) gecko/20100101 firefox/11.0
navigator.javaEnabled() 	No
getLink( VERSION, MIRROR, SCHEMA ) 	http://download.openoffice.org/other.html/download
getArray() 	here,English (British),http://download.openoffice.org/other.html,n,n,n
getPlatform( SCHEMA ) 	Linux
getLanguage() 	English (British)
getLanguageISO() 	en-GB
mirrorbrain_getPlatformForMirror( SCHEMA ) 	Linux_x86_install-rpm
mirrorbrain_getExtension( SCHEMA ) 	.tar.gz
mirrorbrain_getFileName( VERSION, SCHEMA ) 	null
hasMirrorLink() 	false
Comment 9 Marcus 2012-05-17 23:35:08 UTC
@Terry:
Thanks for the update. In the meantime I've cleaned-up the "analyze.html" webpage (also to recognize IceWeasel). For en-GB we have no install files for AOO 3.4.0 but hopefully for AOO 3.4.1.

However, the plan is to redirect users with not (yet) supported languages to the "other.html" to let them choose their 2nd favorite install file. You can see this with the value for "getLink()" and "getArray()". I've tweaked the DL logix to redirect German and it works. When clicking on the green box then the "other.html" webpage opens.

OK, 2 more questions: 
a) What text do you see in the green box?
b) What is the download URL in the green box?
Comment 10 Terry 2012-05-19 01:03:44 UTC
(In reply to comment #9)
> @Terry:
> <snip>
> 
> OK, 2 more questions: 
> a) What text do you see in the green box?
> b) What is the download URL in the green box?

I see no green box.  Where on the page is it supposed to be?
Comment 11 Marcus 2012-05-19 01:09:28 UTC
Take the "not-yet-official-and-online" webpage:

http://ooo-site.staging.apache.org/download/index_aoo.html
Comment 12 Terry 2012-05-19 04:27:41 UTC
(In reply to comment #11)
> Take the "not-yet-official-and-online" webpage:
> 
> http://ooo-site.staging.apache.org/download/index_aoo.html

The green box there says:
"Download Apache OpenOffice
Get Apache OpenOffice from your native language community."
The url is http://sourceforge.net/projects/openofficeorg.mirror/files/localized/en-GB/3.4.0/Apache_OpenOffice_incubating_3.4.0_Linux_x86_install-rpm_en-GB.tar.gz

There is a paler green box below that which says "Get all platforms ...."
Comment 13 Marcus 2012-05-19 11:34:59 UTC
@Terry:
That's interesting. The text in the green box is correct. As en-GB builds are not available, you should be redirected to the "other.html" webpage. This is not working.

I've corrected this problem. Now all users with not-support language (like en-GB) should be redirected. Does it also work for you?
Comment 14 Terry 2012-05-20 02:33:24 UTC
(In reply to comment #13)
> @Terry:
> <snip>
> 
> I've corrected this problem. Now all users with not-support language (like
> en-GB) should be redirected. Does it also work for you?

Yes, the url is now http://www.openoffice.org/download/other.html and clicking on the box loads that page.
Comment 15 Marcus 2012-05-20 07:09:22 UTC
great, thanks for your feedback
Comment 16 DonJaime 2012-05-20 11:37:12 UTC
http://ooo-site.staging.apache.org/download/index_aoo.html provides a green box with a functioning link.


Output from http://www.openoffice.org/download/test/analyze.html, in case you're still interested:


Variables from the browser 	Values
navigator.platform 	Win32
navigator.platform.toLowerCase() 	win32
navigator.language 	
navigator.userLanguage 	undefined
navigator.systemLanguage 	undefined
navigator.userAgent 	Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0
navigator.userAgent.toLowerCase() 	mozilla/5.0 (windows nt 5.1; rv:12.0) gecko/20100101 firefox/12.0
navigator.javaEnabled() 	Yes
JavaScript functions from the DL scripts 	Return values
getLink( VERSION, LANGUAGE, MIRROR, SCHEMA ) 	http://sourceforge.net/projects/openofficeorg.mirror/files/stable/3.4.0/Apache_OpenOffice_incubating_3.4.0_Win_x86_install_en-US.exe/download
getArray( LANGUAGE ) 	here,English (US),English (US),http://www.openoffice.org/download/other.html,y
getPlatform( LANGUAGE, SCHEMA ) 	Windows (MSI)
getLanguage( LANGUAGE ) 	English (US)
getLanguageISO( LANGUAGE ) 	en-US
sourceforge_getLink( VERSION, LANGUAGE, SCHEMA ) 	http://sourceforge.net/projects/openofficeorg.mirror/files/stable/3.4.0/Apache_OpenOffice_incubating_3.4.0_Win_x86_install_en-US.exe/download
apache_getLink( VERSION, LANGUAGE, SCHEMA ) 	http://www.apache.org/dyn/closer.cgi/incubator/ooo/files/stable/3.4.0/Apache_OpenOffice_incubating_3.4.0_Win_x86_install_en-US.exe
apache_getChecksum( VERSION, LANGUAGE, SCHEMA, HASH )	http://www.apache.org/dist/incubator/ooo/files/localized/en-US/3.4.0/Apache_OpenOffice_incubating_3.4.0_Win_x86_install_en-US.exe.md5
mirrorbrain_getPlatformForMirror( LANGUAGE, SCHEMA ) 	Win_x86_install
mirrorbrain_getFileName( VERSION, LANGUAGE, SCHEMA ) 	Apache_OpenOffice_incubating_3.4.0_Win_x86_install_en-US.exe
mirrorbrain_getExtension( LANGUAGE, SCHEMA ) 	.exe
hasMirrorLink( LANGUAGE ) 	true