Problem

We've had issues with blocks showing or not showing on wrong pages before. A new issue is that having a piece of content with a path whose last section is `/add` will cause multiple hero blocks to show up.

Solution

Change the way we determine what blocks are displayed. Rely on the displayed entity and operation instead of paths. Additionally use this moment to consolidate duplicate blocks (e.g. the various variations of page-titles that we have) and use template suggestions if needed.

Comments

Kingdutch created an issue. See original summary.

sv’s picture

Hi there, looks like i've discovered related issue, PR with fixes is here: https://github.com/goalgorilla/open_social/pull/1915

ribel’s picture

Status: Active » Reviewed & tested by the community

PR was merged and will be included in release 8.5

ribel’s picture

Status: Reviewed & tested by the community » Closed (works as designed)

We reverted PR above in this one: https://github.com/goalgorilla/open_social/pull/1960, because it caused regression.
To fix issue with missing hero for custom content types the same approach as in Social Book module might be used in config override:

    // Set hero title block for discussion content type.
    $config_names = [
      'block.block.socialbase_pagetitleblock',
      'block.block.socialblue_pagetitleblock',
    ];
    foreach ($config_names as $config_name) {
      if (in_array($config_name, $names)) {
        $config = \Drupal::service('config.factory')->getEditable($config_name);
        $bundles = $config->get('visibility.node_type.bundles');
        $bundles['discussion'] = 'discussion';
        $overrides[$config_name] = ['visibility' => ['node_type' => ['bundles' => $bundles]]];
      }
    }
bas123’s picture

Well, despite saying that the issue has been resolved, I just tested this in version 8x.9 and 10.2.0 using the title:

"edit, Add, and Delete still cause duplicate headers and Hero's!"

and it still persists

I do not know why this issue has been closed!

bas123’s picture

The issue of duplicate Hero Blocks being triggered by having 'add', 'edit', and 'delete' in the title still persists in social-11.3.2

Why has this been marked: Closed (works as designed)?

ronaldtebrake’s picture

Status: Closed (works as designed) » Active

Re-opening, not sure why it is marked as works as designed. The PR mentioned was reverted, not fixed.

ressinel’s picture

I have created a PR that should fix this issue: https://github.com/goalgorilla/open_social/pull/2968

ressinel’s picture

Status: Active » Needs review
ressinel’s picture

Status: Needs review » Needs work
ressinel’s picture

Status: Needs work » Needs review
ressinel’s picture

Version: 8.x-9.x-dev » 11.1.x-dev
navneet0693’s picture

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

Status: Reviewed & tested by the community » Fixed

This will be available in 11.4.0-beta2 onwards.

navneet0693’s picture

Version: 11.1.x-dev » 11.4.x-dev
bas123’s picture

Cudos!

And for the indoctrinated, what did it take to fix this long standing issue, if I may ask?

My users would often use the word "Edit" or "Editor" in titles (as one example) and were often baffled by the results thinking they had done something wrong!

  • navneet0693 committed 6683f9a on 11.4.x
    Merge pull request #2968 from goalgorilla/issue/3144794-fix-load-page-...

Status: Fixed » Closed (fixed)

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