• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item4609: state updates with Explorer don't work

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension ActionTrackerPlugin Normal Closed   n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

Hello,

Yesterday I installed this plugin in our TWiki. I noticed that with Firefox works very well, but with Explorer 6 and 7 direct state updates don't work at all.

After some debugging I think that the problem are the options values, Explorer left empties while Firefox takes Text values.

I have patched the file Action.pm adding options values and encoding url because we have spanish words with specials characters and doesn't work well too.

Functions modified:

sub _formatField_state_original {
    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; # <--- THIS
        $input .= CGI::option(\%attrs, $option);
    }
    return CGI::Select(
        {   
            onChange => 'atp_update(this, "%SCRIPTURLPATH{rest}%/ActionTrackerPlugin/update?topic='.
              $this->{web}.'.'.CGI::escape($this->{topic}).  # <--- THIS
                ';uid='.$this->{uid}.'", "state")',
            class => 'atpState'.$this->{state},
        },
        $input);
}

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; 
# <--- THIS        $attrs{value} = $option; 
# <--- THIS        $attrs{value} = $option; 
# <--- THIS        $attrs{value} = $option; 
# <--- THIS

        $input .= CGI::option(\%attrs, $option);
    }
    return CGI::Select(
        {   
        onChange => 'atp_update(this, "%SCRIPTURLPATH{rest}%/ActionTrackerPlugin/update?topic='.
              $this->{web}.'.'.CGI::escape($this->{topic}). 
# <--- THIS              $this->{web}.'.'.CGI::escape($this->{topic}). 
# <--- THIS              $this->{web}.'.'.CGI::escape($this->{topic}). 
# <--- THIS              $this->{web}.'.'.CGI::escape($this->{topic}). 
# <--- THIS

                ';uid='.$this->{uid}.'", "state")',
            class => 'atpState'.$this->{state},
        },
        $input);
}

I don't know if It is this the place for tell this, sorry afterwards.

Thank you for this fantastic plugin (and for TWiki too). wink

Regards.

-- TWiki:Main/JoaquinBuendia - 11 Sep 2007

Explorer doesn't working, Firefox works perfect but I can't do that Explorer changes the state of the tasks. Sometimes Explorer do it but after somes changes don't.

Any ideas?

Thank you

-- TWiki:Main.JoaquinBuendia - 11 Sep 2007

The problem with Explorer is the cache. After two first changes, explorer gets content from cache because urls are the same before that.

There are almost 4 solutions to this, but I think that the more simple is adding a new parameter with a random value in the javasctipt file atp.js: [...] url = ";field=" field; url = ";value=" element.value; url = ";nocache=" parseInt( Math.random() * 10000000000 ); xml.open("GET", url, true); [...]

Other solution is open url with POST method (requires more changes), adding custom header in server script with instructions for don't cache (possibly the best solution) the content and last change options in Explorer for always test new content with all pages (it's not sound much eficient, isn't it?).

Link about Explorer solutions (spanish):

http://www.formatoweb.com.ar/ajax/cache_y_refresco_de_datos.php

Now, plugin works very well !!! big grin

Regards!!!

-- TWiki:Main.JoaquinBuendia - 12 Sep 2007

[...]

url = ";field=" field;

url = ";value=" element.value;

url = ";nocache=" parseInt( Math.random() * 10000000000 );

xml.open("GET", url, true);

[...]

-- TWiki:Main.JoaquinBuendia - 12 Sep 2007

OK, good solution. I will incorporate it when i get a chance.

Later: Done, thanks Joaquin

CC

ok, not at all. wink

-- TWiki:Main.JoaquinBuendia - 12 Sep 2007

ItemTemplate
Summary state updates with Explorer don't work
ReportedBy TWiki:Main.JoaquinBuendia
Codebase 4.1.2
SVN Range TWiki-4.2.0, Sat, 08 Sep 2007, build 14780
AppliesTo Extension
Component ActionTrackerPlugin
Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:14835
TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r7 - 2007-09-12 - JoaquinBuendia
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback