Merge pull request #3 from headnet/master

Make widget resistant to existing criteria being deleted from the registry
This commit is contained in:
Rok Garbas 2013-01-15 07:18:13 -08:00
commit 82d3b89e4d
2 changed files with 8 additions and 1 deletions

View File

@ -18,6 +18,12 @@ Changelog
- Translations are now in Plone domain
[bosim]
- Made the widget a bit more resistent to missing entries, i.e. vocabularies or in
other way indexes. The problem occur if an option is deleted from the registry
but not deleted from the collections in before hand.
[bosim]
1.0b2 (2012-03-19)
------------------

View File

@ -14,7 +14,8 @@
<tal:counter tal:define="dummy python:request.set('querystringwidgetcounter', 0)"/>
<tal:row repeat="row rows">
<div class="criteria"
tal:condition="python:not request.has_key('removecriteria.%s' % repeat['row'].index)">
tal:condition="python:not request.has_key('removecriteria.%s' % repeat['row'].index) and
row.i in indexes">
<div class="queryindex">
<input type="hidden" name="form.widgets.query.i:records"
tal:attributes="name python:str(fieldName)+'.i:records'; value row/i" />