プロジェクト

全般

プロフィール

Vote #74571

完了

Accept custom field format added at runtime

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

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

0%

予定工数:
category_id:
14
version_id:
70
issue_org_id:
15277
author_id:
89258
assigned_to_id:
1
comments:
1
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

The CustomField model has a validation for the field_format attribute. This validation makes sure that the given field_format is part of the list of registered field formats.

There's a bug in the validation. The list the field format is checked against doesn't get updated when a new field format is added. This is probably because rails caches the list instead of accessing the reference and getting the updated version every time.

This becomes a problem for plugin developers. When a plugin registers a field format, all the custom fields using their formats will be invalid. Strangely enough, this doesn't seem to always happen. The same plugin running on the same version of redmine (2.3.3) on two different machines doesn't always have this bug. One version running on a mac in the development environment doesn't have this problem while another running on debian 7 in the production environment does have this problem.

This patch fixes the problem by wrapping the array of valid formats in a proc so that the updated version is used every time.


journals

Patch committed in r12248 with slight change, thanks.
--------------------------------------------------------------------------------

Admin Redmine さんが4年以上前に更新

  • カテゴリCustom fields_14 にセット
  • 対象バージョン2.4.0_70 にセット

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

いいね!0
いいね!0