Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 297443

Add a tiny bit of state magic in the image.module and hide the Title and Alt groups when the related form items are disabled

$
0
0

Problem/Motivation

It's confusing to be able to check that, for example, image title is translatable, but when editing or creating content, the title field does not show. This is because there is a field setting to enable title, which is not checked by default.


Proposed resolution

When showing the field form. For each translatable element in a field inspect the field instance to find the enable/disable checkbox counterpart, then unset disabled elements for the translation part. This is done by using the field name or field name + _field (this will give some extra flexibility and will not be limited to image fields). The result will be that unset elements won't be part of the Translatable elements.

If an element that was enabled is disabled in the field configuration form then the checkbox that allows it's translation will dissapear from the screen (and appear back if re-enabled). A copy notice will appear to advert users some options may not be available in the Translatable elements due to disabled elements.

Remaining tasks

  • Usability review

Steps to Reproduce

  1. a clean d8 (git pull --rebase)
  2. install (drush si is nice)
  3. enable content translation
  4. add a language
  5. configure translation and language settings at admin/config/regional/content-language
  6. check "content" and "article" and save
  7. create content of type article, add an image.
  8. translate that content, notice when adding or editing the translation, there is no title field, even though when we enabled translation, title was checked.

User interface changes

No API changes will happen.

API changes

TBD

Original report by YesCT

#1807692-120: Introduce a column synchronization capability and use it to translate alt and titles through the image field widget 3. @YesCT

I was confused because even though I tried unchecking and check translatable for title on image, it did not show in edit or add translation form. Then I remembered I might have to configure image itself to make title field show. yep....

#121 @plach

Yes, this is image-specific: we could have a novice follow-up to add a tiny bit of state magic in the image.module and hide the Title and Alt groups when the related form items are disabled.

Viewing all articles
Browse latest Browse all 297443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>