πŸ‡ΊπŸ‡ΈUnited States @mettasoul

Account created on 20 March 2011, over 13 years ago
#

Recent comments

πŸ‡ΊπŸ‡ΈUnited States mettasoul

patch in #27 fixes issue for me

πŸ‡ΊπŸ‡ΈUnited States mettasoul

I ran into this problem and was able to solve it by adding the following line of code to the preprocessTitle procedure in /src/Plugin/DsField/Node/ExcludeNodeTitleManager.php

After line 265: $vars['label'][0]['#context']['value'] = '';
Added: $vars['label'][0]['#title']['#context']['value'] = '';

Hope this helps fix the issue

  /**
   * {@inheritdoc}
   */
  public function preprocessTitle(&$vars, $node, $view_mode) {
    if ($this->isTitleExcluded($node, $view_mode)) {
      $node_info = $this->getNodeInfo($node);
      $node_type = $node_info['node_type'];

      switch ($view_mode) {
        case 'nodeform':
          $node_types = $this->bundleInfo->getBundleInfo('node');
          if (!empty($vars['head_title'])) {
            $vars['head_title']['title'] = new TranslatableMarkup('Edit @nodetype', ['@nodetype' => $node_types[$node_type]['label']]);
          }
          elseif (!empty($vars['title'])) {
            $vars['title'] = new TranslatableMarkup('Edit @nodetype', ['@nodetype' => $node_types[$node_type]['label']]);
          }
          break;

        default:
          if (!empty($vars['title'])) {
            if ($this->isRenderHidden()) {
              $vars['title_attributes']['class'][] = 'hidden';
            }
            elseif ($this->isRenderRemove()) {
              $vars['title'] = new HtmlEscapedText('');
            }
          }
          if (!empty($vars['page']) && is_array($vars['page'])) {
            if ($this->isRenderHidden()) {
              $vars['page']['#attributes']['class'][] = 'hidden';
            }
            elseif ($this->isRenderRemove()) {
              $vars['page']['#title'] = new HtmlEscapedText('');
            }
          }
          if (!empty($vars['elements']) && is_array($vars['elements'])) {
            if ($this->isRenderHidden()) {
              $vars['elements']['#attributes']['class'][] = 'hidden';
            }
            elseif ($this->isRenderRemove()) {
              $vars['elements']['#title'] = new HtmlEscapedText('');
            }
          }
          if (!empty($vars['label']) && is_array($vars['elements'])) {
            if ($this->isRenderHidden()) {
              $vars['label']['#attributes']['class'][] = 'hidden';
            }
            elseif ($this->isRenderRemove()) {
              $vars['label']['#title'] = new HtmlEscapedText('');
              $vars['label']['#markup'] = new HtmlEscapedText('');
              $vars['label'][0]['#context']['value'] = '';
              $vars['label'][0]['#title']['#context']['value'] = '';
            }
          }
          break;

      }
    }

    return $this;
  }
Production build 0.69.0 2024