You are here: Foswiki>Tasks Web>Item11150 (18 Oct 2015, MichaelDaum)Edit Attach

Item11150: Auto*TemplatePlugins can't see Meta of being-created topics

pencil
Priority: Enhancement
Current State: Confirmed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: AutoViewTemplatePlugin
Branches: master
Reported By: MartinCleaver
Waiting For:
Last Change By: MichaelDaum
In AutoViewTemplatePlugin & AutoTemplatePlugin - during the creation of a new topic of a given type/form, Foswiki does not recognize that the new topic is using a form, so the EditTemplate doesn't apply.

But, it should apply: if it should applies during edit it should equally apply create

http://irclogs.foswiki.org/bin/irclogger_log/foswiki?date=2011-09-27,Tue&sel=19#l15


pharvey   MartinCleaver: you are correct, it should. I remember having this problem, is there a task open? 
a temporary work-around is to add ?template=The.EditTemplate   [00:53]
MartinCleaver   No, I have looked for one. I'm trying to fix the issue at the mo. 
MartinCleaver will try that   [00:54]
pharvey   really needs a task + unit test 
skin templates are way too magical 
Item8249 looks related   [00:54]
FoswikiBot   http://foswiki.org/Tasks/Item8249 [ Item8249: AutoViewTemplatePlugin: changing the form does not switch the EDIT_TEMPLATE ]   [00:55]
MartinCleaver   MartinCleaver nods   [00:56]
pharvey   perhaps re-open that task   [00:56]
MartinCleaver   not really the same (?)   [00:57]
pharvey   well, if you create a new one, please reference it. I have a feeling we're doing a $topicObject->get('FORM')->{name} which of course will return nothing on a not-yet-created topic   [00:57]
MartinCleaver   y, that's exactly what we are doing   [00:58]
pharvey   also true if you switch forms, you'll get stale form name instead of the one you switched to   [00:58]
MartinCleaver   I just hacked the form name in, and it works fine thereonin   [00:58]
pharvey   so both these scenarios need better handling   [00:58]
MartinCleaver   y, the 2nd is MichaelDaum's 8249   [00:58]
pharvey   it seems we never addressed the problem 
at least not in AutoView 
maybe Micha fixed it in AutoTemplate   [00:59]
MartinCleaver   Y, good point - I should switch to that and see if it works any differently 
ok - I have to go 
thanks pharvey

-- MartinCleaver - 26 Sep 2011

MartinCleaver   For an unsaved topic, how should a plugin determine which form is in use?
gac410   MartinCleaver: Shouldn't that be stored in the meta object passed to the handlers?   
MartinCleaver   gac410: the meta object is passed in on the *Handler calls. But, Auto*TemplatePlugins do all their work during initPlugin 
e.g. AutoTemplatePlugin.pm
around line 49 - it checks the disk for the topic. But there is no topic for during create. 
oh - I guess Foswiki::Func   [14:34]
gac410   Yeah - there is no meta object during initPlugin yet I don't think anyway. 

-- MartinCleaver - 27 Sep 2011

See also Support.Question618

-- PaulHarvey - 28 Sep 2011

Above support question has got the workaround. Not sure why we don't auto-template when creating a new topic, but most probably because it is more difficult.

-- MichaelDaum - 28 Sep 2011

This has been fixed for AutoTemplatePlugin by reading a formtemplate url parameter. Same fix should be doable for AutoViewTemplatePlugin.

-- MichaelDaum - 18 Oct 2015
 

ItemTemplate edit

Summary Auto*TemplatePlugins can't see Meta of being-created topics
ReportedBy MartinCleaver
Codebase
SVN Range
AppliesTo Extension
Component AutoViewTemplatePlugin
Priority Enhancement
CurrentState Confirmed
WaitingFor
Checkins AutoTemplatePlugin:ccddfb36e936
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches master
trunkCheckins
masterCheckins AutoTemplatePlugin:ccddfb36e936
ItemBranchCheckins
Release01x01Checkins
Topic revision: r6 - 18 Oct 2015, MichaelDaum
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