Skip to content

Commit

Permalink
- Reduce the danger of acquiring built-in names on the Find tab (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Oct 13, 2019
1 parent ab77e9e commit dbe4e50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ https://github.com/zopefoundation/Zope/blob/4.x/CHANGES.rst
5.0a1 (unreleased)
------------------

- Reduce the danger of acquiring built-in names on the ZMI Find tab
(`#712 <https://github.com/zopefoundation/Zope/issues/712>`_)

- Restore the mistakenly removed Properties ZMI tab on Image objects
(`#706 <https://github.com/zopefoundation/Zope/issues/706>`_)

Expand Down
13 changes: 7 additions & 6 deletions src/OFS/dtml/findForm.dtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
<main class="container-fluid">

<!-- BO findResults.dtml -->
<dtml-in "('obj_ids', 'obj_metatypes', 'obj_searchterm', 'obj_expr', 'obj_mtime', 'obj_mspec', 'obj_permission', 'obj_roles', 'search_sub','searchtype')"
<dtml-in "('obj_ids', 'obj_searchterm', 'obj_expr', 'obj_mtime', 'obj_mspec', 'obj_permission', 'obj_roles', 'search_sub','searchtype')"
><dtml-else "_.hasattr(REQUEST, _['sequence-item'])"
><dtml-call "REQUEST.set(_['sequence-item'], None)"
></dtml-else
></dtml-in>
<dtml-call "REQUEST.set('obj_metatypes',
[x for x in (REQUEST.get('obj_metatypes', []) or [])])">

<dtml-if btn_submit>
<dtml-with "_.namespace(
Expand Down Expand Up @@ -93,7 +95,6 @@
<!-- EO findResults.dtml -->

<form id="zmi-search-form" action="manage_findForm" method="get" class="zmi-find">
<!--input type="hidden" name="searchtype" value="advanced" / -->
<table class="table table-borderless">
<tr class="simple-search">
<td style="width:10rem">
Expand All @@ -103,10 +104,10 @@
<div class="form-element">
<select id="type" class="form-control" name="obj_metatypes:list" size="8" multiple="multiple">
<option value="all"
<dtml-if "obj_metatypes==None">
<dtml-if "not obj_metatypes">
selected="selected"
<dtml-else>
<dtml-var "( 'all' in list(obj_metatypes ) ) and 'selected=\042selected\042' or ''">
<dtml-var "('all' in obj_metatypes) and 'selected=\042selected\042' or ''">
</dtml-if>
>All types</option>
<dtml-let sorted_meta_types="[]"
Expand All @@ -115,9 +116,9 @@
></dtml-in><dtml-call "sorted_meta_types.sort()"
><dtml-in sorted_meta_types
><option value="&dtml-sequence-item;"
<dtml-if "obj_metatypes==None">
<dtml-if "not obj_metatypes">
<dtml-else>
<dtml-var "( _['sequence-item'] in list(obj_metatypes ) ) and 'selected=\042selected\042' or ''">
<dtml-var "(_['sequence-item'] in obj_metatypes) and 'selected=\042selected\042' or ''">
</dtml-if>
>&dtml-sequence-item;</option>
</dtml-in
Expand Down

0 comments on commit dbe4e50

Please sign in to comment.