[Zope-dev] BUG: ValueError while changing height of the template edit window

Dmitry Vasiliev dima@hlabs.spb.ru
Tue, 10 Dec 2002 18:07:05 +0300


This is a multi-part message in MIME format.
--------------020509050700060603080406
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi All!

Zope 2.6: pressing of "Taller" or "Shorter" buttons of the page template 
edit window raises ValueError. Patch attached.

-- 
Dmitry Vasiliev (dima at hlabs.spb.ru)

--------------020509050700060603080406
Content-Type: text/plain;
 name="ZopePageTemplate.py.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ZopePageTemplate.py.diff"

Index: ZopePageTemplate.py
===================================================================
RCS file: /cvs-repository/Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py,v
retrieving revision 1.44
diff -u -r1.44 ZopePageTemplate.py
--- ZopePageTemplate.py	18 Sep 2002 15:12:46 -0000	1.44
+++ ZopePageTemplate.py	10 Dec 2002 14:33:43 -0000
@@ -155,8 +155,11 @@
             cols = min(cols, 100) # Max width 100%
             cols = "%d%%" % cols # Add percent sign back on
         else: # Absolute width
-            try: cols = int(width)
-            except: cols = max(40, int(dtpref_cols) + szchw.get(width, 0))
+            try:
+                cols = int(width)
+            except:
+                cols = max(40, int(dtpref_cols[:-1]) + szchw.get(width, 0))
+                cols = "%d%%" % cols # Add percent sign back on
 
         try: rows = int(height)
         except: rows = max(1, int(dtpref_rows) + szchh.get(height, 0))

--------------020509050700060603080406--