Mercurial > p > roundup > code
view website/issues/html/_generic.help-list.html @ 5548:fea11d05110e
Avoid errors from selecting "no selection" on multilink (issue2550722).
As discussed in issue 2550722 there are various cases where selecting
"no selection" on a multilink can result in inappropriate errors from
Roundup:
* If selecting "no selection" produces a null edit (a value was set in
the multilink in an edit with an error, then removed again, along
with all other changes, in the next form submission), so the page is
rendered from the form contents including the "-<id>" value for "no
selection" for the multilink.
* If creating an item with a nonempty value for a multilink has an
error, and the resubmission changes that multilink to "no selection"
(and this in turn has subcases, according to whether the creation
then succeeds or fails on the resubmission, which need fixes in
different places in the Roundup code).
All of these cases have in common that it is expected and OK to have a
"-<id>" value for a submission for a multilink when <id> is not set in
that multilink in the database (because the original attempt to set
<id> in that multilink had an error), so the hyperdb.py logic to give
an error in that case is thus removed. In the subcase of the second
case where the resubmission with "no selection" has an error, the
templating code tries to produce a menu entry for the "-<id>"
multilink value, which also results in an error, hence the
templating.py change to ignore such values in the list for a
multilink.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Thu, 27 Sep 2018 11:33:01 +0000 |
| parents | baa3e51d0f38 |
| children | 7146b68ac263 |
line wrap: on
line source
<!-- vim: sw=2 ts=8 et --> <html tal:define="vok context/is_view_ok"> <head> <title>Search result for user helper</title> <link rel="stylesheet" type="text/css" href="@@file/style.css" /> <script language="Javascript" type="text/javascript" tal:content="structure string:<!-- // this is the name of the field in the original form that we're working on form = parent.opener.document.${request/form/form/value}; field = '${request/form/property/value}'; //-->"></script> <script src="@@file/help_controls.js" type="text/javascript"></script> <script type="text/javascript"><!-- var text_field = parent.submit.document.frm_help.text_preview; //--></script> </head> <body> <pre tal:content="request/env/QUERY_STRING" tal:condition=false /> <p tal:condition="not:vok" i18n:translate="">You are not allowed to view this page.</p> <tal:if condition="context/is_view_ok"> <tal:def define="batch request/batch;"> <form name=dummyform> <table width="100%" tal:define="template string:help-list" metal:use-macro="templates/help/macros/batch_navi" > <tr class="navigation"> <th> <a href="#"><< previous</a> </th> <th i18n:translate="">1..25 out of 50 </th> <th> <a href="#">next >></a> </th> </tr> </table> <form name=dummyform> <table class="classhelp" tal:define=" props python:request.form['properties'].value.split(','); legend templates/help/macros/legend; "><thead> <tr metal:use-macro="legend"> <th> <b>x</b></th> <th tal:repeat="prop props" tal:content="prop" i18n:translate=""></th> </tr> </thead> <tfoot tal:condition=true> <tr metal:use-macro="legend" /> </tfoot> <tbody> <tr tal:repeat="item batch"> <tal:block tal:define="attr python:item[props[0]]" > <td> <input name="check" onclick="switch_val(text_field, this);" type="checkbox" tal:attributes="value attr; id string:id_$attr" /> </td> <td tal:repeat="prop props"> <label class="classhelp-label" tal:attributes="for string:id_$attr" tal:content="python:item[prop]"></label> </td> </tal:block> </tr> </tbody> </table> </form> </tal:def> </tal:if> <pre tal:content=request tal:condition=false /> <script type="text/javascript"><!-- parent.submit.document.frm_help.cb_listpresent.checked=true; reviseList_framed(document.dummyform, text_field) //--></script> </body> </html> <!-- SHA: 7581a18984d95c2c415df046cfbdda73ad95651e -->
