I’m having problem with FS controller page template. I had this Plone2 base product which i have eggified while doing Plone 4.2 migration. I have pasted traceback below.
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Products.CMFFormController.FSControllerPageTemplate, line 91, in __call__
Module Products.CMFFormController.BaseControllerPageTemplate, line 26, in _call
Module Products.CMFFormController.FormController, line 384, in validate
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Products.CMFFormController.FSControllerValidator, line 58, in __call__
Module Products.CMFFormController.Script, line 145, in __call__
Module Products.CMFCore.FSPythonScript, line 130, in __call__
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 344, in _exec
Module script, line 32, in exams_list
- <FSControllerValidator at /dev/exam/online/booking/validators/exams_list>
- Line 32
Module AccessControl.ZopeGuards, line 299, in guarded_import
Unauthorized: Using import with a level specification isn't supported by AccessControl: _warnings
line 32 on exams_list validators is wrap with astric
if event and not state.getErrors():
try:
context.script.validateEvent()
except ValueError,exc:
state.setError('SIMSError',str(exc))
**except 'dryrun':**
state.setStatus('dryrun')
Any help or pointer always helpful.
Support for string exceptions was removed from Python 2.6; you’ll need to use a proper exception class for
'dryrun'instead.You’ll need to mark that exception as importable by restricted code before you can then import it into your Controller Script.
Here is an example definition for such an exception:
With the
ModuleSecurityInfoinformation in place you can now import this exception into your script:and catch that instead in your
exceptblock; the code that throws this exception will need to be updated too, of course.