#foswiki 2016-04-02,Sat

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)

WhoWhatWhen
gac410rouilj1: I'm testing it now [00:02]
rouilj1: I've tested your example %REDIRECT{"SomeTopic"}% ... works on both NagHostfred and NagHostfred-dmz [00:08]
rouilj1hmm, foswiki 2.x? [00:13]
gac410I'm testing it on Foswiki 2.1+, RedirectPlugin version 1.12. (released in July 2015) [00:13]
rouilj1ok, that's likely the same redirect plugin version I have. I'll have to dig then. [00:13]
gac410There is really not too much to the plugin. Not sure why the from topic would matter. [00:13]
rouilj1thanks for testing.
Yeah, I am stumped.
[00:13]
gac410The plugin only asks core foswiki to issue a 302 return with a new location. [00:17]
rouilj1Yeah, I am not sure if something is stopping the 302 or if the source page name is a red herring in some manner. [00:18]
gac410My 1.1.9 system is pretty messed up ... New perl and new cgi has broken everything. :( [00:19]
rouilj1I lterally renamed a page from NagHostvlm-00-ah to aomething without the - and it worked.
so NagHostvlm-00-ah fails to rediect while NagHostvlm00ah redirects.
rouilj1 scratches head.
[00:19]
gac410well, got it installed on my 1.1.9 system, managed to get it running after patching configure and a few other things. :(
Redirects fine. Used your topics NagHostvlm-00-ah and NagHostvlm00ah Both work.
[00:28]
rouilj1hmm ok, so maybe I need to look at perl/os or soemthing as well. AFAIK none of the code touching that path has been patched.
afk
[00:30]
gac410no idea. First I'd visit the topic that fails to redirect, and look at it with web developer tools / network console.
Does foswiki issue a 302 status with a valid location
Is your site public?
[00:31]
rouilj1I don;t think I get a 302 at all. I need to load the page with firebug enabled to see. No not public. [00:33]
......... (idle for 41mn)
ok this is odd. Looks like the return after '# do not redirect when we come from an edit' is triggering somehow and preventing the redirect. [01:14]
gac410strange. Can you dump out the contents of $ENV{HTTP_REFERER} [01:16]
rouilj1seems to be a space.
here is the funny part, if i rename the page, it redirects correctly.
hence the inital descripton of the problem
[01:16]
gac410That just makes no sense. Why on earth would the regex match $ENV{HTTP_REFERER} =~ /\edit\b/ [01:18]
rouilj1yeah no clue
tryng to dump headers in firebug now
[01:18]
gac410er.... hang on ... make the regex =~ /\bedit\b/
gac410 wondering why the \e is escaped, and what it is ... over to perldoc perlre
doh... never mind.
I must have deleted the b
[01:18]
rouilj1yeah I have \b word boundary in my regexps [01:20]
gac410right, loose nut behind keyboard I guess [01:20]
rouilj1looks like the referrer is: https://..../foswiki/bin/edit/NagiosSsg/?t=1459560101&onlynewtopic=on&TopicTitle=NagHostvlm-02-ah&templatetopic=&topic=NagHostvlm02Ah&topicparent=NagHostvlm-01-ah
which does inhibit the redirect.
So it looks like the issue occurs only if I keep using the window that is created after I do the edit/create of the new page.
Any idea why that clause is there? If I put in a redirect, after I save the page I do expect to be redirected to the new page.
[01:24]
gac410No idea.
Let me check history
MichaelDaum added that check in Item12744 ... no idea why.
[01:28]
FoswikiBothttp://foswiki.org/Tasks/Item12744 [ Item12744: don't redirect coming from an edit ] [01:29]
gac410Not exactly a wealth of information in that task. [01:30]
rouilj1yeah. Maybe Mchal will chime in on the rationale for that.
Michael that is.
It looks like the bottom of the redirected page when using the nat skin gets a nice little link to allow you to edit the original page. So I don't see why that task was needed.
[01:31]
.... (idle for 15mn)
GithubBot[distro] gac410 pushed 1 new commit to master: https://git.io/vVlg1
distro/master feed245 George Clark: Item13883: Major typo in VarSEARCH...
[01:50]
***GithubBot has left [01:50]
FoswikiBothttp://foswiki.org/Tasks/Item13883 [ Item13883: Documentation changes for master and 2.1 ] [01:50]
GithubBot[distro] gac410 pushed 1 new commit to Release02x01: https://git.io/vVlgH
distro/Release02x01 322dc1e George Clark: Item13883: Major typo in VarSEARCH...
[01:51]
***GithubBot has left [01:51]
............ (idle for 59mn)
rouilj1Hmm, have another oddness. I have three set commands:
* Set redirfrom = %URLPARAM{"redirectedfrom" default="NagHostunknown"}%
* Set redirhost = %CALC{"$REPLACE(%redirfrom%, 1, $EVAL($FIND(NagHost,%redirfrom%) + 6 ))"}%
* Set Thishostname = %URLPARAM{"host" default="%redirhost%"}%
The url has ?redirectedfrom=Myweb.NagHostvxx-09-dc. %redirfrom% is Myweb.NagHostvxx-09-dc, %redirhost% is vxx-09-dc. Somehow %Thishostname% ends up being displayed as %CALC{ and not vxx-09-dc A similar thing happens when I have no redirectedfrom set in theurl.
[02:50]
gac410%CALC is a "special" macro - expanded in a different order. [02:54]
rouilj1it's almost like the sets don't evaluate the macros, and instead set the strings literally. Then when displayed the macros take effect.
ah
[02:54]
gac410Right. Set does not evaluate the macros. [02:54]
rouilj1so %calc isn;t expanded inside out and is left in an unexpanded state
breaking the urlparam
thoughts for a workaround? This is 1.9 foswiki so I don;t think I have calculate which IIRC does eval in the expected order right?
[02:55]
gac410CALC is expanded in a commonTagsHandler,
It's not a "registered" tag so it's not processed in the normal macro order. However latest SpreadSheetPlugin also has a CALCULATE macro that is a registred tag.
Sets are set during initial topic read. They become part of the foswiki preference variables. when the topic is *rendered*, then the macros are expanded, including the preference macros
[02:56]
rouilj1yeah in my version of spreadsheet I don't have the calculate tag. Is it safe to update the spreadsheet plugin from foswiki in a 1.9 release? Last time I updated plugins was just after 2.0 was released and things kind of broke. [02:59]
gac410So the redirfrom, redirhost and thishostname are all picked up literally into the preferences, when the are then used they expand, and then render inside-out etc. [02:59]
rouilj1yup, I understand now why it's broke. I was sort of 90% of the way to that explanation on my own. [03:00]
gac410I'm not really sure. 1.1.9 is getting old. :( [03:00]
rouilj1yeah. I have a project to migrate to 2.x but it's stalled for other tasks. [03:01]
gac410We did install all the 2.0 extensions on foswiki.org 1.1.9 system early on, to test.
I just installed latest SpreadSheetPlugin from Foswiki.org on my test 1.1.9 system. Seems to work. but not much testing ;)
Another way to do this, is to use %CALC $Set and $Get for your variables. Don't use preferences.
Be careful if your server gets maintenance. 1.1.9 falls apart if CGI is updated, or recent Perl versions, etc.
[03:01]
rouilj1so rather than: Set redirhost = %CALC{"$REPLACE(%redirfrom%, 1, $EVAL($FIND(NagHost,%redirfrom%) + 6 ))"}% somethng like $SET(redirhost, $REPLACE ....)
I run centos so
[03:05]
gac410Foswiki:Extensions/Testing/PatchRelease01x01Contrib will back-port all the perl / cgi / fixes from 2.x into 1.1.9 [03:06]
FoswikiBothttp://foswiki.org/Extensions/Testing/PatchRelease01x01Contrib [ PatchRelease01x01Contrib < Extensions/Testing < Foswiki ] [03:06]
rouilj1yup
if I use $SET, I have to use $GET and %CALC to get the varable back right? %redirhost% isn't populated by the $SET
[03:06]
gac410right.
I'd just try to get all the calculations into one CALC. You could then but that one macro into a preference, rather than using 3 prefs
Maybe I'm steering you wrong. just thinking out loud
[03:09]
rouilj1I tried doing that intially, looked like quoting etc was failing, so I bloke it out to try to debug it.
bloke -> broke
[03:11]
gac410y, quoting and escaping can get rather insane [03:12]
rouilj1yeah I need to use the %Thishostname% as an argument to %INCLUDE, but it looks like the calc is getting evaluated too late, so it's searching the included page for %CALC and not he variable value. [03:15]
gac410I *think* latest spreadsheet plugin is safe. We made one security change though, it no longer can output html, without setting a preference. [03:16]
rouilj1ok, let me try to get into configure mode and download the spreadheet plugin. I think you are right I need calculate here. [03:16]
........ (idle for 35mn)
gack410, the upgrade is in place and it seems to be working. thx, [03:51]
............ (idle for 59mn)
***gac410 has left [04:50]
...................................................................................................... (idle for 8h27mn)
ChanServ sets mode: +o gac410 [13:17]
........ (idle for 36mn)
ChanServ sets mode: +o Lynnwood [13:53]
......................................................................................... (idle for 7h23mn)
MikeofManyWorking with port based vhosts, any ideas why the ClassificationPlugin would fail on the necessary forms? [21:16]

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)