"Copy to present" button doesn't drop _v_ attributes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Medium
|
Unassigned |
Bug Description
...which results in this buggy behaviour:
- edit a page template
- edit it again
- go to the history tab, and use the "Copy to present" button to bring
back your first edit.
On the edit tab, you will correctly see the text you brought back.
However, if you render the template, the old text will be used.
It's only if you "Save changes" that the copied-to-present text will
actually be used.
Marius says this is because the precompiled TAL bytecode is sitting there in a
_v_program attribute that's not stored in the ZODB, so it's not reverted
when you undo things.
How to fix? Make the "Copy to present" button drop all _v_* attributes
from the object it modifies.
This is OFS.History.
untested patch:
--- ./OFS/History.
+++ ./OFS/History.py 2010-09-28 02:12:00.043764683 +0300
@@ -151,6 +151,9 @@
base = aq_base(self)
+ for attr in dir(base):
+ if attr.startswith
+ delattr(base, attr)
Changed in zope2: | |
importance: | High → Medium |
Er, thanks for your assessment Hanno, but this is a confusing and uncalled for regression.
That ranks as High to me...