Vote #76383
完了Raise time entries comments limit to 1024
0%
説明
See: source:/trunk/app/models/time_entry.rb#L42
The @comments@ field in the @time_entries@ table is defined as having a length of 1024 characters:
Click to expand @time_entries@ table definition...
Yet, user comments are truncated at 255:
Let's not do that. :)
Note: This patch (partly) makes the comment field mandatory. That might not be what you want. It would be nice to have a way to require this field without patching the application though. :)
journals
--------------------------------------------------------------------------------
Here is a patch for source:/trunk/app/views/timelog/_form.html.erb as well:
{{collapse(Click to expand patch...)
<pre>
<code class="diff">
--- app/views/timelog/_form.html.erb.orig 2015-05-17 13:01:37.000000000 -0400
+++ app/views/timelog/_form.html.erb 2015-05-19 13:45:35.876821092 -0400
@@ -17,7 +17,7 @@
</p>
<p><%= f.text_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
<p><%= f.text_field :hours, :size => 6, :required => true %></p>
- <p><%= f.text_field :comments, :size => 100, :maxlength => 255 %></p>
+ <p><%= f.text_field :comments, :size => 100, :required => true, :maxlength => 1024 %></p>
<p><%= f.select :activity_id, activity_collection_for_select_options(@time_entry), :required => true %></p>
<% @time_entry.custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label :time_entry, value %></p>
</code>
</pre>
}}
Again, noting that we're making the field mandatory, which might not be what you want (POLA(point of least authority)).
--------------------------------------------------------------------------------
"comments" of "time_entries" is defined as 255.
source:tags/3.0.3/db/migrate/032_create_time_entries.rb#L8
I think you changed manually.
--------------------------------------------------------------------------------
Yes, you are correct. We did. Can that field be made longer by default? The length of 255 characters is rather short and doesn't allow for detailed time entries.
--------------------------------------------------------------------------------
See r4402.
--------------------------------------------------------------------------------
The diff you referenced doesn't apply to the time entries @comment@ field.
--------------------------------------------------------------------------------
If you want to modify db definition, you need to make db migrate file.
* source:trunk/db/migrate/20101114115114_change_projects_name_limit.rb
* source:trunk/db/migrate/20101114115359_change_projects_identifier_limit.rb
--------------------------------------------------------------------------------
Yes, I understand that and we've done it. The point is that the stock password length between what the view allows and what the DB allows, by default, don't match. Thus, these comments get limited unnecessarily. Same deal for #19886. Please, apply these patches in this issue and #19886.
--------------------------------------------------------------------------------
Because there is no completed patch, I change tracker.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Limit raised to 1024 in r14621.
--------------------------------------------------------------------------------
related_issues
copied_to,Closed,19886,Raise wiki edits comments limit to 1024