I'm trying to debug an issue on a Plone 4 site where
plone.app.discussion does not delete comments. I am using plone.app.discussion 2.2.20, because that is the version that comes with the latest Plone 4 (though it is totally unclear from PyPI what the 2.3.x, 2.4.x and 3.0.x versions are for).
There are absolutely no messages or tracebacks being logged either in the Zope log or the browser console.
The issue seems to be that
plone.app.discussion.broser.moderation.DeleteComment is never called. At least, a breakpoint set in the
__call__ method never trips. However, I can replay the request to
http://localhost:9087/home/foo/bar/++conversation++default/....comment-id...../@@moderate-delete-comment with either a
GET or a
POST method, and I get a 302 response with no error. Indeed, the
@@moderate-delete-comment browser view ends with
Why is my
pdb.set_trace() not tripped? Where is the 302 coming from, if the browser view does not execute?
Here is a checklist of things I have verified:
- I am connected directly to a zope instance running in
fg, no front-end web server or reverse proxy or load balancer involved.
- I put other
pdb.set_trace()calls in other methods in the same file (
plone.app.discussion.browser.moderation.py) and they all get hit in the appropriate code paths, just not the one in
- I have tried adding
IDisableCSRFProtectionto the request with
alsoProvides. Although the request already has a
X-CSRF-TOKEN, plus there are no errors in the log. No difference.
- I also tried putting a breakpoint in
plone4.csrffixes.transform.Protect4Transform.transform, and it does get hit when I call the
@@moderate-delete-commentview, but I couldn't get out of those weeds.
- I inspected the comment object with
Products.PDBDebugMode, and checked that all the ZCML discriminators for the
<browser:page name="moderate-delete-comment" ... >are fulfilled, i.e.
- The site has a Diazo theme, but I don't see how that could affect a view being called, since it's being called from AJAX, and I see the request leaving the browser.
- I have replayed requests using Postman with all the same headers that the browser sends, to try and exclude any browser caching issue.
- On my local development site I do not see this issue, only on remote production and staging sites.