[kupu-checkins] r33868 - in kupu/trunk/kupu: common plone plone/tests

duncan at codespeak.net duncan at codespeak.net
Mon Oct 30 10:44:19 CET 2006


Author: duncan
Date: Mon Oct 30 10:44:17 2006
New Revision: 33868

Modified:
   kupu/trunk/kupu/common/kupuhelpers.js
   kupu/trunk/kupu/plone/html2captioned.py
   kupu/trunk/kupu/plone/tests/test_links.py
Log:
Missed one place for using name attribute on attributes.
Ignoring image tails in link checker wasn't working.


Modified: kupu/trunk/kupu/common/kupuhelpers.js
==============================================================================
--- kupu/trunk/kupu/common/kupuhelpers.js	(original)
+++ kupu/trunk/kupu/common/kupuhelpers.js	Mon Oct 30 10:44:17 2006
@@ -257,7 +257,7 @@
                 };
             };
             var name = child.nodeName.toLowerCase();
-            if (child.attributes[0] && /^_/.test(child.attributes[0])) {
+            if (child.attributes[0] && /^_/.test(child.attributes[0].name)) {
                 name += child.attributes[0].name.toLowerCase(); // Fix for Opera
             }
             if (dict[name] != undefined) {

Modified: kupu/trunk/kupu/plone/html2captioned.py
==============================================================================
--- kupu/trunk/kupu/plone/html2captioned.py	(original)
+++ kupu/trunk/kupu/plone/html2captioned.py	Mon Oct 30 10:44:17 2006
@@ -186,9 +186,13 @@
         self._firstoutput = False
         self.commit_changes = False
         self._objects = []
+        self.image_tails = []
 
-    def initFromRequest(self):
+    def initImageSizes(self):
         self.image_tails = self.tool._getImageSizes()
+
+    def initFromRequest(self):
+        self.initImageSizes()
         self.uids = None
         self.found = 0
         request = self.tool.REQUEST
@@ -416,6 +420,7 @@
             mutator = field.getMutator(object)
             if mutator:
                 mutator(newdata, mimetype='text/html')
+                object.reindexObject() # Need to flag update
 
         if info or changes:
             self.found += 1
@@ -529,7 +534,7 @@
                 # Allow image size modifiers on the end of urls.
                 p = absurl.split('/')
                 absurl = '/'.join(p[:-1])
-                if p[-1] in self.image_tails:
+                if '/'+p[-1] in self.image_tails:
                     tail = '/'+p[-1]+tail
                     c, uid, url, _ = self.classifyLink(absurl, base, first=False)
                     return c, uid, url, tail

Modified: kupu/trunk/kupu/plone/tests/test_links.py
==============================================================================
--- kupu/trunk/kupu/plone/tests/test_links.py	(original)
+++ kupu/trunk/kupu/plone/tests/test_links.py	Mon Oct 30 10:44:17 2006
@@ -225,6 +225,7 @@
     def test_image(self):
         self.setup_content()
         migrator = Migration(self.kupu)
+        migrator.initImageSizes()
         portal = self.portal
         base = portal.folder.alpha.absolute_url()
         path = 'gamma/image_thumb'


More information about the kupu-checkins mailing list