The "Show label colon" in the field settings on my "Manage display" tab has no effect at all if I choose the default field template. As I'm using the basic theme (https://www.drupal.org/project/basic) the colon never shows up, no matter if checked or not. In the Bartik theme the colon always shows up, even if unchecked.

Am I missing something? In the other field templates (expert, minimal) it seems to work correctly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

der_wilko created an issue. See original summary.

DanielVeza’s picture

We had similar issues with the bootstrap theme. We fixed it like this

custom_theme.theme file

/**
 * Implements hook_preprocess_field.
 *
 * Bootstrap and Display Suite (DS) don't play together, so the display suite
 * settings are being lost since bootstrap overrides field.html.twig.
 * Unfortunately this means we lost our colons on default fields. So we are
 * going to override the template for field.html.twig and provide the ds
 * settings in the variables.
 *
 * @param $variables
 */
function hook_preprocess_field(&$variables) {
  // Add DS settings.
  if(isset($variables['ds-config']['settings'])) {
    $variables['settings'] = $variables['ds-config']['settings'];
  }
}

Add this line to field.html.twig. A line similar to this may already exist and you may need to modify it.

<div{{ title_attributes.addClass(title_classes) }}>{{ label }}{% if settings['lb-col'] %}:{% endif -%}</div>

If these instructions are too vague, give me a bell and I'll see if we can fix the problem outside of this issue queue.

I'm unsure if this is an issue that should be fixed at the DS level or the theme level.

swentel’s picture

Version: 8.x-3.1 » 5.0.x-dev
swentel’s picture

Status: Active » Needs review
FileSize
626 bytes

Yeah, there's isn't much we can do there. patch adds a warning that this setting might not have any effect at all.

  • swentel committed a5bfd94 on 5.0.x
    Issue #3007357 by swentel: Colon on default field template weird...
swentel’s picture

Status: Needs review » Fixed
swentel’s picture

Status: Fixed » Closed (fixed)
jonathan1055’s picture

Hi swentel,
Following up on your comment on #3208931-4: TestBot returns with "Build Successful" when there are too many test failures to report #4 and #6 I did a quick comparison of the logs on the D9 and D10 test runs. It seems that if you have no nightwatch.js tests, on D9 runs this was marked as a warning, but in D10 it gives an error.
log

To avoid this, you can modify the project's drupalci.yml file and in the assessment: testing: section delete the nightwatchjs: line. If you do not have a drupalci.yml file you can get the default from https://git.drupalcode.org/project/project_issue_file_test/blob/HEAD/job...

More info can be found on https://www.drupal.org/drupalorg/docs/drupal-ci/customizing-drupalci-tes...

Hope this helps.

swentel’s picture

Interesting, I wonder if this is the core issue which caused it: #3306446: Update Nightwatch to 2.4.1

jonathan1055’s picture

Thanks for the link. I am sure that's the cause, so I have added my comment to that issue.

swentel’s picture

Version: 5.0.x-dev » 8.x-3.x-dev
Status: Closed (fixed) » Active
jonathan1055’s picture

Hi swentel, was that an accidental update in #10 above? Or did you mean to re-open and revert the version from 5.0.x to 8.x-3.x?

  • swentel committed 861d0279 on 8.x-3.x
    Issue #3007357 by swentel: Colon on default field template weird...
swentel’s picture

Status: Active » Fixed

That was very much on purpose to commit this on 8.x-3.x as well.

swentel’s picture

Status: Fixed » Closed (fixed)
jonathan1055’s picture

Oh, yes I see. Sorry for the noise.