Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim’s picture

Hmm, unrelated, but should all those tab headings say Show and Hide?

Dave Reid’s picture

Personally I think that using commas to separate these summary values is wrong as the 'Publishing options' tab begins to get un-scannable. Here's a solution that I've worked on to use line breaks after each value.

There is also a problem that the 'Publishing options' tab also includes the description of any checkboxes in the summary.

Dave Reid’s picture

Issue tags: +Needs usability review
droplet’s picture

another issue: font should not small than 12px.

joachim’s picture

It does make the summary more readable... but on the other hand, doesn't that make the vertical tabs rather too tall and remove part of their original design intent to be compact?

joachim’s picture

Version: 7.x-dev » 8.x-dev
Status: Active » Needs review
FileSize
626 bytes

Ha. Tracked it down! The problem is that field labels are made like this:

'!title !required'

So if there is no required on a field, it gets a stray space at the end.

I think the correct fix is to remove that space, rather than have the vertical tabs JS jump through hoops in every form that uses them to trim the values!

Dave Reid's suggestion in #2 really belongs in a feature request; and the inclusion of checkbox description is another bug for another day. The patch here fixes the original stated problem :)

joachim’s picture

Issue tags: -Needs usability review

Tagging for backport, removing need to UX review as that's for the improvement suggestion.

xjm’s picture

Patch looks good to me. There's not really any reason to test for whether or not we have a stray space somewhere. Can we get before/after screenshots with the patch though?

joachim’s picture

For the before screenshot, see the original post.
For the after screenshot, imagine that but without the spaces marked with big red circles ;)

xjm’s picture

Note that this is a string change, technically, but there is no translatable text in the string, so there's no translations to break. Sorry @joachim. :) So this can be backported.

xjm’s picture

Issue tags: +Needs backport to D7

Using the official tag.

joachim’s picture

Status: Needs review » Needs work

Urgh. Patch no longer fixes the problem O_o

joachim’s picture

The problem is now happening somewhere in the JS -- I've got it as far as drupalGetSummary but there my JS skills run out :(

joachim’s picture

Status: Needs work » Needs review
FileSize
1.48 KB

Ok the problem with the earlier patch is that the logic was flawed -- I was putting in the space at the front !required even when $required was empty.

That doesn't fully fix the problem though, and the culprit is this:

    case 'after':
      $output .= ' ' . $prefix . $element['#children'] . $suffix;
      $output .= ' ' . theme('form_element_label', $variables) . "\n";
      break;

I presume the final \n is there for readability of HTML source.
Now I'm not sure anyone actually bothers reading HTML source any more -- I certainly haven't since Firebug came along. But I'm not sure that's a call we should be making in this issue. Also, removing just one trailing newline in a switch() where the other cases have them makes the code look weird.

But here's that change as a patch for discussion. Another approach to follow.

joachim’s picture

Here's the other way of doing it: just have the JS trim() any text that goes into fieldset summary that has come from a title string.

Not as elegant, but no ideological changes involved :)

xjm’s picture

tim.plunkett’s picture

FileSize
1.11 KB

I opened #1542700: Content type fieldset summaries contain extra spaces, but was pointed here by xjm.

Here's a patch that mimics the similar core/modules/node/node.js directly

tim.plunkett’s picture

So mine is missing the comment module hunk, but now we can debate using $.trim(foo) vs foo.trim().

xjm’s picture

So my thought is, since we are trimming these values for the statuses for the vertical tabs on three different lines, plus the existing one in node.js... can we refactor this so we have a single function or method to handle assembling these lists of statuses and setting them to the appropriate tab? Maybe even separate methods to append, remove, update, whichever; the idea though is to refactor what is obviously repeated code so that other modules don't make the same mistake.

tim.plunkett’s picture

Title: node type form vertical tabs summary has stray spaces » Vertical tabs summaries have stray spaces
droplet’s picture

@joachim,

do you mind close this issue and reopen #1623574: Remove trailing space from form element labels and field labels (HTML nbsp) ? That's remove all space everywhere.

joachim’s picture

Status: Needs review » Closed (duplicate)

Yup, agreed -- that has the wider scope and the patch to cover it.

(Though I can't believe it's taken this long for other people to notice / be bugged by those spaces! ;)

joachim’s picture

Version: 8.0.x-dev » 8.2.x-dev
Component: node.module » ajax system
Issue summary: View changes
Status: Closed (duplicate) » Active
FileSize
48.05 KB

Reopening this. It was marked as a duplicate of #1623574: Remove trailing space from form element labels and field labels (HTML nbsp), but that was committed back in 2014, and I am still seeing this problem on D8.

xjm’s picture

Component: ajax system » node system

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

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

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

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.

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.

jhodgdon’s picture

Issue summary: View changes

Save issue summary as Filtered HTML because I think that prevented editing by some people. Not sure how that happened!

quietone’s picture

Version: 9.2.x-dev » 7.x-dev
Issue tags: +Bug Smash Initiative
FileSize
31.59 KB

@joachim, thanks for the report.

I tested on 9.2.x and the cannot reproduce the problem, see attached screenshot. It does still exist on D7 so changing version.