Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Jscript Error in Files Upload Panel  (Read 4193 times)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Jscript Error in Files Upload Panel
« on: July 18, 2008, 07:48:48 PM »

While working with 1.7RC on localhost today I noticed that I am getting a javascript error (in IE7)... you know... the little yellow triangle icon down in the left corner with an exclamation mark in it. It happens after choosing a folder to "Upload To" in the Files Upload panel. It functions OK... but I wonder what's causing the error to show up. The same occured while testing 1.6 projects including Bakercad's 1.6 MU (virgin and modded) offline and online.

Checked it out in FF and the error message says goto is not defined. The offending string in function files is:

Code: [Select]
<?php

echo '<select name="upload_dir" id="ud1" onChange="goto(this.form);">';

?>


EDITED - update: July 19.08

Thanks to Mosh for pointing out (below) that this error can be eliminated simply by removing onchange="goto(this.form);" from the string... and it does not appear to affect the upload-to folder choice in the drop-down at all.

I should note that this fix is required in all sNews versions starting from 1.5.30 right up to 1.7RC2. All other 1.5.2x versions before 1.5.30 (which no one should be using these days) did not have this bug.

« Last Edit: July 19, 2008, 11:38:26 PM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

mosh

  • Hero Member
  • *****
  • Karma: 77
  • Posts: 510
  • Awesome day :)
    • cms-zen
Re: Jscript Error in Files Upload Panel?
« Reply #1 on: July 19, 2008, 09:20:34 AM »

Good day  ;D

i have noticed this error from v16 -> v17rc,
just delete this: onchange="goto(this.form);"
where ever you find it lol,
i think its a bit of code left from some other use.

after sleceting the directory,
there is no need to go (goto) just uploading

 ::)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Jscript Error in Files Upload Panel?
« Reply #2 on: July 19, 2008, 11:30:22 PM »

Good day  ;D
I have noticed this error from v16 -> v17rc, just delete this: onchange="goto(this.form);"   where ever you find it lol,
i think its a bit of code left from some other use.
After sleceting the directory, there is no need to go (goto) just uploading.
 ::)

You're right Mosh... removing it doesn't affect uploading at all. Thanks for the tip.

I went back through my old version file-sets to see where it came from. Function files was added to sNews in version 1.5. onchange="goto(this.form);" was not used up to version 1.5.28 (15RC3) or 1.5.29... but it was added in version 1.5.30 (Feb.21.07) and has remained in there ever since. I checked back in my copy of Mika's 1.5.30 DEV (snews.php file with all of his development notes in it) and he made no comment there as to why it was added in. An orphan it is.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Re: Jscript Error in Files Upload Panel
« Reply #3 on: October 31, 2008, 08:04:32 PM »

fixed in final release
Logged
Of all the things I have lost, it is my mind that I miss the most.