Problem/Motivation

We wanted to add styling to specific types of fields. for instance all checkboxes. We noticed there was no class for this but there was a javascript class for this. Furthermore, the Classy template does provide this class and it seemed odd that this was not a standard class.

This issue should appear in any Drupal installation that uses a custom theme or any theme that does not override the form-element.html.twig template, for instance, the stark template.

Proposed resolution

The class 'form-type-' ~ type|clean_class, should be added to the template in the system module and possibly in the stable theme.
This could be done by adding 'form-type-' ~ type|clean_class, to the classes variable in the form-element.html.twig templates.

Remaining tasks

1. The patch is ready for review.
2. This patch will need to be reviewed.

Issue fork drupal-3051692

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Hikkypo created an issue. See original summary.

hikkypo’s picture

StatusFileSize
new1.15 KB

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

ramya balasubramanian’s picture

Assigned: Unassigned » ramya balasubramanian

Since the patch was already added, I have added a manual test to see the results.

ramya balasubramanian’s picture

Assigned: ramya balasubramanian » Unassigned
Status: Active » Needs review

Moving this to Needs review, since the manual test is passed.

Rkumar’s picture

Then it must be in all the core themes. As I can see changes are missing in claro. Please check it for all.

Rkumar’s picture

Status: Needs review » Needs work
ramya balasubramanian’s picture

ramya balasubramanian’s picture

Assigned: Unassigned » ramya balasubramanian

Hi @Rkumar,

I have checked your patch. And this class was added inside the form-element.html.twig. This class was already added in Umami, Bartik, seven, classy which contains form-element.html.twig file. But in claro theme, the file (form-element.html.twig and the folder (form) was not there. So I am not sure whether we need to add this in the claro theme as well since the file was not there. Please see the below Only local images are allowed.screenshots.

ramya balasubramanian’s picture

Assigned: ramya balasubramanian » Unassigned
StatusFileSize
new775.93 KB

Uploaded the screenshot again.

ramya balasubramanian’s picture

Status: Needs work » Needs review
StatusFileSize
new575 bytes

Hi @Rkumar,

Thanks. This class was missing in stable 9 themes. So I have updated the patch, please have a look.

ramya balasubramanian’s picture

StatusFileSize
new1.71 KB

Hi,
Please ignore the above patch. That patch is incorrect. Please have a look at this patch. Sorry for the inconvenience.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new167 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

rassoni’s picture

StatusFileSize
new1.14 KB
new1.6 KB

Re-roll against D10.

kpoornima’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new28.48 KB

Reviewed patch #20 getting "form-type". Please refer screen shot

catch’s picture

This looks like an oversight in the original classes, but tagging for front end framework manager review since I'm not sure how it sits with classy/stable deprecations etc.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

larowlan’s picture

The problem we might have here is that technically stable templates are supposed to be stable, i.e. have no changes.

ckrina’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Needs frontend framework manager review

We discussed this with @bnjmnm and we agree this extra class would be useful. But as @larowlan says this shouldn't be a change to Stable, only to the module itself. So moving to Needs work to remove this from the last patch.

kostyashupenko’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new581 bytes
new444 bytes
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed patch #26 is only applying to module. With such a small change wonder if it needs a change record?

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 26: 3051692-26.patch, failed testing. View results

kostyashupenko’s picture

Status: Needs work » Reviewed & tested by the community

Patch still applies cleanly
random test failure

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 26: 3051692-26.patch, failed testing. View results

mstrelan made their first commit to this issue’s fork.

mstrelan’s picture

Status: Needs work » Needs review

Checked starterkit_theme and it already has this class too. Created an MR, hiding patches.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Seems straight forward then.

  • nod_ committed faec1421 on 11.x
    Issue #3051692 by ramya balasubramanian, kostyashupenko, rassoni,...
nod_’s picture

Status: Reviewed & tested by the community » Fixed

Committed faec142 and pushed to 11.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.