[Zope-CMF] Re: Method Aliases
Dieter Maurer
dieter at handshake.de
Sun Oct 5 15:51:20 EDT 2003
Yuppie wrote at 2003-10-4 13:13 +0200:
> ...
> @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>
With your first change, you ensure that "method" is no longer
modified. Therefore, the second change is not necessary.
Your modification still does not yet cope with "default_path[0]==''".
This will still lead to an infinite recursion.
Dieter
More information about the Zope-CMF
mailing list