pauladaniel / calendardateselect

Automatically exported from code.google.com/p/calendardateselect
Other
0 stars 0 forks source link

Current version of calendar is incompatible with prototype 1.6.0.1 bundled with scriptaculous #77

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Installed latest prototype available here:
2. http://script.aculo.us/downloads
3. upgraded Rails project

What is the expected output? What do you see instead?
Calendar should pop up and does not. 

What version of the product are you using? On what operating system?
latest on Windows XP/Firefox

Please provide any additional information below.
Love the tool. Thanks for sharing it. 

Original issue reported on code.google.com by MichaelD...@gmail.com on 17 Jan 2008 at 9:53

GoogleCodeExporter commented 8 years ago
Having the same issue too.

Firebug says: 

element.select(expression) has no properties
down(input#chat_starts January 23, 2008 12:..., "INPUT", undefined)prototype.js 
(line 1724)
_methodized()prototype.js (line 245)
initialize(input#chat_starts January 23, 2008 12:..., Object time=true 
year_range=10)
calendar_date_sel... (line 75)
klass()prototype.js (line 48)
onclick(click clientX=0, clientY=0)new (line 1)
[Break on this error] element.select(expression)[index || 0];

Original comment by michael....@gmail.com on 23 Jan 2008 at 5:17

GoogleCodeExporter commented 8 years ago
Line 1724 of prototype.js (in the above comment)

Original comment by michael....@gmail.com on 23 Jan 2008 at 5:17

GoogleCodeExporter commented 8 years ago
Same effect in Prototype 1.6.0.2

Original comment by jeffrey....@gmail.com on 28 Jan 2008 at 5:14

GoogleCodeExporter commented 8 years ago
The problem is that, when the target has no descendant of type "INPUT" the
element.select(), from prototype, will return undefined (?), tho the 
documentation
implies that it will return an empty array, and trying to index it results in 
error.

You can try this out by doing a $('input_target').select('INPUT') which is what
eventually gets called from the down() method. The problem is that the target 
has no
descendants at all, since if the element you try to select() on has descendants 
it
will return an empty array.

Prototype bug?

Original comment by gfo...@gmail.com on 30 Jan 2008 at 3:41

GoogleCodeExporter commented 8 years ago
Oh and BTW you can avoid the bug, for now, by commenting out line 75 that reads:
"if (down = this.target_element.down("INPUT")) this.target_element = down;"
in calendar_date_select.js.

But then others problems might surface ... if the field has errors due to model
validation. (Related to issue 42.)

Original comment by gfo...@gmail.com on 30 Jan 2008 at 3:43

GoogleCodeExporter commented 8 years ago
I fixed this for myself by replacing line 75 with:
if (this.target_element.tagName != "INPUT") this.target_element =
this.target_element.down("INPUT")

I think the might be that is that calling down() on an input element throws some
exception that prototype catches and hides.

Original comment by mike.nic...@gmail.com on 25 Feb 2008 at 2:34

GoogleCodeExporter commented 8 years ago
Thank you Mike for this suggestion.  I've applied your fix in trunk, and it 
will get included with the next release 
of calendar date select.  Thanks!

Original comment by timchar...@gmail.com on 28 Feb 2008 at 9:31

GoogleCodeExporter commented 8 years ago
That's great!  I didn't really test it for anything other than my application, 
so I
hope you're testing it.

I guess that makes this my first contribution to a (useful) oss project.

Original comment by mike.nic...@gmail.com on 29 Feb 2008 at 8:30

GoogleCodeExporter commented 8 years ago
I did test it, thank you :)  However, the fix was very sensible - I used have
probably implemented it that way to begin with.

Congrats on your first contribution :D

Tim

Original comment by timchar...@gmail.com on 2 Mar 2008 at 12:26