On Mon May 05 11:13:16 2008, MARKSTOS wrote:
Show quoted text> The patch for this introduced a new bug, which is filed here:
>
http://rt.cpan.org/Ticket/Display.html?id=35607
>
> It would be good to double-check my refinement of the patch submitted in
> that ticket to confirm it doesn't re-open this defect.
After spending hours working with the effects of this patch, I have
reverted it in my copy and have come to the conclusion that it should be
reverted upstream as well, for two reasons.
1. Clearly, it introduced at least one other bug, as I tried to address
in RT#35607. This patch should be re-introduced with at least one
automated test to confirm it works as expected.
2. The patch itself introduces a regression of sorts (separate from
RT#35607, I think). Before if there were multiple select forms with the
same name, it worked to just say "fill in that select form with this
value". I suppose since all the <selects> were accidentally lumped
together, it just worked. With the patch applied, code that targeted a
form that was not first now breaks with an "illegal value" error.
I'm not opposed to telling people "You need to update your code because
we started working more correctly." However, for this issue there is no
easy path forward unless you know exactly by number which <select> form
you want to submit to, which I didn't in my application.
One possible solution to further extend "find_input" so it can find an
input where a value is a possible input. Without something this, other
people who upgrade LWP will be stuck like I was when their code starts
breaking and there's not a clear way to fix it.
In short, we should able to express the following:
"Find the <select> tag with this name which accepts this value"
I've also added a "wish" in Mechanize to support a fix at that level,
but having a smarter find_input() would certainly be helpful.
(
http://code.google.com/p/www-mechanize/issues/detail?id=51 )
In the meantime, I do advocate reverting this patch.
Mark