Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
text.js
adds the Show summary/Hide summary links even if the text area is disabled. This does not make sense. Either the text element has a summary already - in which case it should be shown - or it doesn't - in which case it should not be shown.
In #2381147: Text and text with summary field default value config does not use the text_format schema type we are adding disabled textareas with a summary field to the Configuration Translation UI where this surfaces.
Proposed resolution
Check for the disabled
and readonly
attributes before adding those links.
Remaining tasks
User interface changes
API changes
None.
Beta phase evaluation
Issue category | Bug because the current user interaction is non-sensical |
---|---|
Issue priority | Normal because this only appears in rare cases, e.g. when translating Text field default values (after #2381147: Text and text with summary field default value config does not use the text_format schema type) |
Unfrozen changes | Unfrozen because it only affects markup |
Prioritized changes | The main goal of this issue is usability. |
Disruption | Completely non-disruptive. |
Comment | File | Size | Author |
---|---|---|---|
#15 | 2383805-15.patch | 2.45 KB | harsha012 |
#9 | the_hide_summary_show-2383805-9.patch | 3.28 KB | dimaro |
#7 | After-applying-patch.jpg | 36.4 KB | Vidushi Mehta |
#7 | Before-applying-patch.jpg | 106.94 KB | Vidushi Mehta |
#6 | the_hide_summary_show-2383805-6.patch | 3.27 KB | Nitesh Sethia |
Comments
Comment #1
jhedstromI tried to reproduce this using the Article node type by:
The body field shows as disabled, but I don't see the Show summary link. Is this perhaps browser-specific?
Comment #2
tstoeckler@jhedstrom: That behavior is provided by
\Drupal\filter\Element\TextFormat::processFormat()
. That also sets the#access
property on thesummary
element to FALSE, so that it isn't rendered. Thus, the hide/show summary links are never shown. I think simply marking a textarea with a summary as disabled should be enough to disable the links.Comment #3
jhedstromThis patch checks for readonly/disabled state before adding the button. There is probably a more elegant way to do this. I used the issue mentioned above to test.
Comment #4
jhedstromAdding a screenshot.
Comment #5
jhedstromComment #6
Nitesh Sethia CreditAttribution: Nitesh Sethia as a volunteer commentedRerolled the patch and made some change in the JS.
Comment #7
Vidushi Mehta CreditAttribution: Vidushi Mehta commented@jhedstrom I have rectify the issue on my local setup but did not reproduce the issue.
Steps i have followed.
1. New D8 Installation.
2. Enable module - Language, Configuration Translation, Content Translation, Interface Translation.
3. Add language "catalan".
4. Edit Article content type.
url - admin/structure/types/manage/article/translate/ca/add , /admin/structure/types/manage/article/fields/node.article.body/translate/ca/add
here there are two url's, I have not found any default value disable body textfield as per your screenshot.
Let me know if i have missed any step to reproduce issue.
Comment #8
mgiffordPatch needs re-roll.
Comment #9
dimaro CreditAttribution: dimaro at La Drupalera by Emergya commentedRerolled #6.
Comment #14
joelpittetThe
js-
class prefixes shouldn't be replaced without reason in this patch, setting to needs work.Comment #15
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedRe-rolled the patch to 8.4 version.