alexwais / redmine_workflow_hidden_fields

http://www.redmine.org/plugins/redmine_workflow_hidden_fields
GNU General Public License v2.0
37 stars 27 forks source link

Plugin is broken in 2.6 #5

Closed spuck closed 9 years ago

spuck commented 9 years ago

Just upgraded my Redmine from 2.5.2 to 2.6.0, and ran into errors with the changes in the PDF handling library in Redmine.

Here's what I've changed in lib/pdf.rb:

@@ -17,11 +17,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

-require 'tcpdf'
-require 'fpdf/chinese'
-require 'fpdf/japanese'
-require 'fpdf/korean'

 if RUBY_VERSION < '1.9'
   require 'iconv'
 end
@@ -33,7 +28,7 @@
       include ActionView::Helpers::NumberHelper
       include IssuesHelper

-      class ITCPDF < TCPDF
+      class ITCPDF < RBPDF
         include Redmine::I18n
         attr_accessor :footer_date

Not sure if this fixes everything, but the migration works without error, and the workflow settings seem to be OK for now...

m18905908096 commented 9 years ago

IS VERY GREAT PLUGIN ,BUT I CAN NOT WORK IN 2.6 TOO

JDStar commented 9 years ago

Hi. Me too not working in 2.6. Install with patch @spuck without errors. In Administration -> Workflow permission in lists option "hidden" is vivisble but after saving not remember choosen option. image

In logs: Started GET "/redmine/issues/45" for 159.255.xxx.xxx at 2015-01-16 22:23:22 +0100 Processing by IssuesController#show as HTML Parameters: {"id"=>"45"} Current user: admin (id=1) Rendered issues/_action_menu.html.erb (3.6ms) Rendered plugins/redmine_workflow_hidden_fields/app/views/issues/show.html.erb within layouts/base (159.7ms) Completed 500 Internal Server Error in 234.3ms

SimonK99 commented 9 years ago

@JDStar I think i fixed the Error.

Here's what I've changed in lib\redmine_workflow_hidden_fields\workflows_helper_patch.rb:

Line 14:
- def field_permission_tag_with_hidden(permissions, status, field, role)
+ def field_permission_tag_with_hidden(permissions, status, field, roles)

Line 20 (After Line 20-28)
-selected = permissions[status.id][name]
+if perm = permissions[status.id][name]
+              if perm.uniq.size > 1 || perm.size < @roles.size * @trackers.size
+           options << [l(:label_no_change_option), "no_change"]
+           selected = 'no_change'
+              else
+           selected = perm.first
+          end
+       end

Line 29/37:
- select_tag("permissions[#{name}][#{status.id}]", options_for_select(options, selected),     html_options)
+ select_tag("permissions[#{status.id}][#{name}]", options_for_select(options, selected), html_options)
JDStar commented 9 years ago

Thanks! With this patch working OK.

alexwais commented 9 years ago

thanks, should be fixed in v0.1.3