Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

Re: Disabling "Expand macros when editing"

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


m.van.rees at zestsoftware

Sep 4, 2009, 3:19 AM

Post #1 of 5 (1863 views)
Permalink
Re: Disabling "Expand macros when editing"

Damon Butler, on 2009-09-03:
> Hi,
>
> We just recently upgraded from various installations of Zope 2.7/2.9 to
> Zope 2.10. The page template feature "Expand macros when editing" is
> causing us major headaches. It is checked on by default, and as a
> result, the instant we wish to view the source code of any ZPT, it has
> been mangled into "expanded" form before we have a chance to do anything
> to it.
>
> THIS IS BAD!
>
> How can we turn this feature off globally? Right now, it is flatly
> impossible for us to edit most of our ZPTs because the instant we even
> look at them they are mangled. We can't even uncheck the option without
> saving the mangled version.
>
> It's Catch-22 of the worst sort. Please help!

I created a fresh Zope 2.10.9 instance. This option is not checked by
default. But when you check it and save the form it remains checked
for that template.

Try appending ?expand:int=0 to the url. That does the trick for me.

--
Maurits van Rees | http://maurits.vanrees.org/
Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]

_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )


damon at hddesign

Sep 4, 2009, 7:37 AM

Post #2 of 5 (1750 views)
Permalink
Re: Disabling "Expand macros when editing" [In reply to]

Maurits van Rees wrote:
> Damon Butler, on 2009-09-03:
>> Hi,
>>
>> We just recently upgraded from various installations of Zope 2.7/2.9 to
>> Zope 2.10. The page template feature "Expand macros when editing" is
>> causing us major headaches. It is checked on by default, and as a
>> result, the instant we wish to view the source code of any ZPT, it has
>> been mangled into "expanded" form before we have a chance to do anything
>> to it.
>>
>> THIS IS BAD!
>>
>> How can we turn this feature off globally? Right now, it is flatly
>> impossible for us to edit most of our ZPTs because the instant we even
>> look at them they are mangled. We can't even uncheck the option without
>> saving the mangled version.
>>
>> It's Catch-22 of the worst sort. Please help!
>
> I created a fresh Zope 2.10.9 instance. This option is not checked by
> default. But when you check it and save the form it remains checked
> for that template.
>
> Try appending ?expand:int=0 to the url. That does the trick for me.
>

Thanks for the reply, Maurits. However, your URL trick makes absolutely
no difference whatsoever. The ZPT code has already been "expanded" even
when we avoid the ZMI and access the ZPT by putting the URL to the ZPT
object -- with your query parameter -- into our browser.

We are currently using Zope 2.10.6. Has this problem been fixed with
Zope 2.10.9?

I simply cannot believe that there is NO WAY to turn this option off.
How silly is it that it appears to be literally impossible to view the
original source code for a ZPT?!

--Damon
_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )


lists at zopyx

Sep 4, 2009, 7:41 AM

Post #3 of 5 (1750 views)
Permalink
Re: Disabling "Expand macros when editing" [In reply to]

On 04.09.09 16:37, Damon Butler wrote:
> Maurits van Rees wrote:
>
>> Damon Butler, on 2009-09-03:
>>
>>> Hi,
>>>
>>> We just recently upgraded from various installations of Zope 2.7/2.9 to
>>> Zope 2.10. The page template feature "Expand macros when editing" is
>>> causing us major headaches. It is checked on by default, and as a
>>> result, the instant we wish to view the source code of any ZPT, it has
>>> been mangled into "expanded" form before we have a chance to do anything
>>> to it.
>>>
>>> THIS IS BAD!
>>>
>>> How can we turn this feature off globally? Right now, it is flatly
>>> impossible for us to edit most of our ZPTs because the instant we even
>>> look at them they are mangled. We can't even uncheck the option without
>>> saving the mangled version.
>>>
>>> It's Catch-22 of the worst sort. Please help!
>>>
>> I created a fresh Zope 2.10.9 instance. This option is not checked by
>> default. But when you check it and save the form it remains checked
>> for that template.
>>
>> Try appending ?expand:int=0 to the url. That does the trick for me.
>>
>>
> Thanks for the reply, Maurits. However, your URL trick makes absolutely
> no difference whatsoever. The ZPT code has already been "expanded" even
> when we avoid the ZMI and access the ZPT by putting the URL to the ZPT
> object -- with your query parameter -- into our browser.
>
> We are currently using Zope 2.10.6. Has this problem been fixed with
> Zope 2.10.9?
>
> I simply cannot believe that there is NO WAY to turn this option off.
> How silly is it that it appears to be literally impossible to view the
> original source code for a ZPT?!
Bugs that are not reported in the bugtracker can not be fixed :-)

-aj
Attachments: lists.vcf (0.31 KB)


m.van.rees at zestsoftware

Sep 4, 2009, 2:50 PM

Post #4 of 5 (1763 views)
Permalink
Re: Disabling "Expand macros when editing" [In reply to]

Andreas Jung, on 2009-09-04:
> On 04.09.09 16:37, Damon Butler wrote:
>> Thanks for the reply, Maurits. However, your URL trick makes absolutely
>> no difference whatsoever. The ZPT code has already been "expanded" even
>> when we avoid the ZMI and access the ZPT by putting the URL to the ZPT
>> object -- with your query parameter -- into our browser.
>>
>> We are currently using Zope 2.10.6. Has this problem been fixed with
>> Zope 2.10.9?

Hm, my trick works in 2.10.9, but I see that in Zope 2.10.6 it has no
effect, like you say. And using expand macros in 2.10.6 indeed has
deadly results...

>> I simply cannot believe that there is NO WAY to turn this option off.
>> How silly is it that it appears to be literally impossible to view the
>> original source code for a ZPT?!
>
> Bugs that are not reported in the bugtracker can not be fixed :-)

Looks like this *was* reported earlier and already fixed in Zope
2.10.7. :-) The changelog says:

Launchpad #262313: respect the Expand macros when editing flag when
editing a page template through the ZMI

So Daymon: please switch to 2.10.7 or later.

--
Maurits van Rees | http://maurits.vanrees.org/
Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]

_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )


chris at simplistix

Sep 7, 2009, 4:46 AM

Post #5 of 5 (1716 views)
Permalink
Re: Disabling "Expand macros when editing" [In reply to]

Maurits van Rees wrote:
> Looks like this *was* reported earlier and already fixed in Zope
> 2.10.7. :-) The changelog says:
>
> Launchpad #262313: respect the Expand macros when editing flag when
> editing a page template through the ZMI
>
> So Daymon: please switch to 2.10.7 or later.

I've been bitten by this too, in Zope 2.12 ;-)

I think the problem is that Zope *used* to ignore the .expand attribute,
but now doesn't.

I solved this problem with a script as follows:

for pt in app.ZopeFind(app,
obj_metatypes=('Page Template'),search_sub=1):
pt.expand=0

Put that in `somefile.py` in your zope instance and then do:

bin/zopectl run somefile.py

hth,

Chris

_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.