[#1445 DTML does not work in edit previews] (new) DTML does not work in edit previews

[email protected] (Simon Michael) Fri, 06 Mar 2009 12:21:24 -0800
Newsgroups gmane.comp.web.zope.zwiki
Message-ID <F47405B2-B412-456E-891A-1EDDC7AD59B1__27067.7562141374$1236370987$gmane$org@joyful.com>
> I have another bug - this time in Preview mode where it isn't
> previewing correctly because the temporary page object isn't copying
> its attributes from its master page (e.g. "allow_dtml=1"). In
> common.py:renderText():
>
>      # make a new page object, like in create
>      p = page.__class__(__name__=page.getId())
>      p.title = page.pageName()
>      p = p.__of__(page.aq_parent)
>      p.setPageType(self.id())
>      p.setText(text)
>      return p.render(
>
> Here it sets up the temporary page object and it doesn't copy over
> attributes. Therefore, previewing a page with DTML enabled just for
> that page doesn't work.
>
> Fraid I have no idea how to copy across attributes in Zope.
> p.setattr('allow_dtml', page.getattr('allow_dtml',0)) is fairly
> obvious but I couldn't figure out how to iterate all attributes.


--
forwarded from http://zwiki.org/1445DTMLDoesNotWorkInEditPreviews#[email protected]