Patch #43276
closedReplace the use of form.text_area with form.textarea
Files
Updated by Go MAEDA 15 days ago
- File fix-plugin-text_area-labels.patch fix-plugin-text_area-labels.patch added
- Status changed from Closed to Reopened
After r24030, some plugins no longer show labels for textarea fields when calling f.text_area with a label: option.
The root cause of this is rails/rails#52467, as described in #43268. In Rails 8, text_area was renamed to textarea in field_helpers, so LabelledFormBuilder no longer wraps text_area.
To keep existing plugins working without requiring each plugin to replace text_area with textarea, Redmine should patch lib/redmine/views/labelled_form_builder.rb to include text_area in the helper list.
The code that explicitly made text_area a target of LabelledFormBuilder was added in r24020, but it was removed in r24030 when all f.text_area usages in Redmine core were replaced with f.textarea. As a result, plugins that still use f.text_area lost label support. The attached patch restores the code removed in r24030.
Updated by Marius BĂLTEANU 14 days ago
Go MAEDA wrote in #note-3:
To keep existing plugins working without requiring each plugin to replace
text_areawithtextarea, Redmine should patchlib/redmine/views/labelled_form_builder.rbto includetext_areain the helper list.The code that explicitly made
text_areaa target of LabelledFormBuilder was added in r24020, but it was removed in r24030 when allf.text_areausages in Redmine core were replaced withf.textarea. As a result, plugins that still usef.text_arealost label support. The attached patch restores the code removed in r24030.
This change will ship in a major version where some breaking changes are expected, and sooner or later, plugin developers must update their code to use textarea to remain compatible with core form builders. If preferred, we can deprecate the text_area method in 7.0 and fully remove it in 7.1 to ease the transition, even though the required code change is very minor.
Updated by Go MAEDA 14 days ago
Marius BĂLTEANU wrote in #note-4:
This change will ship in a major version where some breaking changes are expected, and sooner or later, plugin developers must update their code to use
textareato remain compatible with core form builders. If preferred, we can deprecate thetext_areamethod in 7.0 and fully remove it in 7.1 to ease the transition, even though the required code change is very minor.
In Rails 8.0, text_area was renamed to textarea. However, text_area is still available as an alias and has not been deprecated. Therefore, I do not think third-party plugins need to migrate from text_area to textarea immediately.
Given this, it may be reasonable for Redmine's LabelledFormBuilder to continue supporting text_area at least until it is deprecated in Rails. Since Rails itself still provides text_area for compatibility, I think Redmine could also keep supporting it for the time being.
Updated by Marius BĂLTEANU 12 days ago
- Status changed from Reopened to Closed
Thanks Go MAEDA, I've completely missed the alias. I've committed the change.