Forum OpenACS Q&A: /pvt/set-on-vacation-until.tcl problem

Collapse
Posted by Bob Fuller on
Not sure if this has been posted in SDM somewhere, or not. However, there's currently no "module" in SDM bug reports that looks like it covers /pvt, so I'm posting it here instead. (I was going to try SDM for the first time, but didn't find what I needed.) 😟

Currently, set-on-vacation-until.tcl does NOT work! The problem is with the "%5f" (underscore, in other words) characters that get sent via the GET request -- they get converted to "%255f". This is because they are represented as "%5f" within the "Confirm" page (/pvt/unsubscribe.tcl, that is) prematurely, if you look at View Source for that page. This error is most likely because the "ns_urlencode" procedure, called from philg_dateentrywidget (in /web/{server}/tcl/ad-utilities.tcl.preload), is being called prematurely.)

I didn't want to take a guess at fixing this by trying to alter philg_dateentrywidget , because I have no idea what else that would break. The fix for THIS particular Tcl script would probably be to have a philg_dateentrywidget procedure that doesn't make a call to [ns_urlencode $column], but instead uses just whatever's in the $column variable itself.

Collapse
Posted by Ola Hansson on
Hi Bob,

In fact I dont believe it's needed to modify any procedure.
It's funny because by coincidence I too stumbled into this error while looking for PG 7.1 UNION oddities (se this thread). All you should have to do is to modify one query in www/pvt/set-on-vacation-until.tcl:

ns_db dml $db "insert into user_vacations
(vacation_id, user_id, start_date, end_date, receive_email_p, vacation_type)
values 
(nextval(user_vacations_vacation_id_seq.nextVal, $user_id, sysdate, '$on_vacation_until', 'f', 'vacation')"


Should read:


ns_db dml $db "insert into user_vacations
(vacation_id, user_id, start_date, end_date, receive_email_p, vacation_type)
values 
(nextval('user_vacations_vacation_id_seq'), $user_id, sysdate(), '$on_vacation_until', 'f', 'vacation')"
Don Baccus received an email from me containing this fix and the query fixes made so far and hopfully they will "pass" and be committed to cvs in the future.
Collapse
Posted by Bob Fuller on
As far as I can tell, your fix works.  Thanks!  (At first, I didn't think it did work, but maybe I made a typo the first time around or something...)