[Zope-CMF] Re: Method Aliases

Yuppie schubbe at web.de
Sat Oct 4 07:13:26 EDT 2003


Hi Andy! Hi Dieter!


Andy McKay wrote:
> The Plone infinite loop problem that sparked the initial email, 
> basically the function does not cope with multiple traversals of the 
> object.

I think I understand now what's going wrong. AFAICS BaseRequest.py needs 
to be fixed.

@Dieter: Could you please have a look at this diff and tell me if it
- looks reasonable
- resolves the infinite loop problem you had in a different context

I believe 'method' has to be reset to the default default method after 
copying the modified default method to 'entry_name'.

<diff>
@@ -269,13 +269,13 @@
                          request['TraversalRequestNameStack'] = path
                          continue
                      else:
-                        method = default_path[0]
-                        entry_name = method
+                        entry_name = default_path[0]
                  elif (method and hasattr(object,method)
                        and entry_name != method
                        and getattr(object, method) is not None):
                      request._hacked_path=1
                      entry_name = method
+                    method = 'index_html'
                  else:
                      if (hasattr(object, '__call__') and
                          hasattr(object.__call__,'__roles__')):
</diff>


@Andy: Could you please check if this change in Plone's browserDefault 
script fixes your problem? (I know it's just a workaround, but CMF would 
need a terrible hack.)

<diff>
-            return context, [page]
+            return context, [page, 'index_html']
</diff>


Of course feedback from other people is as always welcome.


Cheers,
Yuppie





More information about the Zope-CMF mailing list