Project

General

Profile

Defect #1381

Scrum plugin doesn't work with redmine 3.4.x

Added by Edouard B over 7 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Normal
Category:
General
Target version:
Source:
Development
Detected on version:
Blocked:
No
Alone:
No
Milestones:
Sprint:

Description

The scrum plugin work but a lot of pages can't be loaded (error 500) and the log show :

Started GET "/redmine/issues/4299" for x.x.x.x at 2017-07-10 14:30:01 +0200
Processing by IssuesController#show as HTML
Parameters: {"id"=>"4299"}
Current user: xxxxxx (id=1)
Completed 500 Internal Server Error in 47ms (ActiveRecord: 0.0ms)

NoMethodError (undefined method `<<' for {}:Hash
Did you mean? <):
plugins/scrum/lib/scrum/issue_query_patch.rb:47:in `issue_ids_with_scrum'
app/controllers/issues_controller.rb:423:in `retrieve_previous_and_next_issue_ids'
app/controllers/issues_controller.rb:105:in `block (2 levels) in show'
app/controllers/issues_controller.rb:99:in `show'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'


Subtasks

To do #1392: Upgrade pluginResolvedEmilio González MontañaActions
To do #1405: Spent time link on task post-its failsResolvedEmilio González MontañaActions
To do #1407: Create and continue button doesn't workResolvedEmilio González MontañaActions

Related issues

Has duplicate Scrum - Defect #1393: Cannot save plugin settingsRejectedActions
#1

Updated by Angelinsky7 Angelinsky7 over 7 years ago

i don't know if this is the right answer but changing the file issue_query_patch.rb
from

def issues_with_scrum(options = {})
          options[:include] ||= {}
          options[:include] << :sprint
          issues_without_scrum(options)
        end
        alias_method_chain :issues, :scrum

        def issue_ids_with_scrum(options = {})
          options[:include] ||= {}
          options[:include] << :sprint
          issue_ids_without_scrum(options)
        end

to

def issues_with_scrum(options = {})
          options[:include] ||= []
          options[:include] << :sprint
          issues_without_scrum(options)
        end
        alias_method_chain :issues, :scrum

        def issue_ids_with_scrum(options = {})
          options[:include] ||= []
          options[:include] << :sprint
          issue_ids_without_scrum(options)
        end

seems to do the job... i dont know why it was working before the redmine new version because it seems that Hashes in ruby don't have the '<<' operator but....

#2

Updated by Angelinsky7 Angelinsky7 over 7 years ago

to add to the redmine corrections :
in lib\scrum\projects_helper_patch.rb we must change @line 17

index = tabs.index({:name => 'versions', :action => :manage_versions,
                                :partial => 'projects/settings/versions',
                                :label => :label_version_plural})

to

index = tabs.index({:name => 'versions', :action => :manage_versions,
                                :partial => 'projects/settings/versions',
                                :label => :label_version_plural,
                                :url => {:tab => 'versions',
                                         :version_status => params[:version_status],
                                         :version_name => params[:version_name]}})
#3

Updated by Emilio González Montaña over 7 years ago

  • Target version deleted (Scrum v0.17.0)
#4

Updated by Emilio González Montaña over 7 years ago

  • Status changed from New to In progress
  • Target version set to Scrum v0.18.0
#5

Updated by Emilio González Montaña over 7 years ago

  • Category changed from Issues list & form to General

Plugin settings saving is also affected.

#6

Updated by Emilio González Montaña over 7 years ago

  • Blocked changed from No to Yes
  • Alone changed from No to Yes
#7

Updated by Emilio González Montaña over 7 years ago

  • Sprint set to Sprint 35

Angelinsky7 thanks for the patches.

#8

Updated by Emilio González Montaña over 7 years ago

  • Blocked changed from Yes to No
#9

Updated by Emilio González Montaña over 7 years ago

  • Alone changed from Yes to No
#10

Updated by Emilio González Montaña over 7 years ago

  • Status changed from In progress to Resolved
#11

Updated by Emilio González Montaña over 7 years ago

  • Subject changed from Scrum plugin doesn't work with redmine 3.4.1.0 to Scrum plugin doesn't work with redmine 3.4.x
#12

Updated by Emilio González Montaña over 7 years ago

  • Status changed from Resolved to In progress
#13

Updated by Emilio González Montaña over 7 years ago

  • Status changed from In progress to Resolved
#14

Updated by Emilio González Montaña over 7 years ago

  • Status changed from Resolved to In progress
#15

Updated by Emilio González Montaña over 7 years ago

  • Status changed from In progress to Resolved
#16

Updated by Jürgen Schreier about 7 years ago

Angelinsky7 Angelinsky7 escribió:

i don't know if this is the right answer but changing the file issue_query_patch.rb
from

[...]

to
[...]

seems to do the job... i dont know why it was working before the redmine new version because it seems that Hashes in ruby don't have the '<<' operator but....

Hello Angelinsky7,

I cannot see any difference in the 2 code blocks that you posted.
Since I do have the same error too I would really like to know what I need to change to make this work

Thanks in advance

Jürgen

PS: just to be clear: I was talking about the changes for the issue_query_patch.rb file.

#17

Updated by Jürgen Schreier about 7 years ago

After applying the patches from above most of scrum plugin seems to be working.
But I still get the following error 500 when requesting mypage:

Started GET "/my/page" for 212.18.30.153 at 2017-09-06 11:02:31 +0200
Processing by MyController#page as HTML
Current user: js (id=1)
Rendered my/blocks/_timelog.html.erb (2.1ms)
Rendered my/page.html.erb within layouts/base (35.7ms)
Completed 500 Internal Server Error in 72ms (ActiveRecord: 27.3ms)

ActionView::Template::Error (undefined method `<<' for {}:Hash
Did you mean? <):
10: <div id="my-page">
11: <% @groups.each do |group| >
12: <div id="list-<
= group >" class="block-receiver">
13: <
= render_blocks(@blocks[group], @user) >
14: </div>
15: <
end %>
16: </div>
plugins/scrum/lib/scrum/issue_query_patch.rb:40:in `issues_with_scrum'
app/helpers/my_helper.rb:101:in `render_issuesassignedtome_block'
app/helpers/my_helper.rb:64:in `render_block_content'
app/helpers/my_helper.rb:35:in `render_block'
app/helpers/my_helper.rb:27:in `block in render_blocks'
app/helpers/my_helper.rb:26:in `each'
app/helpers/my_helper.rb:26:in `render_blocks'
app/views/my/page.html.erb:13:in `block in app_views_my_page_html_erb_1176417024786038216_47278278691620'
app/views/my/page.html.erb:11:in `each'
app/views/my/page.html.erb:11:in `_app_views_my_page_html_erb__1176417024786038216_47278278691620'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

line 40(+-) in issue_query_patch.rb file contains this:

def issues_with_scrum(options = {})
options[:include] ||= {}
options[:include] << :sprint
issues_without_scrum(options)
end
alias_method_chain :issues, :scrum
def issue_ids_with_scrum(options = {})
options[:include] ||= {}
options[:include] << :sprint
issue_ids_without_scrum(options)
end
alias_method_chain :issue_ids, :scrum
#18

Updated by Angelinsky7 Angelinsky7 about 7 years ago

change with those :

def issues_with_scrum(options = {})
          options[:include] ||= []
          options[:include] << :sprint
          issues_without_scrum(options)
        end
        alias_method_chain :issues, :scrum

        def issue_ids_with_scrum(options = {})
          options[:include] ||= []
          options[:include] << :sprint
          issue_ids_without_scrum(options)
        end
        alias_method_chain :issue_ids, :scrum

#19

Updated by Jürgen Schreier about 7 years ago

@Angelinksky: Many thanks that did it. exchanging the {} to [] made it work.

Have a great weekend

Jürgen

#20

Updated by Luan Garrido about 7 years ago

I have changed the code like Angelinsky7 Angelinsky7 said, but I still cant update plugin settings.

Right now I cant add any sprint taks or Product Backlog task.

This is my projects_helper_patch.rb file

And that is my issue_query_patch.rb file

Im using redmine version 3.4.2

Which kind of information can I share to be helped?

Thanks =)

#21

Updated by Emilio González Montaña about 7 years ago

A new plugin version will be released in a few weeks, but if any of you want early access my Patreon web (for a 5$ tier) offers full access to all my Redmine plugins GIT repositories.

#22

Updated by Emilio González Montaña about 7 years ago

Released.

#23

Updated by Emilio González Montaña about 7 years ago

  • Has duplicate Defect #1393: Cannot save plugin settings added

Also available in: Atom PDF