Hello everybody,

While experimenting with DEMOBOO when trying to see how things work, I realised that there are some MINOR problems with that doctype, some of which have to do with the fact that there is only one category in this doctype, so comboDEMOBOO is never defined, resulting into a categ=unknown in the sbmAPPROVAL table. Although you've taken this into account in many places (publiline.py, Send_APP_Mail.py among other), there is a tiny glitch: categformatDAM parameter in the Send_Approval_Request Function is not defined in the demo site (and how could it be, since <CATEG> must be 'unknown') resulting in the following exception in publiline.py:
[...]

File "/opt/cds-invenio/var/www/publiline.py", line 361, in displayDocument
   SendEnglish(doctype,categ,RN,title,authors,access,sysno)

 File "/opt/cds-invenio/var/www/publiline.py", line 1501, in SendEnglish
   categ = categs.group(1)

IndexError: no such group

One solution would be to define categformatDAM=<CATEG> (or something *dummy* that would result in CATEG=unknown) and let the Send_Approval_Request function take care of the rest. This stops the exception from appearing and everyone is happy, but thinks get a bit tricky if you decide later to ADD some categories to the doctype... For example, even if you redefine correctly all the relevant parameters, in your submission/approval window, all the relevant submissions that had categ=unknown will be lost (not shown). Of course you fix this by again taking care of that possibility, OR...

Starting from the beginning, create ONE category in the DEMOBOO doctype (ie categ=BOOK),
Apply the following patch in the websubmit_templates.py:
310c310
<         if len(snameCateg)>1 :
---
        if len(snameCateg) :
319,324d318
<       elif len(snameCateg)==1 :
< out += """<input type="hidden" name="combo%(doctype)s" value="%(shortname)s" />""" % {
<                       'shortname' : snameCateg[0],
<                       'doctype' : doctype,
<               }
<             out += "<script>checked=1;</script>"

that passes the hidden value comboDEMOBOO=BOOK to the submission system WITHOUT showing a radio button, then set categformatDAM=DEMO-<CATEG>-* as usual, and that's it! (...I think)

Best Regards,
Theodoros


Reply via email to