Problem/Motivation

When an image field is added to a custom comment type, Save and Preview button float next to the image field, and the image help text spacing is a bit off.

Bartik (incorrect):

Seven (correct):

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#46 bartik-fix-description-margin-2624336.patch399 bytesnayanalok
#39 after_MR!14.png105.08 KBroberttabigue
#39 before_MR!14.png150.02 KBroberttabigue
#38 After.png21.08 KBanirudhsingh19
#38 Before.png22.48 KBanirudhsingh19
#33 image2.png228.42 KBroberttabigue
#33 image1.png205.3 KBroberttabigue
#32 Screenshot 2023-03-13 at 12.20.20 PM.png271.14 KBsantosh_verma
#32 issue.png48.82 KBsantosh_verma
#30 Clean-up-display-of-image-field-on-comment-form.jpg72.01 KBgaurav-mathur
#29 afterPatch-mob-26.png18.33 KBasha nair
#29 afterPatch-26.png21.63 KBasha nair
#27 after patch.png55.03 KBroshni_k
#27 before patch.png54.75 KBroshni_k
#26 2624336-After.png113.59 KBsahil.goyal
#26 2624336-Before.png116.12 KBsahil.goyal
#26 2624336-26.patch1.79 KBsahil.goyal
#26 reroll_diff_14-26.txt1.9 KBsahil.goyal
#26 2624336-26.patch1.79 KBsahil.goyal
#21 2624336--after--patch--pic.png32.05 KBvikashsoni
#21 2624336--before--patch--pic.png28.51 KBvikashsoni
#19 after_comment.png31.4 KBalexpott
#19 before_comment.png28.92 KBalexpott
#18 comment-before-patch.png26.06 KBMadhu kumar
#18 comment-after-patch.png23.09 KBMadhu kumar
#15 drupal-9.2_with_2624336-12.png5.22 KBtyler36
#15 drupal-9.2_incorrect.png5.24 KBtyler36
#15 drupal-9.1_with_2624336-12.png5.27 KBtyler36
#15 drupal-9.1_incorrect.png5.09 KBtyler36
#14 afterpatchcomment92x.png33.27 KBguilhermevp
#14 beforepatchcomment.png35.46 KBguilhermevp
#14 2624336-14.patch1.08 KBguilhermevp
#12 after-patch(rtl).png41.9 KBkomalk
#12 after-patch(ltr).png41.62 KBkomalk
#12 before-patch(rtl).png38.96 KBkomalk
#12 before-patch(ltr).png41.5 KBkomalk
#12 interdiff_11-12.txt678 byteskomalk
#12 2624336-12.patch1.08 KBkomalk
#11 2624336-11.patch705 byteskapilv
#8 2624336-8.patch679 bytessantosh_verma
#8 Alignment after patch.png83.39 KBsantosh_verma
#5 seven.png14.94 KBpameeela
#5 Screen Shot 2020-10-16 at 11.19.41 am.png24.55 KBpameeela
screenshot-drupal8 nightingale 2015-11-27 14-24-55.png27.37 KBifrik
screenshot-drupal8 nightingale 2015-11-27 14-21-24.png20.49 KBifrik

Issue fork bartik-2624336

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

ifrik created an issue. See original summary.

felribeiro’s picture

Some css rules of node and comment wrapper are intefering in this field.

core/themes/bartik/css/components/form.css

The float left in:
.comment-form label {
float: left; /* LTR */
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 0.929em;
width: 120px;
}

The margin-left in:
.comment-form .form-item .description {
font-size: 0.786em;
line-height: 1.2;
margin-left: 120px; /* LTR */
}

core/themes/bartik/css/components/field.css

The float left in:
@media all and (min-width: 560px) {
.node .field--type-image {
float: left; /* LTR */
margin: 0 1em 0 0; /* LTR */
}
[dir="rtl"] .node .field--type-image {
float: right;
margin: 0 0 0 1em;
}
.node .field--type-image + .field--type-image {
clear: both;
}
}

Version: 8.0.0 » 8.0.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

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

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Branches prior to 8.8.x are not supported, and Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should 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.

pameeela’s picture

Title: Comment form display with image floats fields next to each other » Clean up display of image field on comment form
Version: 8.9.x-dev » 9.1.x-dev
Issue summary: View changes
Issue tags: +Bug Smash Initiative
StatusFileSize
new24.55 KB
new14.94 KB

Updated issue summary with clearer screenshots.

pameeela’s picture

Issue tags: +Novice
komalk’s picture

Assigned: Unassigned » komalk
santosh_verma’s picture

StatusFileSize
new83.39 KB
new679 bytes

I have fixed it for the comment section and attaching the screenshot for reference.

komalk’s picture

Assigned: komalk » Unassigned
Status: Active » Needs review
pameeela’s picture

Status: Needs review » Needs work

Thanks for the patch!

+++ b/core/themes/bartik/css/components/form.css
@@ -280,7 +283,7 @@ input.form-submit:focus {
+  /*margin-left: 120px; /* LTR */

We don't want to comment out any CSS, if this style isn't needed then it should be removed. (I haven't tested manually to see if the style is needed in any other contexts.)

Also LTR means that there is a corresponding RTL style for this that also needs updating.

kapilv’s picture

Status: Needs work » Needs review
StatusFileSize
new705 bytes

Removed "/*margin-left: 120px; /* LTR */" css.

komalk’s picture

StatusFileSize
new1.08 KB
new678 bytes
new41.5 KB
new38.96 KB
new41.62 KB
new41.9 KB

Worked on #10.
#10 work fine with LTR style but not with RTL style also attached screenshot for the reference.

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.

guilhermevp’s picture

StatusFileSize
new1.08 KB
new35.46 KB
new33.27 KB

Re-rolled patch #12 in 9.2.x and applies cleanly and works as intended.

tyler36’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new5.09 KB
new5.27 KB
new5.24 KB
new5.22 KB

Confirmed. 2624336-12.patch fixes issues on both Drupal 9.1 & 9.2.

🛠️ Fix Drupal 9.1
- Add "image" field to comment type: '/admin/structure/comment/manage/comment/fields'
- Layout is "correct" in Seven (admin) theme
- Layout is "incorrect" in Bartik (frontend) theme
- Apply patch: `2624336-12.patch`
- Clear cache: `drush cr`
- Layout is correct (see screenshot drupal-9.1_with_2624336-12.png)

🛠️ Fix Drupal 9.2
- Add "image" field to comment type: '/admin/structure/comment/manage/comment/fields'
- Layout is "correct" in Seven (admin) theme
- Layout is "incorrect" in Bartik (frontend) theme
- Apply patch: `2624336-12.patch`
- Clear cache: `drush cr`
- Layout is correct (see screenshot drupal-9.2_with_2624336-12.png)

tyler36’s picture

@guilhermevp You didn't include an inter-diff and when I checked your patch (2624336-14.patch) it appears to be the same as 2624336-14.patch. Did you upload the right one?

guilhermevp’s picture

Sorry @tyler36, it is indeed exactly the same I forgot to NOT upload the patch and just describe that this patch works the same in 9.2.x version.

Madhu kumar’s picture

StatusFileSize
new23.09 KB
new26.06 KB

Patch #12 applied cleanly and it is working well. Below Screenshot for reference.

Before patch:

before-patch

After patch:

after

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new28.92 KB
new31.4 KB

This change affects other fields on the comment form - for example an email field with description text.

Before

After


I think the problem is that the image field in a comment should not be floated. I think actually all this CSS

@media all and (min-width: 560px) {
  .node .field--type-image {
    float: left; /* LTR */
    margin: 0 1em 0 0; /* LTR */
  }
  [dir="rtl"] .node .field--type-image {
    float: right;
    margin: 0 0 0 1em;
  }
  .node .field--type-image + .field--type-image {
    clear: both;
  }
}

can be removed. It only exists for comments and is not working. We'd need to check quickedit is not affected (a quick test shows this css is not part of that either). Note this CSS is not in play at all when editing a node with Bartik as the theme.

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.

vikashsoni’s picture

StatusFileSize
new28.51 KB
new32.05 KB

Applied patch #12 applied successfully and looks good for me
Thanks for the patch

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.

felribeiro’s picture

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.

sahil.goyal’s picture

StatusFileSize
new1.79 KB
new1.9 KB
new1.79 KB
new116.12 KB
new113.59 KB

Applying the patch for 9.4.x and 9.5.x and adding a reroll file for #14 and also considered the the suggestion of #19 and updated some css part for the label/description that is not aligned correctly with the available field. i've not added a reroll for 10.1.x as not sure because bartik theme is not there in version 10 and not having the available file, I have tested locally it working fine for me so please review.
Attaching the before and after screenshots for the reference.

roshni_k’s picture

StatusFileSize
new54.75 KB
new55.03 KB

Test patch #26 for 9.4.x version.Patch is applying successfully and it is working well.
check Screenshot for reference.

sahil.goyal’s picture

Status: Needs work » Needs review
asha nair’s picture

StatusFileSize
new21.63 KB
new18.33 KB

Applied patch in #26 successfully in 9.4.x. The patch places the button down and also fixes the issue mentioned in #19. Adding screenshots for reference.

gaurav-mathur’s picture

Already work fine without applying any patch.

smustgrave’s picture

Project: Drupal core » Bartik
Version: 10.1.x-dev » 1.0.2
Component: comment.module » Look and Feel

Thank you for working on this but tested on Drupal10.1 with a standard install, which uses olivero theme and I no longer see this issue. Moving to bartik theme.

santosh_verma’s picture

StatusFileSize
new48.82 KB
new271.14 KB

I have Tested the patch #26 on Bartik Theme on D.10, patch is not applying on this, Issue still exits on Bartik Theme

roberttabigue’s picture

StatusFileSize
new205.3 KB
new228.42 KB

Hi ifrik,

Applied patch #26 for the 9.5.5 version on Bartik Theme and the patch is applying successfully and working well.

See the attached screenshots for reference.

roberttabigue’s picture

Status: Needs review » Reviewed & tested by the community
liam morland’s picture

Version: 1.0.2 » 1.0.x-dev
Status: Reviewed & tested by the community » Needs work

Please put the patch into an issue fork and merge request.

anirudhsingh19’s picture

Assigned: Unassigned » anirudhsingh19

working on this.

anirudhsingh19’s picture

Assigned: anirudhsingh19 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new22.48 KB
new21.08 KB

Created a MR for the fix, can confirm that the changes work. Attaching the screenshots, Please review!

roberttabigue’s picture

StatusFileSize
new150.02 KB
new105.08 KB

Hi,

I have applied the latest MR !14 to the Bartik theme with 1.0.x-dev and confirmed MR is applied successfully and working as expected.

Please see the attached files for reference.

I'm moving this now to ‘RTBC’.

Thank you!

roberttabigue’s picture

Status: Needs review » Reviewed & tested by the community

liam morland’s picture

Version: 1.0.x-dev » 1.1.x-dev
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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

liam morland’s picture

nayanalok’s picture

StatusFileSize
new399 bytes

Here is the patch to remove description margin for contributed theme bartik version 1.1.x

liam morland’s picture

Is the patch in #46 a fix to the issue mentioned in #45? If so, please put the patch into a merge request on that issue.