[Zope-CMF] Patch to make viewing portal instance quit Zope :-(

Chris Withers chrisw@nipltd.com
Thu, 31 May 2001 22:35:10 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_05C4_01C0EA21.F33B1610
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hi,

The attached patch is supposed to enable the paths specified in skin layers
to be of the form /folder/something/else rather than forcing them to be
contained within the skins tool.

However, all it succeeds in doing is causing Zope to GPF some time after
getSkinByPath returns.

Any idea what I'm doing wrong or why this is happening and how I should be
doing what I want to do?

cheers,

Chris

------=_NextPart_000_05C4_01C0EA21.F33B1610
Content-Type: application/octet-stream;
	name="SkinsContainer.py.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="SkinsContainer.py.patch"

--- SkinsContainer.py.original	Tue Mar 13 22:20:08 2001
+++ SkinsContainer.py.new	Thu May 31 22:27:54 2001
@@ -127,28 +127,11 @@
         Returns a skin at the given path.  A skin path is of the =
format:
         "some/path, some/other/path, ..."  The first part has =
precedence.
         '''
-        baseself =3D aq_base(self)
-        skinob =3D baseself
+        skinob =3D aq_base(self)
         parts =3D list(split(path, ','))
         parts.reverse()
         for part_path in parts:
-            partob =3D baseself
-            for name in split(strip(part_path), '/'):
-                if name =3D=3D '':
-                    continue
-                if name[:1] =3D=3D '_':
-                    # Not allowed.
-                    partob =3D None
-                    if raise_exc:
-                        raise SkinPathError('Underscores are not =
allowed')
-                    break
-                # Allow acquisition tricks.
-                partob =3D getattr(partob, name, None)
-                if partob is None:
-                    # Not found.  Cancel the search.
-                    if raise_exc:
-                        raise SkinPathError('Name not found: %s' % =
part_path)
-                    break
+            partob =3D self.restrictedTraverse(strip(part_path))
             if partob is not None:
                 # Now partob has containment and context.
                 # Build the final skinob by creating an object

------=_NextPart_000_05C4_01C0EA21.F33B1610--