プロジェクト

全般

プロフィール

Vote #75319

未完了

Error when you try to config issue checklist plugin with empty checkboxes

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Plugin API_20
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
20
version_id:
0
issue_org_id:
17217
author_id:
104501
assigned_to_id:
0
comments:
1
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
82
ステータス-->[New]

説明

Environment info:

Environment:
Redmine version 2.5.1.stable
Ruby version 2.0.0-p481 (2014-05-08) [x86_64-linux]
Rails version 3.2.17
Environment production
Database adapter Mysql2
Mysql version 5.5.37-0ubuntu0.14.04.1 (Ubuntu)
SCM:
Subversion 1.8.8
Git 1.9.1
Filesystem

Redmine plugins:
redmine_agile 1.3.1
redmine_ics_export 2.0.0.dev
redmine_issue_checklist 2.0.5
redmine_omniauth_google 0.0.1
redmine_timesheet_plugin 0.7.0

Bug description:

when you go to checklist plugin config page (/settings/plugin/redmine_issue_checklist) and you unselect all the checkboxes and save, an internal error is shown on the screen. The error log message is attached as error_redmine_issue_checklist.txt

The problem consisted of the serialization of an all false options hash into a database column. the all false options hash, serialized into "", was returned to @settings in SettingsController as a "" string insted of an empty hash {}.

It affects all plugins with more than one config option (options are serialized).

Bug solution:

in SettingsControler#plugin I added 2 lines of code that fixes the bug

def plugin
@plugin = Redmine::Plugin.find(params[:id])
unless @plugin.configurable?
render_404
return
end

if request.post?
  Setting.send "plugin_#{@plugin.id}=", params[:settings]
  flash[:notice] = l(:notice_successful_update)
  redirect_to plugin_settings_path(@plugin)
else
  @partial = @plugin.settings[:partial]
  @settings = Setting.send "plugin_#{@plugin.id}"
  settings_options = Setting.available_settings["plugin_#{@plugin.id}"] || {}
  @settings = {} if @settings == "" && settings_options["serialized"]
end

rescue Redmine::PluginNotFound
render_404
end

I attach the controller app/controllers/settings_controller.rb file.


journals

I attach the patch generated by git format-path
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリPlugin API_20 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0