[Zope-dev] Form action has no effect

Ross Boylan RossBoylan@stanfordalumni.org
Mon, 21 Apr 2003 17:14:09 -0800


I had a Zope product that was working OK about a year ago.  Now it's 
not.  It seems the form action is not having any effect when I click on the 
button in the interface.  As far as I can tell, the action is never called.

I have tried this with Zope 2.4.3, which I think is the same version I ran 
before, and a fresh install of 2.6.1.  One reason for the install was that 
I moved the entire application directory to a new drive in between, and I 
thought this might have caused some problems (I manually edited the paths I 
found).  I also extended the app, but not in a way having any connection 
with the display of the form or action on it that I can see.  I'm under MS 
Win 2k.

When I type method calls directly into the browser (Mozilla) I call into 
the method or get a traceback if the name isn't recognized.  But when I hit 
the action button on the form, I get no change at all except sometimes the 
URL gets the function arguments, e.g.,
http://localhost:8080/DSA/DSASync/DSASync/index_html?ignoreBlanks=ignore+blanks&key1=DSAID&key2=
where the part from the ? on is new. (Not all tests have the 
DSASync/DSASync stutter).

The dtml form is, in the relevant part:
<form action="doddddCompare" method="POST">
<label>Ignore Empty Fields?
<input type="checkbox" name="ignoreBlanks" value="ignore blanks" checked>
</label><BR>
<label>Keys
<input type="text" name="key1" value="DSAID">
<input type="text" name="key2">
</label><BR>
<input type="SUBMIT" value="compute differences">
</form>

When I hit the form's button, I get no traceback that dodddCompare isn't 
found, and when I enter the real name (doCompare) I do not end up in the 
relevant method.  I have verified that altering other text effects the 
form, so I am editing the right file and it is being picked up.

The other odd thing is that I'm doing this as the root user created at Zope 
system creation.  I thought such users could only create other users, but 
I'm able to create my object too.  I've tried creating another user, but 
haven't been able to get past permission problems with it.

The object statements that gets the form is index_html in the excerpt from 
the class def below:

     security = ClassSecurityInfo()
     security.declareObjectPublic()  # added this to try  to make things work


     # never was sure if this needed security
     # but I can see the form, so I'm OK, right?
     index_html = HTMLFile("diff", globals())

    # here's the method that I'm trying to invoke
     security.declareProtected('View', 'doCompare')
     def doCompare(self, ignoreBlanks = None, key1="DSAID", key2=None,
                   RESPONSE = None):
                   # print statements in here never produce output
                   # debug statements never induce a halt

I would really appreciate any help, even advice on how to debug this.