https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292013-03-08T01:29:24ZRedmineRedmine - Defect #13385: Searchable checkbox displayed on edit form for not-searchable custom field formats.https://www.redmine.org/issues/13385?journal_id=464482013-03-08T01:29:24ZMischa The Evil
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Needs feedback</i></li><li><strong>Assignee</strong> set to <i>David Leimbach</i></li></ul><p>Please make sure to test without plugins. This might be an issue with one of them.</p> Redmine - Defect #13385: Searchable checkbox displayed on edit form for not-searchable custom field formats.https://www.redmine.org/issues/13385?journal_id=464562013-03-08T10:17:01ZDavid Leimbach
<ul></ul><p>I removed all plugins then restarted apache. The problem still happens.</p>
<p>my rake about<br />About your application's environment<br />Ruby version 1.8.7 (x86_64-linux)<br />RubyGems version 2.0.0<br />Rack version 1.4<br />Rails version 3.2.12<br />Active Record version 3.2.12<br />Action Pack version 3.2.12<br />Active Resource version 3.2.12<br />Action Mailer version 3.2.12<br />Active Support version 3.2.12<br />Middleware Rack::Cache, ActionDispatch::Static, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x7f2fc8dc1848>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, ActionDispatch::Head, Rack::ConditionalGet, Rack::ETag, ActionDispatch::BestStandardsSupport, OpenIdAuthentication<br />Environment production<br />Database adapter mysql<br />Database schema version 20121026003537</p> Redmine - Defect #13385: Searchable checkbox displayed on edit form for not-searchable custom field formats.https://www.redmine.org/issues/13385?journal_id=464712013-03-08T21:47:33ZMischa The Evil
<ul><li><strong>Resolution</strong> set to <i>Cant reproduce</i></li></ul><p>David Leimbach wrote:</p>
<blockquote>
<p>I removed all plugins then restarted apache. The problem still happens.</p>
<p>[...]</p>
</blockquote>
<p>I just tried it on *.m.redmine.org, which is running Redmine 2.2.3.stable.11411 on Rails 3.2.12 and Ruby 1.9.3 using SQLite as DB, and wasn't able to reproduce the reported issue. What is in your logs?</p> Redmine - Defect #13385: Searchable checkbox displayed on edit form for not-searchable custom field formats.https://www.redmine.org/issues/13385?journal_id=465492013-03-11T13:30:19ZDavid Leimbach
<ul></ul><p>This is my log on save.</p>
<p>Started PUT "/custom_fields/1" for 10.1.20.1 at Mon Mar 11 16:01:44 +0200 2013<br />Processing by CustomFieldsController#update as HTML<br /> Parameters: {"commit"=>"Save", "custom_field"=>{"min_length"=>"0", "default_value"=>"", "is_required"=>"0", "is_for_all"=>"1", "tracker_ids"=>["8", "1", "2", "3", "6", "7", ""], "max_length"=>"0", "searchable"=>"1", "regexp"=>"", "is_filter"=>"1", "name"=>"TFS ID"}, "id"=>"1", "utf8"=>"✓", "authenticity_token"=>"cK031SqTPXliqKUh5BbZEuZcY/UEh4PC6TTUwK/4NhU="}<br /> Current user: davidl (id=3)<br />Redirected to <a class="external" href="http://projects.********.com/custom_fields?tab=IssueCustomField">http://projects.********.com/custom_fields?tab=IssueCustomField</a><br />Completed 302 Found in 52ms (ActiveRecord: 13.5ms)<br />Started GET "/custom_fields?tab=IssueCustomField" for 10.1.20.1 at Mon Mar 11 16:01:44 +0200 2013<br />Processing by CustomFieldsController#index as HTML<br /> Parameters: {"tab"=>"IssueCustomField"}<br /> Current user: davidl (id=3)<br /> Rendered custom_fields/_index.html.erb (218.2ms)<br /> Rendered custom_fields/_index.html.erb (1.6ms)<br /> Rendered custom_fields/_index.html.erb (1.6ms)<br /> Rendered custom_fields/_index.html.erb (1.7ms)<br /> Rendered custom_fields/_index.html.erb (10.0ms)<br /> Rendered custom_fields/_index.html.erb (1.6ms)<br /> Rendered custom_fields/_index.html.erb (1.6ms)<br /> Rendered custom_fields/_index.html.erb (1.5ms)<br /> Rendered custom_fields/_index.html.erb (1.6ms)<br /> Rendered common/_tabs.html.erb (253.7ms)<br /> Rendered custom_fields/index.html.erb within layouts/admin (254.8ms)<br /> Rendered admin/_menu.html.erb (11.9ms)<br /> Rendered layouts/base.html.erb (39.0ms)<br />Completed 200 OK in 319ms (Views: 306.6ms | ActiveRecord: 4.1ms)<br />Started GET "/custom_fields?tab=IssueCustomField" for 10.1.20.1 at Mon Mar 11 16:01:44 +0200 2013<br />Processing by CustomFieldsController#index as */*<br /> Parameters: {"tab"=>"IssueCustomField"}<br /> Current user: davidl (id=3)<br /> Rendered custom_fields/_index.html.erb (78.8ms)<br /> Rendered custom_fields/_index.html.erb (1.9ms)<br /> Rendered custom_fields/_index.html.erb (1.7ms)<br /> Rendered custom_fields/_index.html.erb (1.7ms)<br /> Rendered custom_fields/_index.html.erb (9.8ms)<br /> Rendered custom_fields/_index.html.erb (1.7ms)<br /> Rendered custom_fields/_index.html.erb (1.7ms)<br /> Rendered custom_fields/_index.html.erb (2.0ms)<br /> Rendered custom_fields/_index.html.erb (1.7ms)<br /> Rendered common/_tabs.html.erb (115.2ms)<br /> Rendered custom_fields/index.html.erb within layouts/admin (116.2ms)<br /> Rendered admin/_menu.html.erb (11.5ms)<br /> Rendered layouts/base.html.erb (39.3ms)<br />Completed 200 OK in 180ms (Views: 167.3ms | ActiveRecord: 4.5ms)</p>
<p>It's looking like this problem may be due to one of three plugins that I installed: redmine_backlogs v0.9.36, redmine_plugin_views_revisions 0.0.1, redmine_users_xls_impex 0.1.1</p>
<p>Unless an answer is apparent from the above log, I'll no require anything further.</p> Redmine - Defect #13385: Searchable checkbox displayed on edit form for not-searchable custom field formats.https://www.redmine.org/issues/13385?journal_id=466872013-03-15T13:26:29ZDavid Leimbach
<ul></ul><p>After further testing this bug seems to be related to the format of the custom field. It happens with format integer and no other format that I can tell.</p> Redmine - Defect #13385: Searchable checkbox displayed on edit form for not-searchable custom field formats.https://www.redmine.org/issues/13385?journal_id=467032013-03-15T21:23:16ZMischa The Evil
<ul><li><strong>Subject</strong> changed from <i>Custom Field Issue Searchable checkbox check not saved.</i> to <i>Custom fields Searchable checkbox check not saved when format is integer.</i></li><li><strong>Status</strong> changed from <i>Needs feedback</i> to <i>Confirmed</i></li><li><strong>Assignee</strong> deleted (<del><i>David Leimbach</i></del>)</li><li><strong>Resolution</strong> deleted (<del><i>Cant reproduce</i></del>)</li></ul><p>David Leimbach wrote:</p>
<blockquote>
<p>After further testing this bug seems to be related to the format of the custom field. It happens with format integer and no other format that I can tell.</p>
</blockquote>
<p>You are right. I was finally able to reproduce the issue you have reported on *.m.redmine.org. It happens indeed only when trying to make a custom field (type isn't relevant) of the integer format searchable. As mentioned, the checkbox value is not saved upon the save-action.</p> Redmine - Defect #13385: Searchable checkbox displayed on edit form for not-searchable custom field formats.https://www.redmine.org/issues/13385?journal_id=523772013-10-09T02:47:08ZMischa The Evil
<ul><li><strong>Subject</strong> changed from <i>Custom fields Searchable checkbox check not saved when format is integer.</i> to <i>Searchable checkbox value not saved with several custom field formats.</i></li><li><strong>Target version</strong> set to <i>Candidate for next minor release</i></li></ul><p>After looking at this a second time I think this is more a UI issue because custom fields of formats integer, float, date and boolean can not be made searchable by explicit design (see <a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/12202/entry/trunk/app/models/custom_field.rb#L67">source:/trunk/app/models/custom_field.rb@12202#L67</a>). Despite that, the form element is rendered without any exceptions.</p>
<p>In case the design is not going to be changed (considering the custom values of these custom field formats, I think the best solution), this issue can be fixed by just hiding the form element for the appropriate custom field formats with a slight change like for example:</p>
<pre><code class="diff syntaxhl"><span class="gh">Index: app/views/custom_fields/_form.html.erb
===================================================================
</span><span class="gd">--- app/views/custom_fields/_form.html.erb (revision 12119)
</span><span class="gi">+++ app/views/custom_fields/_form.html.erb (working copy)
</span><span class="p">@@ -63,7 +63,9 @@</span>
<p><%= f.check_box :is_required %></p>
<p><%= f.check_box :is_for_all %></p>
<p><%= f.check_box :is_filter %></p>
<span class="gd">- <p><%= f.check_box :searchable %></p>
</span><span class="gi">+ <% unless @custom_field.format_in? 'int', 'float', 'date', 'bool' %>
+ <p><%= f.check_box :searchable %></p>
+ <% end %>
</span> <p>
<label><%= l(:field_visible) %></label>
<label class="block">
<span class="p">@@ -92,7 +94,9 @@</span>
<% when "ProjectCustomField" %>
<p><%= f.check_box :is_required %></p>
<p><%= f.check_box :visible %></p>
<span class="gd">- <p><%= f.check_box :searchable %></p>
</span><span class="gi">+ <% unless @custom_field.format_in? 'int', 'float', 'date', 'bool' %>
+ <p><%= f.check_box :searchable %></p>
+ <% end %>
</span> <p><%= f.check_box :is_filter %></p>
<% when "VersionCustomField" %>
</code></pre>
<p>I haven't tested if this change breaks any existing tests (yet). Are there any functional tests needed?</p> Redmine - Defect #13385: Searchable checkbox displayed on edit form for not-searchable custom field formats.https://www.redmine.org/issues/13385?journal_id=525322013-10-14T03:33:24ZMischa The Evil
<ul><li><strong>Subject</strong> changed from <i>Searchable checkbox value not saved with several custom field formats.</i> to <i>Searchable checkbox displayed on edit form for not-searchable custom field formats.</i></li><li><strong>Category</strong> changed from <i>Custom fields</i> to <i>UI</i></li></ul><p>Mischa The Evil wrote:</p>
<blockquote>
<p>[...] Despite that, the form element is rendered without any exceptions.</p>
</blockquote>
<p>This actually is a regression introduced in <a class="changeset" title="Update the new custom field form with remotely." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/10163">r10163</a>. Before that commit the searchable element was actually hidden from the form when not-searchable custom field formats were selected.</p>
<p>Additionally, looking at <a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/10162/entry/trunk/app/views/custom_fields/_form.html.erb">source:/trunk/app/views/custom_fields/_form.html.erb@10162</a>, the searchable element should be hidden for user and version custom field formats too as these are implemented in <a class="changeset" title="Adds User and Version custom field format that can be used to reference a project member or versi..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/5272">r5272</a> as being not-searchable despite of the fact that they are not explicitly defined as such in <a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/12202/entry/trunk/app/models/custom_field.rb#L67">source:/trunk/app/models/custom_field.rb@12202#L67</a>. At the moment the value of the searchable element is incorrectly saved for user and version custom field formats which gives the impression that these can be searched while they by design can't.</p>
Summary: the patch I posted in note-7 should be:
<ol>
<li>extended to also exclude user and version custom field formats for the searchable form element</li>
<li>extended to include a new change to <a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/12202/entry/trunk/app/models/custom_field.rb#L67">source:/trunk/app/models/custom_field.rb@12202#L67</a> to explicitly define the user and version formats to be not-searchable (this would prevent the actual saving of the value of the searchable element)</li>
</ol>
<p>I'll work on an updated patch.</p> Redmine - Defect #13385: Searchable checkbox displayed on edit form for not-searchable custom field formats.https://www.redmine.org/issues/13385?journal_id=525912013-10-15T03:47:56ZMischa The Evil
<ul><li><strong>Assignee</strong> set to <i>Mischa The Evil</i></li></ul><p>I started working on patches for this.</p> Redmine - Defect #13385: Searchable checkbox displayed on edit form for not-searchable custom field formats.https://www.redmine.org/issues/13385?journal_id=526422013-10-18T02:37:33ZMischa The Evil
<ul><li><strong>File</strong> <a href="/attachments/10634">rm13385-do_not_set_searchable_for_user_and_version_cf-trunk_r12224.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/10634/rm13385-do_not_set_searchable_for_user_and_version_cf-trunk_r12224.diff">rm13385-do_not_set_searchable_for_user_and_version_cf-trunk_r12224.diff</a> added</li><li><strong>File</strong> <a href="/attachments/10635">rm13385-do_not_present_searchable_for_not_searchable_cf_formats-trunk_r12224.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/10635/rm13385-do_not_present_searchable_for_not_searchable_cf_formats-trunk_r12224.diff">rm13385-do_not_present_searchable_for_not_searchable_cf_formats-trunk_r12224.diff</a> added</li><li><strong>Assignee</strong> deleted (<del><i>Mischa The Evil</i></del>)</li><li><strong>% Done</strong> changed from <i>0</i> to <i>90</i></li></ul><p>I have fixed both issues that have been discussed in this issue and provide two separate patches (against Redmine trunk @ <a class="changeset" title="remove trailing white-spaces from test/unit/user_test.rb" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/12224">r12224</a>) that include these fixes along with corresponding tests.</p>
<p>Mischa The Evil wrote:</p>
<blockquote>
<p>[...] At the moment the value of the searchable element is incorrectly saved for user and version custom field formats which gives the impression that these can be searched while they by design can't.<br />[...]<br />[...] include a new change to <a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/12202/entry/trunk/app/models/custom_field.rb#L67">source:/trunk/app/models/custom_field.rb@12202#L67</a> to explicitly define the user and version formats to be not-searchable (this would prevent the actual saving of the value of the searchable element)</p>
</blockquote>
<p><a class="attachment" href="https://www.redmine.org/attachments/10634">rm13385-do_not_set_searchable_for_user_and_version_cf-trunk_r12224.diff</a></p>
<p>Mischa The Evil wrote:</p>
<blockquote>
<p>Mischa The Evil wrote:</p>
<blockquote>
<p>[...] Despite that, the form element is rendered without any exceptions.</p>
</blockquote>
<p>This actually is a regression introduced in <a class="changeset" title="Update the new custom field form with remotely." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/10163">r10163</a>. Before that commit the searchable element was actually hidden from the form when not-searchable custom field formats were selected.</p>
</blockquote>
<p><a class="attachment" href="https://www.redmine.org/attachments/10635">rm13385-do_not_present_searchable_for_not_searchable_cf_formats-trunk_r12224.diff</a></p>
<p>As stated, tests (both unit and functional) have been provided and I've made sure that the existing test suite didn't break.<br />Please review these changes and commit them if they are good enough. Otherwise, please let me know what I can do to further improve them.</p> Redmine - Defect #13385: Searchable checkbox displayed on edit form for not-searchable custom field formats.https://www.redmine.org/issues/13385?journal_id=527172013-10-21T15:31:26ZMatt McSweyn
<ul></ul><p>Hi Mischa-<br />I've been watching this ticket because I have been waiting for a fix that will allow these types of custom fields to be searchable. However, it appears that you are "fixing" this so they are not searchable, i.e. removing the "Searchable" element from view and you note that it is by design that they are not searchable. Can you confirm this and if so, can you tell me why these fields should not be searchable?--I would much prefer that they are; I would prefer any custom field we add to be searchable.</p>
<p>Thanks.</p> Redmine - Defect #13385: Searchable checkbox displayed on edit form for not-searchable custom field formats.https://www.redmine.org/issues/13385?journal_id=538322013-12-15T08:55:02ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Target version</strong> changed from <i>Candidate for next minor release</i> to <i>2.5.0</i></li></ul> Redmine - Defect #13385: Searchable checkbox displayed on edit form for not-searchable custom field formats.https://www.redmine.org/issues/13385?journal_id=539712013-12-22T14:46:54ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Confirmed</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Fixed in 2.5.0.</p>
<p>Matt McSweyn wrote:</p>
<blockquote>
<p>can you tell me why these fields should not be searchable?--I would much prefer that they are; I would prefer any custom field we add to be searchable.</p>
</blockquote>
<p>Integers, floats and bools are not searchable because it doesn't make much sense to search these values for those that contain a certain string. A better option is to use filters on the issue list for these fields.</p>