--
TWiki:Main/JoaquinBuendia
- 17 Sep 2007
With Firefox (and possibly with others) direct updates works very well (AJAX), but with Explorer the url is not constructed well, because explorer left empty the value option field (don't get value from option text like Firefox).
URL from Firefox:
/twiki/bin/rest/ActionTrackerPlugin/update?topic=Main.WebHome;uid=000014;field=state;value=closed
URL with Explorer:
/twiki/bin/rest/ActionTrackerPlugin/update?topic=Main.WebHome;uid=000014;field=state;value=
Because of this, updates don't working with Explorer.
Solution:
Add value to option in the select in
twiki/lib/TWiki/Plugins/ActionTrackerPlugin/Action.pm:
[...]
$attrs{selected} = 'selected' if ($option eq $this->{state});
$attrs{value} = $option; # <---- ADD THIS
$input .= CGI::option(\%attrs, $option);
[...]
Action.pm:
sub _formatField_state {
my ( $this, $args, $asHTML ) = @_;
return $this->{state} unless $asHTML;
return $this->{state} unless $this->{uid};
# SMELL: assumes a prior call has loaded the options
require TWiki::Plugins::ActionTrackerPlugin::Options;
return $this->{state} unless
$TWiki::Plugins::ActionTrackerPlugin::Options::options{ENABLESTATESHORTCUT};
my $input = '';
foreach my $option (@{$types{state}->{values}}) {
my %attrs;
$attrs{selected} = 'selected' if ($option eq $this->{state});
$attrs{value} = $option;
$input .= CGI::option(\%attrs, $option);
}
return CGI::Select(
{
onChange => 'atp_update(this, "%SCRIPTURLPATH{rest}%/ActionTrackerPlugin/update?topic='.
$this->{web}.'.'.$this->{topic}.
';uid='.$this->{uid}.'", "state")',
class => 'atpState'.$this->{state},
},
$input);
}
With this modification, the plugin works very well.
Regards.
Joaquin.
Many thanks, Joaquin, and sorry for taking so long to get to it. Fixed in the next release of the plugin.
--
CrawfordCurrie - 13 Apr 2008