You are here: Foswiki>Tasks Web>Item926 (28 Feb 2009, KennethLavrsen)Edit Attach

Item926: Foswiki.spec {AccessibleENV} must list FOSWIKI_ACTION instead of TWIKI_ACTION

Priority: Normal
Current State: Closed
Released In: 1.0.1
Target Release: patch
Applies To: Engine
Reported By: GilmarSantosJr
Waiting For:
Last Change By: KennethLavrsen
Foswiki.spec file cites TWIKI_ACTION in $Foswiki::cfg{AccessibleENV}. It should be FOSWIKI_ACTION.

Besides fixing this, should we add some code to TCP?

-- GilmarSantosJr - 31 Jan 2009


-- CrawfordCurrie - 01 Feb 2009

Funny, TCP is supposed to be made in France, but I've never heard of it. Most probably it was too crappy for us so we sent it over the channel smile

Anyway, I agree with Gilmar, we should change TWIKI_ACTION to FOSWIKI_ACTION, and put a link back in TCP

-- OlivierRaginel - 01 Feb 2009

I thought a little about this and I think it's better to add a note to upgrade guide, instructing users to update their config. What do you think?

-- GilmarSantosJr - 16 Feb 2009

Upgrade as fix is a bit geeky. I'll almost rather just bite the bullet and have it in the standard setting. It cannot really harm anything even when you do not run with T compatibility.

But what is it used for? Where is it needed?

-- KennethLavrsen - 27 Feb 2009

It's just that if you've got plugins (can't figure of an example right now, sorry) that relies on TWIKI_ACTION instead of the new FOSWIKI_ACTION, it won't work, as TWikiCompatibilityPlugin doesn't expose this, and this fix removes it from the list of variables exposed to the script.

It will be a simply /WIKI/s/T/FOS/ (today I like sed) for all the incriminated topics.

So if you try
= 'view', it should work, but
= '' will always return empty.

Gilmar thought, and I tend to agree, that it's better to warn users when upgrading, and ensuring that they'll find an easy fix with the error message they're likely to get.

I honestly can't figure of a use for this anyway. Usually, this parameter is set through the bin script, and accessed through the %ENV hash. Why on Earth would someone want to use Foswiki::ENV() or %ENV{'TWIKI_ACTION'}?

I'd simply remove that from the list, but hey, I don't know all twisted ways one can use our wiki smile

-- OlivierRaginel - 27 Feb 2009

i would simply leave TWIKI_ACTION is our mainline source code, at least for 1.0.x if it can't easily be added to TWikiCompatibilityPlugin (tho TCP would be the preferred route). by 1.1, it can be removed as "everything" should be converted to rest handlers and obviate the need for the separate bin scripts.

right now, it seems like 1.0.3 will be released without TWIKI_ACTION and no other automatic way of it "simply working" out of the box. that is bad.

-- WillNorris - 27 Feb 2009

If you haven't understood my comment and the 2 verbatim boxes, please check Foswikitask:Item926 vs the same think on trunk

"Old" code should show
%ENV{"TWIKI_ACTION"}% = 'not set'

Whereas new code (trunk) should show:
%ENV{"FOSWIKI_ACTION"}% = 'view'

But I really have no idea how one could use that.

Which I tried to explain to WillNorris on IRC

-- OlivierRaginel - 27 Feb 2009

Gilmar. Why did you raise the bug report?

Do you know of a single example where an extension uses TWIKI_ACTION?

-- KennethLavrsen - 27 Feb 2009

Did a search in the entire SVN tree for TWIKI_ACTION.

I tried both in Foswiki and TWiki trunk.

One extension showed up: SendEmailPlugin/bin/sendemail-5

So let us fix that one extension instead by porting it to Foswiki and leave this bug as Closed with the fix already

-- KennethLavrsen - 27 Feb 2009

and what of "all" of the plugins in the wild? we should only break this compatibility with 1.1

that's why i think this bug should read "Foswiki.spec {AccessibleENV} must list FOSWIKI_ACTION instead of in addition to TWIKI_ACTION"

-- WillNorris - 27 Feb 2009

TWIKI_ACTION never existed in a TWiki release. It was something only present in the trunk.

One plugin SendEmailPlugin had a sendemail-5 script that was prepared to work in the trunk. But noone in the wild will have needed this environmet variable for an extension used in any production TWiki.

-- KennethLavrsen - 28 Feb 2009

ok, agreed.

-- WillNorris - 28 Feb 2009

The TWIKI_ACTION variable was added as a helper to make old twiki trunk work with ShorterUrl (See There was a talk at twiki-dev and Crawford suggested to expose the variable through {AccessibleENV}, so template developers could use .

It was never released, until we released 1.0.0 without renaming this variable. Then people already have it written to LocalSite.cfg. Now Foswiki.spec is updated, but how to update LocalSite.cfg?

Personally I don't have reasons to have FOSWIKI_ACTION exposed.

Some questions:
  • Do we really need FOSWIKI_ACTION exposed?
  • If so, how to handle the "legacy" LocalSite.cfg?

-- GilmarSantosJr - 28 Feb 2009

I saw that problem comming.

And for that reason the upgrade description on the 1.0.3 download page has an additional step to change the LocalSite.cfg to change this detail.

Best we can do. If people do not do this - 99% will not know what they missed

-- KennethLavrsen - 28 Feb 2009

ItemTemplate edit

Summary Foswiki.spec {AccessibleENV} must list FOSWIKI_ACTION instead of TWIKI_ACTION
ReportedBy GilmarSantosJr
Codebase 1.0.0, trunk
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Priority Normal
CurrentState Closed
Checkins distro:082f3d6edd04 distro:e679301fdae3 distro:f21c36062273
TargetRelease patch
ReleasedIn 1.0.1
Topic revision: r21 - 28 Feb 2009, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy