create new tag
, view all tags
The attached patch collects common code from the "register" and "edit" scripts and creates a new function in TWiki.pm that fulfils the function of the common code. The common code in question is the code that expands the DATE, USERNAME, WIKINAME, WIKIUSERNAME, URLPARAM, and NOP pseudo-constants.

This is step 1 of the refactoring; step 2 requires that the function thus created be published via the PluginsAPI. However since no-one seems interested in the plugins API, I haven't bothered with that step.

-- CrawfordCurrie - 09 Mar 2004

Thanks Crawford, this makes the code cleaner.

-- PeterThoeny - 10 Mar 2004

OK, this is now in TWikiAlphaRelease. Notice that it took me one hour to test, debug and fix these issues:

  • New topics showed up blank since TWiki::expandVariablesOnTopicCreation did not return anything
  • New registrations showed up blank since the expandVariablesOnTopicCreation function call in register did not assign $text
  • New registrations did not account for the different handling of users in the two registration forms
  • New registrations did not expand the three user variables to the correct user
  • The pod doc in expandVariablesOnTopicCreation did not have the required empty lines to separate pod paragraphs

Please test your patches before proposing it, or add a note that it is untested code.

-- PeterThoeny - 10 Mar 2004

Oh blast. Profuse apologies, Peter, I realise now I uploaded the wrong patch file (patch.dat instead of patch.dif). If one of my patches doesn't work first time, out of the box, please bounce it! I always test as thoroughly as I can. I had already detected and corrected the above issues, though I hadn't spotted the pod doc problem.

But I'm puzzled; the changes don't seem to be in CVS. Is there maybe a time-lag?

-- CrawfordCurrie - 10 Mar 2004

yeah, sourceforge has a 1 day delay for anonymous cvs access frown

-- SvenDowideit - 10 Mar 2004

TopicClassification PatchAccepted
TopicSummary Code refactoring - does not impact end users. Refactor variable expansion for edit and register

AssignedTo CrawfordCurrie
AssignedToCore PeterThoeny
ScheduledFor CairoRelease

SpecProgress 100%
ImplProgress 100%
DocProgress 100%
Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatdat patch.dat r1 manage 3.7 K 2004-03-09 - 17:38 CrawfordCurrie Unified diffs.
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2004-08-20 - CrawfordCurrie
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2015 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.