Redmine: Issueshttps://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292014-05-19T21:20:48ZRedmine
Redmine Redmine - Patch #16925 (Closed): Improve performance of Principal.member_of scopehttps://www.redmine.org/issues/169252014-05-19T21:20:48ZJean-Baptiste Barth
<p>Using a sub-query is faster, see <a class="changeset" title="Improve performance of Principal.member_of scope The 'join' turns to be slow for large numbers o..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/13139">r13139</a>. Targetting for 2.6.0.</p> Redmine - Defect #14028 (Closed): Plugins Gemfiles loading breaks __FILE__https://www.redmine.org/issues/140282013-05-11T11:15:00ZJean-Baptiste Barth
<p>When loading <code>Gemfile</code> inside plugins, Redmine simply does an <code>instance_eval</code> call. This breaks <code>__FILE__</code> inside loaded files because the filename is not provided (it's set to <code>(eval)</code> actually). This breaks the ability to provide a <code>gemspec</code>, and it may break other features of bundler that relies on current path. The <code>gemspec</code> directive won't work out of the box with the filename provided, but at least it will be possible to manually provide an option to the current directory of the gemspec.</p>
<p>Bundler now provides a <code>eval_gemfile</code> directive in its DSL that would be safer overall, but it's only here since 1.2.0, and we don't enforce such restriction for now (only restriction on bundler version is imposed by rails, requiring <code>~> 1.0</code>).</p> Redmine - Feature #14008 (Closed): Add a warning if 2 plugins have the same settings partial namehttps://www.redmine.org/issues/140082013-05-08T08:08:05ZJean-Baptiste Barth
<p>See <a class="issue tracker-3 status-5 priority-4 priority-default closed" title="Patch: plugin settings partial path collision (Closed)" href="https://www.redmine.org/issues/7071">#7071</a>, it also happened to me a couple of times. If two plugins share the same partial settings name, the first will override the second and you won't be able to configure the second. It shouldn't be hard to add a warning on top of the "Plugins" page to suggest that the author contact plugin authors to fix this.</p> Redmine - Defect #13990 (Closed): Trac importer breaks on exotic filenames and ruby 1.9+https://www.redmine.org/issues/139902013-05-06T22:16:56ZJean-Baptiste Barth
<p>See: <a class="external" href="http://www.redmine.org/boards/2/topics/31188">http://www.redmine.org/boards/2/topics/31188</a>, also reported in other forum threads and <a href="https://github.com/redmine/redmine/pull/6" class="external">here</a>.</p>
<p>The problem is due to the fact that <code>String#[]</code> changed between ruby 1.8 and 1.9. In 1.8 <code>x[0]</code> would return a fixnum representing the character, while it returned the character itself in 1.9 (<a href="http://ruby-doc.org/core-1.8.7/String.html#method-i-5B-5D" class="external">1.8 doc</a>, <a href="http://www.ruby-doc.org/core-1.9.3/String.html#method-i-5B-5D" class="external">1.9 doc</a>). It's easily explained by the unicode support improvements in 1.9 and the fact that a single 1.9 character can map to multiple codepoints.</p>
<p>The easiest workaround is to let the code as is for 1.8 but only take the first codepoint above (unicode strings can have multiple codepoints per character...).</p> Redmine - Defect #13989 (Closed): Trac and Mantis importers reset global notification settingshttps://www.redmine.org/issues/139892013-05-06T20:35:10ZJean-Baptiste Barth
<p>As reported by brandonvalentine <a href="https://github.com/redmine/redmine/pull/6" class="external">here</a> (<a href="https://github.com/brandonvalentine/redmine/commit/1e4be672c9dab48ecb158f780768d59849eb16bd" class="external">fix</a>), notification settings are reset when you use the Trac importer, which is obviously bad. As the structure is really identical, it happens also on the Mantis importer.</p> Redmine - Patch #13927 (New): Reduce coupling between plugins and the "plugins/" directoryhttps://www.redmine.org/issues/139272013-05-02T10:54:01ZJean-Baptiste Barth
<p>Today plugins are just directories in <code><redmine root>/plugins/</code> directory. There are a few implicit assumptions in Redmine code that this is the case, which doesn't add much benefit I think. This reference is needed in the plugin discovery mechanism, but I can see obvious reasons why it may appear anywhere else.</p>
<p>It has at least one disadvantage: it prevents from easily distributing plugins as gems or via an other mechanism (which I think has a long list of advantages that I could enumerate an other day).</p>
<p>An other motivation is that removing this would lead to clearer code I think, we could remove some <code>Dir.glob</code> and <code>File.xxx</code> calls in favor of new, clear methods in <code>Redmine::Plugin</code>.</p>
<p>I'll try to work on that and link commit to this issue.</p> Redmine - Patch #13900 (Closed): Update URL when changing tabhttps://www.redmine.org/issues/139002013-04-28T20:09:09ZJean-Baptiste Barth
Redmine tabs (in Settings or Administration for instance) are all loaded at once when the page is loaded. When changing tab, the URL is not updated, hence it breaks navigation in some minor ways, which I find annoying on a daily basis.. :
<ul>
<li>if the user reloads the page he's sent back to the default tab, not the one he was viewing</li>
<li>previous/next buttons behave counterintuitively : only the default tab remains in the history, and once you leave a tab, you never go back to it without having to re-click on the tab</li>
</ul>
<p>The simplest solution to that is to use the History API introduced a couple years ago in most browsers, so that URL is updated whenever a click on a new tab occurs. Basically it boils down to this: <pre><code class="javascript syntaxhl"><span class="cm">/* better handling of history in redmine tabs */</span>
<span class="nx">$</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="nx">$</span><span class="p">(</span><span class="dl">"</span><span class="s2">.tabs a</span><span class="dl">"</span><span class="p">).</span><span class="nx">on</span><span class="p">(</span><span class="dl">"</span><span class="s2">click</span><span class="dl">"</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="c1">//only trigger history API if supported</span>
<span class="k">if</span> <span class="p">(</span><span class="dl">"</span><span class="s2">replaceState</span><span class="dl">"</span> <span class="k">in</span> <span class="nb">window</span><span class="p">.</span><span class="nx">history</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">//replace current URL with the "href" attribute of the current link</span>
<span class="nb">window</span><span class="p">.</span><span class="nx">history</span><span class="p">.</span><span class="nx">replaceState</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">title</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">href</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">})</span>
<span class="p">})</span>
</code></pre></p>
<p>Any opinion on that is welcome. If none I'll add it in the next few days, I think I'll integrate it directly in the <code>showTab()</code> function.</p> Redmine - Patch #13301 (Closed): Performance: avoid querying all memberships in User#roles_for_pr...https://www.redmine.org/issues/133012013-02-27T00:07:49ZJean-Baptiste Barth
<p>Already discussed a bit in <a class="issue tracker-3 status-5 priority-4 priority-default closed" title="Patch: Avoid retrieving memberships for projects jump box (Closed)" href="https://www.redmine.org/issues/11827">#11827</a></p>
<p><strong>Problem</strong></p>
<p>On my instance at work the average staff user has 150 private projects. <code>User#roles_for_project</code> retrieves all memberships then selects only the one needed for a specific project. This is not problematic when done for current user (for whom memberships need to be retrieved for the project jump box) but it can lead to substantial performance loss when applied to many other users, for instance when generating the list of recipients for email notifications.</p>
<p><strong>Proposal</strong></p>
<p>Replace <code>app/models/user.rb</code> line 428 : <pre>
membership = memberships.detect {|m| m.project_id == project.id}
</pre><br />with : <pre>
membership = memberships.where(:project_id => project.id).first
</pre></p>
<p><strong>Results</strong></p>
On a very slow machine I noticed a 70% gain when generating this list for a specific issue (13s=>4s). On a decent server you will probably see a smaller gap. Some notes :
<ul>
<li>some 50 users on project or so, private project</li>
<li>takes ~50ms to retrieve all memberships per user, + object instantiation</li>
<li>take less than 5ms to retrieve only needed memberships per user</li>
<li>a global count shows 50 memberships for this project, 7000+ memberships in the worst case retrieved without the patch</li>
</ul>
<p>Of course the whole test suite is green before and after the modification (trunk, redmine 1.9.3 on sqlite without scm tests, but no reason to doubt it'd be different with an other setup).</p>
<p><strong>What's next?</strong></p>
<p>First, let me know what you think. I think this patch won't change anything for little redmine installations but can be great for redmine instances with hundreds of projects and dozens of users per project.</p>
<p>Second, performance is hard to track in a complex app such as Redmine. This method is central for determining object visibility, and a simple test showed it's called multiple times for different projects on the same <code>User</code> instance in a few functional/integration test cases, so it's probably the case in real world usage. I'll patch manually my own instance at work and tell you in a few days the benefits and if it doesn't degrade performance dramatically elsewhere.</p>
<p>Third, object visibility code and permissions may deserve a <em>bigger rewrite</em> later, this change is just a quick win and a way to begin the discussion here if you want.</p> Redmine - Patch #12499 (Closed): Use lambda in model scopeshttps://www.redmine.org/issues/124992012-12-04T09:26:14ZJean-Baptiste Barth
<p>Yesterday I had to monkey-patch "Group" in a plugin, and it turned out to be really difficult because there's a scope defined in the Group class which doesn't use lambda. In this case, the scope is evaluated directly, which fails with "Could not find table users" for instance if you're in a "db:migrate" phase and your database is empty.</p>
<p>Hence I propose moving all scopes to their lambda form so that these difficulties disappear for plugin development.</p>
<p>One more thing, using scopes without lambda (or a call-able) will be deprecated in Rails 4 and probably removed in Rails 4.1 (see <a href="https://github.com/rails/rails/commit/0a12a5f8169685915cbb7bf4d0a7bb482f7f2fd2" class="external">this commit</a>).</p>
<p>Let me know what you think. If you're OK with this change I can take care of verifying all models, running tests and making the change everywhere...</p> Redmine - Defect #12285 (Closed): Some unit and functional tests miss fixtures and break when run...https://www.redmine.org/issues/122852012-11-01T10:07:55ZJean-Baptiste Barth
<p>I develop many plugins these days, and had the surprise to see the test suite run ok on MacOSX and fail on one of my Linux systems (2 functional tests breaking). Same ruby version, gems, codebase, etc. It turns out it's because tests are not run in the same order on both platforms, and it seems some unit and functional tests depend on other tests and fail if the other test doesn't run before.</p>
<p>To be sure I prepared a test database and ran each test alone : <pre>
RAILS_ENV=test rake db:drop db:create db:migrate redmine:plugins db:schema:dump db:fixtures:load
cp db/test.sqlite3 db/test.template.sqlite3
for t in test/**/*_test.rb; do
cp db/test.template.sqlite3 db/test.sqlite3
RAILS_ENV=test ruby -Itest $t || echo $t |tee -a tmp/failing_alone.txt
done
</pre></p>
<p>Here's the list I ended with, I excluded scm related tests because I'm not sure they actually have a problem (tests run against 2.1.0 stable version, results in trunk may differ but it's a looong thing to run) : <pre>
test/functional/groups_controller_test.rb
test/functional/issue_categories_controller_test.rb
test/functional/issue_statuses_controller_test.rb
test/functional/mail_handler_controller_test.rb
test/functional/queries_controller_test.rb
test/functional/search_controller_test.rb
test/functional/sessions_test.rb
test/functional/welcome_controller_test.rb
test/integration/api_test/issues_test.rb
test/integration/api_test/users_test.rb
test/integration/issues_test.rb
test/unit/comment_test.rb
test/unit/issue_category_test.rb
test/unit/issue_relation_test.rb
test/unit/issue_test.rb
test/unit/journal_observer_test.rb
test/unit/journal_test.rb
test/unit/lib/redmine/menu_manager/menu_helper_test.rb
test/unit/message_test.rb
test/unit/project_test.rb
test/unit/role_test.rb
test/unit/time_entry_activity_test.rb
test/unit/version_test.rb
test/unit/watcher_test.rb
</pre></p>
<p>For most of them I think the fix may be easy, it's just a missing fixture, a coupling with a previous record or a missing setting. I'll try to see what's the problem in each case and commit fixes in trunk as I find them.</p> Redmine - Patch #11827 (Closed): Avoid retrieving memberships for projects jump boxhttps://www.redmine.org/issues/118272012-09-13T07:37:58ZJean-Baptiste Barth
ApplicationHelper#render_project_jump_box retrieves current user's memberships (and roles, see the association..) so that it can render user's projects. From what I seen it's unecessary, but it comes from an inverse optimization in <a class="changeset" title="Saves an extra SQL query on each request." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/5153">r5153</a> (maybe it was relevant in Rails 2?). Retrieving directly user's projects could be better :
<ul>
<li>saves a complex query : on a large instance at work, the average staff user has 120 projects and the double join in the SQL query doesn't come for free ;</li>
<li>saves a lot of objects instanciations (Memberships)</li>
</ul>
<p>So here's the proposal: <pre>
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 794cc6f..6c1f919 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -237,7 +237,8 @@ module ApplicationHelper
# Renders the project quick-jump box
def render_project_jump_box
return unless User.current.logged?
- projects = User.current.memberships.collect(&:project).compact.uniq
+ #'to_a' forces immediate querying, which saves a 'count' query, see two lines below
+ projects = User.current.projects.active.to_a
if projects.any?
s = '<select onchange="if (this.value != \'\') { window.location = this.value; }">' +
"<option value=''>#{ l(:label_jump_to_a_project) }</option>" +
</pre></p>
<p>On a very slow machine, a neutral page (say <code>/admin/info</code>) spends ~20% of his time building this select. On this machine this line takes about 350ms with the current version, 80ms with the proposed one. On a faster machine, it only saves a few dozens ms, but not something I benchmarked seriously (I can if needed). Of course all tests pass with both versions.</p>
<p>Comments welcome!</p> Redmine - Patch #11704 (Closed): Avoid the use of tag("...", "...", true) in layouthttps://www.redmine.org/issues/117042012-08-25T10:16:29ZJean-Baptiste Barth
<p>Here's a very simplified version of Redmine base layout : <pre>
<html>
<body>
<%= tag('div', {:id => 'main', :class => (sidebar_content? ? '' : 'nosidebar')}, true) %>
<div id="sidebar">
<%= yield :sidebar %>
</div>
<div id="content">
<%= yield %>
</div>
</div>
</body>
</html>
</pre></p>
<p>There's a "tag" helper, processed with ERB, to display "div#main", and it's closed with standard html in the end.</p>
<p>It could be considered as bad practice, but the main problem is that you cannot parse the layout correctly before it's fully processed by ERB. Hence gems that hook in the rendering process don't work correctly for the layout partial. It's the case of <code>deface</code> (<a class="external" href="https://github.com/railsdog/deface">https://github.com/railsdog/deface</a>) for instance, a gem I use these days so that I don't need 50 more view hooks in core.</p>
<p><strong>1st solution</strong> : use inline erb just for the class</p>
<p>i.e. replace the tag line with : <pre>
<div id="main" class="<%= sidebar_content? ? '' : 'nosidebar' %>">
</pre></p>
<p><strong>2nd solution</strong> : use content_tag helper</p>
<p>i.e. something like that : <pre>
<html>
<body>
<%= content_tag 'div', :id => 'main', :class => (sidebar_content? ? '' : 'nosidebar') do %>
<div id="sidebar">
<%= yield :sidebar %>
</div>
<div id="content">
<%= yield %>
</div>
<% end %>
</body>
</html>
</pre></p>
<p>I understand this isn't a problem for redmine core for now, but such a change would ease plugin development a lot and avoid overriding the layout/base partial.</p>
<p>Any thought on this is welcome.</p> Redmine - Patch #11534 (Closed): rake redmine:plugins:test:* could use "pattern" instead of "test...https://www.redmine.org/issues/115342012-07-29T18:17:07ZJean-Baptiste Barth
<p>It's a lot less verbose so it's more readable when running plugin tests, and it's more similar to what's done in rails core.</p>
<p>So in lib/tasks/redmine.rake, we would replace: <pre>
t.test_files = FileList["plugins/#{ENV['NAME'] || '*'}/test/unit/*_test.rb"]
</pre> with <pre>
t.pattern = "plugins/#{ENV['NAME'] || '*'}/test/unit/*_test.rb"
</pre> and so on.</p>
<p>Let me know if there's any objection, if not I'll commit that in a few days.</p> Redmine - Defect #11533 (Closed): rake redmine:plugins:test doesn't run tests in subdirectorieshttps://www.redmine.org/issues/115332012-07-29T18:08:04ZJean-Baptiste Barth
<p>Everything is in the title : the old rake tasks with rails 2.3's engine plugin used to run test even in subdirectories of test/unit, test/functional and test/integration of each plugin. The core tasks also do that. The new custom rake tasks for plugins don't, which can lead to tests not being run (and it took me a while to realize that). I'll fix that asap.</p> Redmine - Patch #11299 (Closed): redmine:plugins:migrate should update db/schema.rbhttps://www.redmine.org/issues/112992012-07-01T20:00:12ZJean-Baptiste Barth
<p>I don't know if it's actually a defect or if it's intentional, but <code>redmine:plugins:migrate</code> task doesn't invoke <code>db:schema:dump</code>, hence it does not update the <code>db/schema.rb</code> file. It causes at least unintuitive behaviour when cloning the database structure or when testing plugins for instance, as the <code>test</code> task invokes active_record's <code>db:schema:load</code> and it might not be up to date.</p>
<p>Any opinion about this ? Can someone think about this as intentional and why ? If not I can commit this later.</p> Redmine - Defect #8729 (Closed): Not-public queries are not privatehttps://www.redmine.org/issues/87292011-07-01T09:29:19ZJean-Baptiste Barth
I'd like to have the opinion of some of you about the following thing :
<ul>
<li>if you save a custom query on issues, and mark it as public, everyone who can view issues can see it in the sidebar, and it's... public</li>
<li>if you don't mark it as public, it's not really private since everyone can access it knowing the URL (increment the ID is a simple way to do that..)</li>
</ul>
I could understand both position about this tiny defect :
<ul>
<li>it may be useful for managers who don't want to display a lot of queries in the sidebar, but want to have some shortcuts for them or their project members</li>
<li>it could be considered as a confidentiality break and be made strictly private to the user who created the custom query</li>
</ul>
<p>Thanks for any though about this.</p> Redmine - Defect #7688 (Closed): Redmine's trunk (rails 2.3.11) doesn't work with Mongrel 1.1.xhttps://www.redmine.org/issues/76882011-02-22T16:46:52ZJean-Baptiste Barth
<p>I reproduce here Etienne's comment in <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Upgrade to Rails 2.3.11 (Closed)" href="https://www.redmine.org/issues/6887">#6887</a> (Rails upgrade) :</p>
<blockquote>
<p>Note that Mongrel 1.1.5 does not work anymore with Rails 2.3.8 or later because of 2 bugs respectively in rack 1.1.x and Mongrel 1.1.5.</p>
<p>See <a href="https://rails.lighthouseapp.com/projects/8994/tickets/4690" class="external">ticket 4690</a> in Rails tracker and <a href="https://github.com/fauna/mongrel/issues#issue/5" class="external">ticket 5</a> in Mongrel's.</p>
<p>Until Mongrel 1.2.0 is out, it is required to add a <a href="https://gist.github.com/826692" class="external">mongrel.rb</a> initializer to <code>config/initializers</code>.</p>
</blockquote>
<p>I can't reproduce with "mongrel + script/server", but I confirm "mongrel_rails" crashes, and I confirm the proposed initializer solves the problem on a development instance.</p>
A few questions :
<ul>
<li>does anybody know if it affects Thin too ?</li>
<li>can anybody test it some days in <em>production</em> to see if it doesn't have any drawback ? There's no feedback on rails lighthouse tracker for the moment..</li>
</ul> Redmine - Patch #7570 (New): Change test_helper requirement in testshttps://www.redmine.org/issues/75702011-02-07T16:57:36ZJean-Baptiste Barth
<p>In <a class="changeset" title="Use absolute paths in test/**/* requires for Ruby 1.9.2 compatibility. #4050" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/4509">r4509</a> I changed the way test_helper was required in all our tests, so that tests could run on ruby 1.9.2 (ftr, ruby 1.9.2 no longer includes "." in $LOAD_PATH by default). This change was also made to ease test runs from command line (e.g. <code>ruby /path/to/one/test.rb</code>).</p>
<p>Gregor <a href="https://github.com/edavis10/redmine/commit/17f86d964fe05e677714baa35ec319abe13ae8bf#commitcomment-263250" class="external">said on github</a> that a simple <code>require 'test_helper'</code> would be good enough with ruby's <code>-I</code> flag.</p>
<p>Any thought about that ? If not, I'll replace them with simplers <code>require 'test_helper'</code>.</p> Redmine - Patch #7212 (Closed): Missing remove_index in AddUniqueIndexOnMembers down migrationhttps://www.redmine.org/issues/72122011-01-01T23:07:07ZJean-Baptiste Barth
<p>... which breaks ability to run a db:migrate down to a previous migration then up to the last one.</p> Redmine - Patch #7115 (Closed): Improve Project methods to enable/disable moduleshttps://www.redmine.org/issues/71152010-12-15T21:53:34ZJean-Baptiste Barth
<p>Enabling or disabling modules is not so easy now. It could be really useful when writing tests, doing modifications for many projects in a "script/console" (or "runner"), and of course in plugins. If nobody has an objection, I'm working it.</p> Redmine - Defect #7114 (Closed): New gantt doesn't display some projectshttps://www.redmine.org/issues/71142010-12-15T21:45:57ZJean-Baptiste Barth
<p>With new gantt charts, subprojects for which parent project doesn't have issue_tracking enabled are not shown.</p>
<p>Explicit use case: I defined some root projects where I only enable gantt, calendar and news systems, and subprojects which map to real-world projects so they have issues, versions, documents, etc.</p>
I have a working patch for that, but it's pretty inefficient:
<ul>
<li>either you display all projects (not desired behaviour I suppose?)</li>
<li>either you try to find if a project have descendants with issue_tracking enabled (respecting visibility...)</li>
</ul>
<p>I'd welcome any suggestion to define what should be the desired behaviour and what are the potential extreme cases we don't want to handle.</p> Redmine - Defect #7047 (New): Git adapter very slow when a commit modifies a lot of fileshttps://www.redmine.org/issues/70472010-12-04T23:09:51ZJean-Baptiste Barth
<p>I have a Git repo with thousands of files modified in some commits. Repository index action is very slow (>20s).</p>
<p>At first sight, it seems it's due to <code>Redmine::Scm::Adapters::GitAdapter#revisions</code> uses <code>--raw</code> option, which is not needed in all cases, at least not needed in <code>Repository::Git#latest_changesets</code>. It results in thousands of useless lines parsed after the shell-out.</p>
<p>I'll have a look at that. I admit it's not a common use case, hence the priority.</p> Redmine - Defect #6763 (Closed): New gantt charts: subject displayed twice on issueshttps://www.redmine.org/issues/67632010-10-27T21:59:27ZJean-Baptiste Barth
<p>See screenshot:</p>
<p><img src="https://www.redmine.org/attachments/download/4734/gantt_issue_subjects_displayed_twice.png" alt="" /></p>
<p>Probably due to the fact that <code>link_to_issue</code> already displays the subject of the issue by default. So lines 539 and 540 of <code>lib/redmine/helpers/gantt.rb</code> are redundant. Eric I let you confirm.</p> Redmine - Patch #6762 (Closed): Use GET instead of POST to retrieve context_menuhttps://www.redmine.org/issues/67622010-10-27T21:01:02ZJean-Baptiste Barth
<p>See <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: ActionView::TemplateError (undefined method `empty?' for nil:NilClass) on line #12 of app/views/c... (Closed)" href="https://www.redmine.org/issues/6750">#6750</a>. As the action doesn't change anything on the server, it should use GET not POST if we follow REST principles.</p> Redmine - Patch #6761 (Closed): Use blank?/present? methods instead of empty? to avoid nil undefi...https://www.redmine.org/issues/67612010-10-27T20:59:08ZJean-Baptiste Barth
<p>Discussed in <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: ActionView::TemplateError (undefined method `empty?' for nil:NilClass) on line #12 of app/views/c... (Closed)" href="https://www.redmine.org/issues/6750">#6750</a>, I think it would be a good practice to avoid the well known "undefined method error for nil:NilClass". Plus it would make some views clearer...</p> Redmine - Patch #6527 (Closed): Recent migrations don't have the correct datehttps://www.redmine.org/issues/65272010-09-29T08:29:41ZJean-Baptiste Barth
<p>Migrations added in <a class="changeset" title="Converted User#mail_notification from a boolean to a string. The string will now store which typ..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/4216">r4216</a> don't have the correct name (201001 instead of 201009). <code>db:migrate</code> run fine but the schema version reported with <code>ruby script/about</code> is somehow incorrect. It has no consequence until someone report an issue and we don't know if his database is up to date. It shouldn't be a problem if we plan to have other migrations in a near future.</p>
<p>Eric: I let you decide if it should be changed or not.</p> Redmine - Defect #6407 (Closed): New gantt charts shouldn't display all issues / versionshttps://www.redmine.org/issues/64072010-09-16T05:28:23ZJean-Baptiste Barth
Old gantt chart used to display :
<ul>
<li>issues with a start and due date</li>
<li>issues with no due date, but assigned to a target version with a due date</li>
</ul>
<p>It seems new gantt chart displays issues with no start date, no due date and no target version, which introduce blank lines in the gantt. And it's problematic when you have 200+ issues in a project. The old behavior was reasonnable for me.</p>
<p>Is it desired behavior ? If so, shouldn't we have a something (a checkbox?) to easily hide those issues ?</p>
<p>Anyway, I'm very happy with the rewrite, it's much more clear/beautiful/useful, good job!</p> Redmine - Patch #6317 (Closed): Template names conventionshttps://www.redmine.org/issues/63172010-09-07T02:48:47ZJean-Baptiste Barth
<p>Can we update template names to rails 2.x conventions (rhtml -> html.erb) ? Or at least clean the <code>render :template</code> with filenames hardcoded in controllers which can make a plugin developer not understanding why his view his not overriding the core's one ?</p>
<p>Any thought/pros/cons about that ?</p> Redmine - Defect #6302 (Closed): Temporary filters added to a custom query are not kept across re...https://www.redmine.org/issues/63022010-09-05T01:13:51ZJean-Baptiste Barth
<p>When you add filters from scratch everything works fine.</p>
<p>But if you build your filters based on a custom query, they're lost after pressing back button, or after updating a field through context menu. Which drives my users mad..</p>
<p>I suspect it's because the presence of a query_id parameter reset everything before applying the filter.</p> Redmine - Defect #6301 (New): Unintuitive display of groups in project settingshttps://www.redmine.org/issues/63012010-09-05T01:05:48ZJean-Baptiste Barth
<p>See attached screenshot.</p>
<p><img src="https://www.redmine.org/attachments/download/4428/group_display_in_project_settings.png" alt="" /></p>
When defining a group as member of a project, this is the result :
<ul>
<li>group is displayed after its members. So you don't really understand at first sight that User Misc is here because he's in A Team</li>
<li>you don't know why you cannot delete the user</li>
</ul>
<p>It could be clearer with appropriate UI changes.</p> Redmine - Feature #6300 (New): Add a filter for items displayed in gantt view (version, issues)https://www.redmine.org/issues/63002010-09-05T00:58:38ZJean-Baptiste Barth
<p>When managing many projects, sometimes you'd just like to see versions coming without any issue in gantt global view. It's not possible unless you have a dumb filter to remove all issues.</p>
<p>It would be good to have a filter (maybe checkboxes on top of issues filters? or in the sidebar like activity page?) to say which type of items you want to see. Same goes for calendar maybe, but I don't use it much so I may be mistaken.</p>
<p>I don't know if it would be problematic with <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Gantt Chart rewrite (Closed)" href="https://www.redmine.org/issues/6276">#6276</a> (Gantt chart rewrite), Eric ?</p> Redmine - Feature #6299 (Closed): Add "watched" as possible column in issues listhttps://www.redmine.org/issues/62992010-09-05T00:51:35ZJean-Baptiste Barth
<p>Would probably be just a star displayed right before or after the issue ID. Next we would turn it into a clickable image like in Gmail to watch/unwatch issues.</p> Redmine - Feature #6298 (New): Updating through context menu should scroll back to the same linehttps://www.redmine.org/issues/62982010-09-05T00:48:55ZJean-Baptiste Barth
<p>When reviewing a large list of issues, each time you update an issue you go back to the bottom of the list.</p>
<p>One approach is to lower the number of items per page, so that you come back to the page you were before, but it doesn't satisfies me at all because it breaks the global view you can have with a complete list in one page.</p>
Here are two possibilities :
<ul>
<li>updating only the lines in place through an ajax call ; there's a risk it's not filtered or sorted the good way after that, but it's less problematic I think.</li>
<li>remember where the user was with a bit of javascript and scroll down to the same place (my preferred option for the moment)</li>
</ul>
<p>Any though about that ?</p> Redmine - Feature #6297 (New): Quick filters in context-menuhttps://www.redmine.org/issues/62972010-09-05T00:38:02ZJean-Baptiste Barth
<p>Something really useful for daily usage in Service Now (<a class="external" href="http://service-now.com/">http://service-now.com/</a>) is the ability to right click on a ticket and select "Filter on the same..." then choose a field.</p>
<p>In Redmine, it could reproduce the same request and add the desired filter. Not so complicated to implement I think.</p>
<p>Let me know if you think it would be useful (and if you see what I mean..).</p> Redmine - Feature #6296 (Closed): Bulk-edit custom fields through context menuhttps://www.redmine.org/issues/62962010-09-05T00:35:09ZJean-Baptiste Barth
<p>Same request as in <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Support bulk updating of custom fields (Closed)" href="https://www.redmine.org/issues/461">#461</a>, <a class="issue tracker-3 status-5 priority-4 priority-default closed" title="Patch: Bulk Edit of Custom Fields (Closed)" href="https://www.redmine.org/issues/2560">#2560</a> and related, but for context menu : custom fields of type "List" or "Boolean" at least should be editable through context menu.</p> Redmine - Defect #6295 (New): Some context menu actions in "View all issues" page redirect to iss...https://www.redmine.org/issues/62952010-09-05T00:31:51ZJean-Baptiste Barth
<p>Not intuitive at all, especially if you manage hundred of projects and use intensively the "View all issue" table. It should leave user to "View all issue" page I think.</p> Redmine - Defect #6294 (Closed): Pressing "Enter" key when filling a filter triggers "Save" actionhttps://www.redmine.org/issues/62942010-09-05T00:29:35ZJean-Baptiste Barth
<p>It would be much more intuitive if the "Apply" action was triggered when hitting "Enter" key, I don't think anybody saves custom queries 10 times a day..</p> Redmine - Patch #6291 (Closed): User#allowed_to? is not testedhttps://www.redmine.org/issues/62912010-09-03T20:12:16ZJean-Baptiste Barth
<p>I tried to work a bit on bulk-edit for issues from different projects (<a class="issue tracker-2 status-5 priority-3 priority-lowest closed" title="Feature: Allow bulk edit of issues from different projects (Closed)" href="https://www.redmine.org/issues/5332">#5332</a>) these days, and I needed to modify User#allowed_to?. I prefer having some unit tests before doing that.</p> Redmine - Patch #6290 (Closed): Make journals theming easierhttps://www.redmine.org/issues/62902010-09-03T20:04:08ZJean-Baptiste Barth
<p>It should be easier to hide journals when they don't have content, or highlight them differently depending whether there's content/details in it.</p>
<p>It just needs some additional css classes, added in <a class="changeset" title="Add css classes to journals display to facilitate theming" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/4057">r4057</a>.</p> Redmine - Patch #6289 (Closed): Checkboxes in issues list shouldn't be displayed when printinghttps://www.redmine.org/issues/62892010-09-03T19:57:00ZJean-Baptiste Barth
<p>+ "th" checkbox tag deserve a css class to allow hiding them easily in themes.</p>
<p>Applied in <a class="changeset" title="Hide checkboxes in issues list when printing" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/4056">r4056</a></p> Redmine - Defect #6271 (Closed): Too many tabs on project viewshttps://www.redmine.org/issues/62712010-09-02T10:35:17ZJean-Baptiste Barth
<p><a class="changeset" title="Treat Calendar and Gantt pages as separate modules. #6153 This will let the Issue Tracking, Gant..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/4013">r4013</a> (<a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Move view_calendar and view_gantt to own modules (Closed)" href="https://www.redmine.org/issues/6153">#6153</a>) added new modules for Gantt and Calendar views, which is a good thing in my opinion.</p>
<p>But now we have 14 tabs if we activate every modules for a project, which is far too much. It forces user to scroll horizontally for horizontal resolutions less than 1024px.</p>
<p>Plus for Calendar and Gantt cases, there are already links in Issues' sidebar. It makes UI a bit messy / confusing.</p>
<p>Any idea to improve that ?</p> Redmine - Feature #6269 (New): RedCloth 4 supporthttps://www.redmine.org/issues/62692010-09-02T03:09:46ZJean-Baptiste Barth
<p>Adding support for Redcloth 4 would be nice since Redcloth 3.x is clearly outdated and has many bugs and limitations.</p>
But we have to make some choices before integrating this :
<ol>
<li>Redcloth 4.x needs native compiling, which could be problematic, especially for Windows users. What should we do :
<ul>
<li>try to find how we could make installation easier, and try to switch from redcloth3 to redcloth4</li>
<li>integrate redcloth4 support as an extra feature (like OpenID authentication: redmine behavior would depend on the presence of a system gem) ? Cons: duplicated testing / things to maintain</li>
<li>just add this as a "core plugin" ?</li>
<li>write our own (light) textile parser for the core and drop all this into plugins ?</li>
</ul>
</li>
<li>when ? which target version ?</li>
<li>if we decide to stay on redcloth3, pros/cons ? is there something we can do to bypass actual limitations (use of light mode in activity summaries, hard_breaks related problems, handling of pre/code/@ sections,...)</li>
<li>does anyone know good alternatives to redcloth ?</li>
</ol>
<p>I leave a tiny patch which basically just let you boot a redmine trunk instance with your system's redcloth 4.2 gem. Basic formatting works but there are many broken tests. I can work on it, but I'd prefer we answer questions above before.</p> Redmine - Defect #6163 (Closed): Bad CSS class for calendar project menu_itemhttps://www.redmine.org/issues/61632010-08-17T19:21:11ZJean-Baptiste Barth
<p>See screenshot attached.</p>
<p><img src="https://www.redmine.org/attachments/download/4324/calendar_item_bad_css.png" alt="" /></p>
<p>It's due to a CSS class name collision with calendar.css, which defines ".calendar". I wonder if it should be fixed in calendar.css or in classes definitions for our menu items.</p> Redmine - Defect #6100 (Closed): User's profile should display all visible projectshttps://www.redmine.org/issues/61002010-08-10T19:10:35ZJean-Baptiste Barth
<p>For the moment projects displayed in users' profiles are public projects and private projects the current user is member of. But if you're admin, you should also see other private projects even if you're not member of them. I'm working on it.</p> Redmine - Patch #6008 (Closed): Move admin_menu to Redmine::MenuManagerhttps://www.redmine.org/issues/60082010-07-31T09:10:54ZJean-Baptiste Barth
<p>Admin menu should be moved to a standard Redmine::MenuManager so that it can be modified in a plugin the same way we do with other menu.</p>
<p>For the moment the only way to modify this menu really (not just add something, reorganize or remove items for instance) is to override the view. If 2 plugins do this, the 2nd will override 1st modifications. This problem doesn't occur anymore if the menu is managed with Redmine::MenuManager.</p>
<p>See patch attached. If it's functionnally OK, we can integrate this easily, it should not break anything in existing plugins.</p> Redmine - Feature #6004 (Closed): New generator : redmine_plugin_scaffoldhttps://www.redmine.org/issues/60042010-07-30T12:48:31ZJean-Baptiste Barth
<p>I often develop tiny plugins these days for specific needs at work, and it's a pain to redo the same things each time in the views, controllers, etc. See patch attached. I'd be happy to have feedback, and tell me if you think it should be integrated to the core.</p>
<p>NB: it does not generates locales of course, and it does not rename migrations to "00N_" style ; so you have those two things to do before using such a scaffold in your plugin</p> Redmine - Defect #5937 (Closed): Harmonize french locale "zero" translation with other localeshttps://www.redmine.org/issues/59372010-07-22T11:03:04ZJean-Baptiste Barth
<p>French locale is the only one with "zero" written alphabetically in some entries. For instance, <code>label_x_open_issues_abbr_on_total_zero</code> is <code>zéro ouvert sur {{total}}</code>, while other locales have a simpler <code>0 open / {{total}}</code> with the appropriate equivalent for "open".</p>
<p>It can make project welcome (overview) page difficult to read, and anyway, it makes french locale different from every other. French guys: let me know what you think.</p>
<p>See proposal patch attached.</p> Redmine - Feature #5920 (Closed): Unify and improve cross-project views layouthttps://www.redmine.org/issues/59202010-07-21T03:24:09ZJean-Baptiste Barth
Recently I started using Redmine with many projects inside (~100), and I found cross-project views not really easy to use :
<ul>
<li>only accessible by "Projects" link in top menu</li>
<li>there you have a list of your projects with contextual links which are not really contextual, but lead to other "sections" (view all issues, overall spent time, overall activity)</li>
<li>when you click on one of those links the layout changes completely : no more contextual links, you have heterogeneous sidebars</li>
<li>you cannot go to an other of the first "sections" without re-clicking on "Projects" at the top (or doing an "Previous page" in the browser to go back there..)</li>
<li>a tiny (but maybe unrelated) annoying thing for me : when you don't have any project using time tracking module, you should not see "Overall spent time" link anywhere</li>
</ul>
<p>Imho it's a notable usability defect if you need those cross-project informations. I leave a patch where I just modified views and added a "cross-sidebar", which should be displayed on each of those pages. It's not perfect at all (maybe to much "h3" sections for instance..). Consider it as a possible start point for the discussion.</p>
<p><img src="https://www.redmine.org/attachments/download/4159/cross_project_layout.png" alt="" /></p>
<p>Let me know what you think.</p> Redmine - Patch #5912 (Closed): Translation update for french localehttps://www.redmine.org/issues/59122010-07-20T07:10:13ZJean-Baptiste Barth
<p>I didn't found a correct translation for "field_principal", don't even know if "Principal" is appropriate in english... Does anyone know where it is used ?</p> Redmine - Defect #5904 (Closed): Global gantt PDF and PNG should display project nameshttps://www.redmine.org/issues/59042010-07-19T07:53:19ZJean-Baptiste Barth
<p>When you go to "/issues/gantt" (cross-project gantt), then try to export it as a PDF file, project names are not displayed. They should, both for issues and versions, because issues can come from many projects (94 in our case), so not having this information can be a bit confusing.</p>
<p><em>edit by Mischa The Evil:</em><br />This also happens on PNG export.</p> Redmine - Patch #5899 (Closed): Display user's gravatar when editing profilehttps://www.redmine.org/issues/58992010-07-18T14:28:08ZJean-Baptiste Barth
<p>See screenshot and patch attached, let me know what you think.</p>
<p><img src="https://www.redmine.org/attachments/download/4128/gravatar_users_edit.png" alt="" /></p> Redmine - Patch #5898 (Closed): Projects should be displayed as links in users/membershipshttps://www.redmine.org/issues/58982010-07-18T14:09:15ZJean-Baptiste Barth
<p>Everything is in the title. It's nothing, but when editing user memberships it's a bit annoying we cannot browse project easily from here.</p> Redmine - Defect #5760 (Closed): Assigned_to and author filters in "Projects>View all issues" sho...https://www.redmine.org/issues/57602010-06-25T07:35:12ZJean-Baptiste Barth
<p>As I was working on <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Assigned to list for parent project in issue filter missing users of child projects (Closed)" href="https://www.redmine.org/issues/2055">#2055</a>, I noticed that anonymous user doesn't have filters for "assigned_to" and "author" fields in the cross-project "View all issues" page. In fact users can only filter on users of projects they currently are member of, whereas they should be able to filter on each visible project. Actually that's what they can do in each project "Issues" tab, so there's no reason they couldn't do it in cross-project view.</p>
Steps to reproduce (here on <a class="external" href="http://www.redmine.org">www.redmine.org</a> for instance) :
<ul>
<li>log out</li>
<li>click on "Projects" at the top, then on "View all issues" in the sidebar</li>
<li>try to add a filter => no "Author" or "Assigned to" option</li>
</ul>
<p>Patch attached. Can anybody confirm this is functionally appropriate before I push it to the trunk ?</p> Redmine - Patch #5416 (Closed): Exclude "fields_for" from overridden methods in TabularFormBuilderhttps://www.redmine.org/issues/54162010-04-30T12:50:45ZJean-Baptiste Barth
<p>...since it's broken in some way in current implementation, and it's never called on the builder itself in Redmine core. It would be helpful to handle nested attributes in plugins.</p>
<p>To be clear, I'd like to be able to do something like this : <pre>
f.fields_for :association, MyAssociatedModel.new do ... end
or
f.fields_for :association, @main_object.my_associated_models do ... end
</pre><br />...where "f" is a standard TabularFormBuilder.</p>
<p>But it's broken in current implementation since method is overridden with a different signature than its parent : <code>fields_for(field, options={})</code> VS <code>fields_for(record_or_name_or_array, *args, &block)</code>.</p>
<p>Patch attached, no test broken on my platform with current trunk (<a class="changeset" title="Fixes selected menu tab when issue creation fails." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/3704">r3704</a>). I can give a more detailed example if needed.</p> Redmine - Feature #5328 (Closed): Automatically add "Repository" menu_item after repository creationhttps://www.redmine.org/issues/53282010-04-15T17:02:06ZJean-Baptiste Barth
<p>When you create a repository for your project in Settings>Repository, the menu item isn't displayed immediately. It can be a bit confusing for some users. It would be cool to update main-menu directly.</p>
<p>I attach a patch for current git trunk. I don't really know how to test it easily (depends on the SCM + asynchronous..). Thanks for any help on this point or any though about that.</p> Redmine - Patch #4609 (Closed): Plugin generators should display help if no parameter is givenhttps://www.redmine.org/issues/46092010-01-19T12:10:20ZJean-Baptiste Barth
<p>I was sure I reported this before but cannot find the issue here on redmine.org...</p>
<p>In most (all?) standard generators, if no parameter is given, the help is displayed. I often rely on this when generating models/controllers, but I get an error with 2 redmine generators : <pre>
% ruby script/generate redmine_plugin_model
undefined method `underscore' for nil:NilClass
% ruby script/generate redmine_plugin_controller
undefined method `underscore' for nil:NilClass
OR (on an other machine) :
% ruby script/generate redmine_plugin_controller
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.underscore
</pre></p>
<p>I leave a tiny, tiny patch.</p>
<p>NB: redmine_plugin is not affected by such a bug since "super" is called at the beginning of the initialize() method.</p> Redmine - Patch #4351 (Closed): Plugin admin links broken in admin/indexhttps://www.redmine.org/issues/43512009-12-06T23:22:01ZJean-Baptiste Barth
<p>In app/views/admin/index.rhtml, we have a "menu_items_for" block (from <a class="changeset" title="Pluggable admin menu (patch #2031 by Yuki Sonoda with slight changes)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/2022">r2022</a>) to allow plugins to insert their own links there. Method definition has changed in <a class="changeset" title="Converted Menus to a Tree structure to allow submenus. * Bundle the rubytree gem * Patched RubyT..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/3090">r3090</a>, but not this view, and "caption" is not yielded anymore, so these links are broken (if I'm not mistaken).</p>
<p>Maybe the actual block should be replaced with something like this : <pre>
<% menu_items_for(:admin_menu) do |item| -%>
<%= content_tag 'p',
link_to(h(item.caption), item.url, item.html_options),
:class => ["icon22", "icon22-#{item.name}"].join(' ') %>
<% end -%>
</pre></p> Redmine - Defect #4182 (Closed): Links on locked users lead to 404 pagehttps://www.redmine.org/issues/41822009-11-08T22:45:29ZJean-Baptiste Barth
<p>When you lock a user account (for instance because person has left the team), there are still many links in every issues, wiki pages, comments left by this person. When you click on them, you are redirected to a 404 page, which is not very easy to understand for users imho.</p>
<p>I think this is because in UsersController#show, user is searched with the "active" scope, and there's a <code>rescue ActiveRecord::RecordNotFound; render_404</code> at the end of the action. Maybe you could forget the "active" scope, and change the display after that with a specific error page ?</p>
<p>Any opinion on this ?</p> Redmine - Patch #4181 (Closed): Alternate theme : password fields should have the same style as t...https://www.redmine.org/issues/41812009-11-08T21:47:17ZJean-Baptiste Barth
<p>Sorry for this proposal, there's no "very very low" priority.. But login page is much nicer with that.</p> Redmine - Patch #4180 (Closed): Add CSS class to each field in app/views/issues/show.rhtmlhttps://www.redmine.org/issues/41802009-11-08T21:38:13ZJean-Baptiste Barth
<p>I saw <a class="issue tracker-3 status-5 priority-4 priority-default closed" title="Patch: Add CSS style for priority and status in app/views/issues/show.rhtml (Closed)" href="https://www.redmine.org/issues/2864">#2864</a> ; is there any reason why some fields have a CSS class and other don't ? At work, we use this to hide some fields we don't use.</p>
<p>If there's no reason, I leave a tiny patch. There's no conflict with existing css class (except for "td.category" but no big deal, there's just a "white-space: normal" in it)</p> Redmine - Feature #2985 (Closed): Make syntax highlighting pluggablehttps://www.redmine.org/issues/29852009-03-16T16:38:01ZJean-Baptiste Barth
<p>As discussed in <a class="issue tracker-3 status-5 priority-4 priority-default closed" title="Patch: Hack to make redmine use pygmentize instead of CodeRay (Closed)" href="https://www.redmine.org/issues/1651">#1651</a>, actual CodeRay support in Redmine is limited, and it could be interesting to make syntax highlighting pluggable. Here is a proposal which keeps actual CodeRay behaviour by default, and allow plugins to implement syntax highlighting. See syntax_highlighting.diff</p>
<p>The second patch prevents Redcloth from escaping some chars when they're in a code block which will be treated by syntax highlighter. There's also a minor change to desactivate a broken (useless?) facility. It doesn't matter for coderay, but other highlighters like <a href="http://ultraviolet.rubyforge.org/" class="external">Ultraviolet</a> cannot parse code with ampersands everywhere... Note this patch is necessary if you want the plugin below to work well in wikis sections (no impact on attached files). Also note the same kind of trick can easily solve <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Inline code with less-then/greater-than produces @lt; and @gt; respectively (Closed)" href="https://www.redmine.org/issues/1416">#1416</a>. See redcloth.diff</p>
<p>As an example, I leave a basic plugin to support <a href="http://ultraviolet.rubyforge.org/" class="external">Ultraviolet</a> syntax highlighting, with active4d theme. It's quite simple, you just have to make your own module under Redmine::SyntaxHighlighting and define some methods. See ultraviolet_highlighter.zip</p>
<p>Any comment about all that is welcome !</p> Redmine - Defect #2526 (Closed): 103_set_custom_fields_editable.rb and Sqlite3 supporthttps://www.redmine.org/issues/25262009-01-18T06:16:43ZJean-Baptiste Barth
<p>Here is my script/about and the problem I found trying to run a db:migrate on latest <a class="changeset" title="Changes project selection boxes." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/2277">r2277</a> :</p>
<pre>
# ruby script/about
About your application's environment
Ruby version 1.8.6 (i686-linux)
RubyGems version 1.3.1
Rails version 2.1.2
Active Record version 2.1.2
Action Pack version 2.1.2
Active Resource version 2.1.2
Action Mailer version 2.1.2
Active Support version 2.1.2
Application root /my/super/path/redmine/r2277
Environment development
Database adapter sqlite3
Database schema version 102
# rake db:migrate
(in /my/super/path/redmine/r2277)
== 103 SetCustomFieldsEditable: migrating =====================================
rake aborted!
SQLite3::SQLException: no such column: false: UPDATE "custom_fields" SET editable = false WHERE ( ("custom_fields"."type" = 'UserCustomField' ) )
</pre>
<p>My Sqlite version is 3.3.8. Replacing "true"/"false" by "1"/"0" in the migration file solves this for Sqlite. It's OK with Mysql too, but I don't have any Postgres cluster at home to be sure it works with Postgres. Maybe someone could test it before applying any patch or solving it another way ?</p> Redmine - Patch #2265 (Closed): Revert a specific plugin migrationshttps://www.redmine.org/issues/22652008-12-02T14:20:42ZJean-Baptiste Barth
<p>There's a topic on the forum <a href="http://www.redmine.org/boards/2/topics/show/2820" class="external">here</a> where the person asks how to revert plugin migrations easily. I think it would be useful if people want to try plugins and then uninstall it.</p>
<p>Engines seems to be able to do that but I didn't managed to make it work. Anyway, I think it's the same as the task to migrate all plugins : Engines know how to do this but a redmine specific task has been added. So I suggest to add a redmine specific task to migrate just one plugin.</p>
<p>I leave a patch in attachment, which is nearly a copy/paste from Engines db:migrate:plugin task.</p>
<p>Usage:<br /><code>$ rake db:migrate_plugin NAME=my_plugin</code> : migrate to last version of "my_plugin" <br /><code>$ rake db:migrate_plugin NAME=my_plugin VERSION=X</code> : migrate to version X (and 0 when you uninstall)</p>
<p>Any opinion about that ?</p> Redmine - Feature #2194 (Closed): Have many controllers associated with a single menu_item (espec...https://www.redmine.org/issues/21942008-11-15T04:45:10ZJean-Baptiste Barth
<p>I'm building a plugin with many controllers. I'd like to have a way to specify in my plugin's init.rb how to link theses controllers with a single menu item. If I'm not wrong, it's not possible for the moment. As the plugin has its own single tab in the "project_menu", when you jump from a controller to another, the tab isn't selected anymore, making my users feel lost (I just suppose).</p>
<p>The selection of a tab seems to be handled by a simple comparison between the menu item name and the current controller name. In the attached diff I've changed a bit the way item is detected as being the selected one. There should be no impact on existing menu calls. Perhaps you'll prefer another implementation, or tell me this is completely useless for other people, which I can easily imagine.</p>
<p>USAGE<br />It can be used as an option for "menu" method in yourplugin/init.rb : <code>:for => [:controller1, :controller2, ...]</code><br />Note that the comparison with the menu name as no more effect if a ":for" array is defined, i.e. if you name your menu "mycontroller" and a ":for" option is present, menu item won't be selected unless ":mycontroller" is present in the ":for" option.</p> Redmine - Feature #2142 (Closed): Change the way plugin routes are integratedhttps://www.redmine.org/issues/21422008-11-07T09:35:26ZJean-Baptiste Barth
<p>Plugin's routes can today ( <a class="changeset" title="#2121, pt-br update" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/1977">r1977</a> ) be handled thanks to a hook in the config/routes.rb :<br /><pre>Redmine::Hook.call_hook :routes, :map => map</pre>The developper has to define his routes in vendor/plugins/redmine_myplugin/init.rb (in the register block) :<br /><pre>
class MyRoutes < Redmine::Hook::Listener
def routes(context)
context[:map].resources :mymodel
context[:map].connect 'mypath/:blah', :controller => 'mycontroller'
#etc.
end
end
Redmine::Hook.add_listener(MyRoutes)
</pre></p>
<p>Maybe it is possible to use Engines system to handle each plugin's routes, with "map.from_plugin" method :<br />- in config/routes.rb<br /><pre>
Rails.plugins.each do |plugin|
map.from_plugin plugin.name.to_sym
end
</pre>- in vendor/plugins/redmine_myplugin/routes.rb<br /><pre>
resources :mymodel
connect 'mypath/:blah', :controller => 'mycontroller'
</pre></p>
<p>It has been discussed <a href="http://www.redmine.org/boards/1/topics/show/2885" class="external">here</a> in the forum. Maybe it would be easier to use for plugin developpers, but I'm not 100% sure routes overriding will produce the same effect.</p>