[Testbot] Plone 4.3 - Python 2.6 - Build # 1971 - Fixed! - 0 failure(s)

jenkins at plone.org jenkins at plone.org
Wed Apr 9 19:47:43 UTC 2014


-------------------------------------------------------------------------------
Plone 4.3 - Python 2.6 - Build # 1971 - Fixed!
-------------------------------------------------------------------------------

http://jenkins.plone.org/job/plone-4.3-python-2.6/1971/


-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------

Repository: plone.outputfilters
Branch: refs/heads/master
Date: 2014-04-09T20:13:25+01:00
Author: Anthony Gerrard () <anthonygerrard at gmail.com>
Commit: https://github.com/plone/plone.outputfilters/commit/15b95b3e3f2f4716fac096969db819e55ee5c809

#12783 img tag referencing non existent scales leads to transform error

Files changed:
M CHANGES.txt
M plone/outputfilters/filters/resolveuid_and_caption.py
M plone/outputfilters/tests/test_resolveuid_and_caption.py

diff --git a/CHANGES.txt b/CHANGES.txt
index 1acebed..b069fb8 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -4,7 +4,8 @@ Changelog
 1.13 (unreleased)
 -----------------
 
-- Nothing changed yet.
+- #12783 img tag referencing non existent scales leads to transform error
+  [anthonygerrard]
 
 
 1.12 (2014-01-27)
diff --git a/plone/outputfilters/filters/resolveuid_and_caption.py b/plone/outputfilters/filters/resolveuid_and_caption.py
index bb2ad6c..0a451a4 100644
--- a/plone/outputfilters/filters/resolveuid_and_caption.py
+++ b/plone/outputfilters/filters/resolveuid_and_caption.py
@@ -237,8 +237,6 @@ def traverse_path(base, path):
             if fullimage is None:
                 return None, None, src, description
             image = traverse_path(fullimage, subpath[pos + 1:])
-            if image is None:
-                return None, None, src, description
         else:
             stack = traversal_stack(base, subpath)
             if stack is None:
@@ -252,7 +250,10 @@ def traverse_path(base, path):
                     if hasattr(aq_base(parent), 'tag'):
                         fullimage = parent
                         break
-
+        
+        if image is None:
+            return None, None, src, description
+        
         url = image.absolute_url()
         if isinstance(url, unicode):
             url = url.encode('utf8')
diff --git a/plone/outputfilters/tests/test_resolveuid_and_caption.py b/plone/outputfilters/tests/test_resolveuid_and_caption.py
index ebfb71f..7f7ae41 100644
--- a/plone/outputfilters/tests/test_resolveuid_and_caption.py
+++ b/plone/outputfilters/tests/test_resolveuid_and_caption.py
@@ -353,6 +353,14 @@ def test_image_captioning_resolveuid_no_scale_plone_namedfile(self):
     def test_image_captioning_bad_uid(self):
         text_in = """<img src="resolveuid/notauid" width="120" height="144" start="fileopen" alt="Duncan's picture" class="image-left captioned" loop="1" />"""
         self._assertTransformsTo(text_in, text_in)
+        
+    def test_image_captioning_unknown_scale(self):
+        text_in = """<img src="resolveuid/%s/madeup" />""" % self.UID
+        self._assertTransformsTo(text_in, text_in)        
+
+    def test_image_captioning_unknown_scale_images_view(self):
+        text_in = """<img src="resolveuid/%s/@@images/image/madeup" />""" % self.UID
+        self._assertTransformsTo(text_in, text_in)        
 
     def test_image_captioning_external_url(self):
         text_in = """<img src="http://example.com/foo" class="captioned" />"""




-------------------------------------------------------------------------------


More information about the Testbot mailing list