[Zope] Still Chipping Away At Formulator/ZPT Interface

Clemens Robbenhaar zope@zope.org
Wed, 6 Nov 2002 13:34:18 +0100


Hi beno,

 [...]
 > So I did as instructed, added this line:
 > from Products.Formulator.Errors import ValidationError, FormValidationError
 > and now it wants me to authenticate! Why? I changed the security on *access 
 > contents information* to *anonymous* just to see if that was it, but no. 
 > What do?

This cannot happen; I therfore conclude You do not exist ;-)



It would be useful if You try to debug the problem first:

 - press the "cancel" button when authentification is required.
   You should get an error page
   telling You what specifically You can't access.
   Then there is a traceback in the usual place (if using Zope2.6.0, 
   logging of Unauthorized exceptions must be turned on explicitely
   in the /error_log ..) 
 - visit Your script in the line number told by the traceback,
   and figure out why Zope does not let You access this.
 - if You fail in figuring out what happens, come back to the list with
   a more complete error description (ErrorType, ErrorValue, preferably
   the relevant parts of the script causing the error).


 The mistake I most commonly have is a some typo which makes the script
trying to access some internal thing instead of the proper public item.


 Another more obscure source of an unconditional Unauthorized error is
using the wrong arguments to the "getattr" function. 

 E.g. "getattr(context, context)"  is certainly nonsense, if only that the
second argument has to be a string. I would expect a TypeError, but I get
an Unauthorized (both Zope2.5.1 and 2.6.0).


Cheers,
Clemens