Missing webform block after WxT 4.4 to 5.2.2 upgrade

Created on 22 February 2024, 7 months ago
Updated 17 May 2024, 4 months ago

Problem/Motivation

The Did you find what you were looking for block won't appear on any pages after upgrading to Drupal 10 and WxT 5.

Current prod environment: Drupal 9.4.x and WxT 4.4.x.

Upgrading to Drupal 10.1.8 and WxT 5.1.1. (currently running on our dev environment).

Under 9.4.x/4.4.x, I disabled the old Report a Problem block from all pages and placed the WxT block Did You Find What You Were Looking For appearing on selected pages (using Visibility > Pages > Show for the listed pages... in the block configuration).

After upgrading to WxT 5.x, that block does not appear on any of the pages it's supposed to. It's in the Block structure where it's supposed to be and configured to appear on the pages I want.

I can remove it from the block structure and place it back into our footer region, and change the configuration to remove the visibility restrictions but it doesn't appear on the rendered page.

Disabling, re-enabling, rearranging the order, placing it in other regions, Save blocks, clear cache: none of these makes any difference.

I can create a custom block and place it and it works. I can add another WxT block like the Twitter widget and it appears.

The old Report a Problem block is also showing the same behaviour - won't appear on the page no matter what. Somehow related?

Has anyone else noticed this? Is there a fix, or something I'm doing wrong? Is this just something about our specific build?

Steps to reproduce

  • Place block "Report a problem" (Category WxT Webform).
  • Select Webform: GCWeb - Report a problem - and save.
  • Place block "Did You Find What You Were Looking For" (Category WxT Webform).
  • Select Webform: GCWeb - Did you find what you were looking for (gcweb_did_you_find) and save.
  • You can Save blocks and/or clear caches if you like.
  • The Report a problem block doesn't appear on any pages.
  • The Did you find block doesn't appear on any pages.

Proposed resolution

See latest patch

Remaining tasks

Review latest patch

User interface changes

Restore missing blocks

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Needs work

Version

5.2

Component

WxT Bootstrap

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Young.g
  • 🇨🇦Canada joseph.olstad

    Thanks for reporting @Young.g

    I have confirmed that this is a bug in WxT 5.1.x

    I have tested a vanilla install of WxT 5.1.x with Drupal 10.1.8 and after installing all the wxt modules and running all of the wxt migrations for gcweb and blocks that this block is listed in the manage blocks however it does NOT show up on the page.

  • Assigned to joseph.olstad
  • 🇨🇦Canada joseph.olstad

    investigating

  • 🇨🇦Canada joseph.olstad

    very strange, I've found a way to get the "Did you find" webform to show up but trying to get a better understanding of this.

    It seems to be that the 'report a problem' block configuration is related to the 'Did you find what' ability to show up

  • 🇨🇦Canada joseph.olstad

    weird,
    On wxt vanilla 5.1.x using a the combination of block layout configuration for Report a problem and Did you find what you are looking for, the "Did you find" block will show up on the page.

    Both Report a problem and Did you find have to be enabled and oddly enough to reliably see "Did you find" block their visibility settings had to be Unrestricted for both blocks and then a cache rebuild.

    I repeated this in another non vanilla 5.1.x environment and no combination that I have tried will result in displaying the "Did you find" block.

    continuing investigation.

  • Status changed to Postponed 7 months ago
  • 🇨🇦Canada joseph.olstad

    Going to mark this as postponed for now, I was able to get the "Did you find what you were looking for" to load in a WxT 5.1.x vanilla

    With that said, it seemed a bit tricky to do.

    However in another environment that uses a subtheme based on wxt_bootstrap, nothing I did was able to make it work.

    I did try adding a new webform block and used a cloned version of the "Did you find" form, this loaded half the form and then the next cache rebuild it was gone.

  • Status changed to Active 7 months ago
  • 🇨🇦Canada joseph.olstad

    Suspecting that this is a D10 regression.

    There's a possible fix here:

  • 🇨🇦Canada joseph.olstad

    This fix is needed asap.

  • Status changed to Needs review 7 months ago
  • 🇨🇦Canada joseph.olstad

    See patch, this fix works in my environment.

    Fixes an ajax 404 error trying to load css.

    see the related issue for full explanation
    🐛 D10 Compatibility AddCssCommand() - AJAX error for css route of webform assets RTBC

  • Issue was unassigned.
  • 🇨🇦Canada joseph.olstad

    in addition to this patch which appears to fix something broken between D9 and D10 relating to webform 6.2.x , had to also re-implement Did you find what you were looking for. In order to have it render on the page and regain control of a version of "Did you find what you were looking for" and maintain the yes button I created a new custom module for a specific build based off of wxt_ext_webform and had to also add some of the Preprocess Block code from wxt_bootstrap into our custom subtheme.

    I cloned the webform gcweb_did_you_find into custom_gcweb_did_you_find massaged the plugins /preprocess and machine references to gcweb_did_you_find to change to custom_gcweb_did_you_find , created a new block in a similar fashion

    I then modified the wxt_ext_webform plugin to detach the operation of the two blocks report a problem and did you find what you were looking for

    the new block has a different id

    with this new setup it's working.

    Something still a bit weird about the built in WxT Library form, the report problem webform is related to the gcweb find webform , tied in by the logic in wxt_ext_webform.module

    anyhow, sorted it out with new code based on the wxt stuff and also theme Preprocess Block.php

    something weird about the theme suggestion though, wasn't able to get that to kick in, the twig didn't seem to do anything so I used a single line declaration of css to display none on the h2 double title that doesn't actually show up when using wxt vanilla.

  • 🇨🇦Canada joseph.olstad

    new patch, minor nit change.

  • Assigned to joseph.olstad
  • Status changed to Active 7 months ago
  • 🇨🇦Canada sylus

    So I took a look at this and if you did a fresh install of WxT 5.2.1 all of these blocks show up correctly without needing any patch.

    If I had to make a guess I wonder if your block name is different and with the block handling logic in preprocess something is behaving a bit wonky.

    I'm pretty sure your problem lies somewhere in this block preprocess code and to me one of your block names must be different then what it expects.

    I bet if you compare against a fresh install of 5.2.1 where this works out of the box you might be able to spot the difference.


    // Determine which webform to display in footer.
    $block_exists_1 = $this->checkBlockExistence('didyoufindwhatyouwerelookingfor');
    $block_exists_2 = $this->checkBlockExistence('reportproblemblock');

    if ($block_exists_1 && $block_exists_2) {
    $did_you_find_webform = $this->activateDidYouFindWebform();
    $variables['display'] = TRUE;

    if ($did_you_find_webform) {
    if ($variables['plugin_id'] == 'share_widget_block') {
    $variables['attributes']['class'] = [
    'col-sm-3',
    'col-sm-offset-2',
    'col-lg-offset-3',
    ];
    }

    if ($variables['plugin_id'] == 'report_problem_block') {
    $variables['display'] = FALSE;
    $variables['content'] = [];
    }
    }
    else {
    if ($variables['plugin_id'] == 'find_what_you_looking_for') {
    $variables['display'] = FALSE;
    $variables['content'] = [];
    }
    }
    }

  • Status changed to Postponed: needs info 7 months ago
  • 🇨🇦Canada joseph.olstad

    Suggest testing with a subtheme.

  • 🇨🇦Canada joseph.olstad

    Just hit this in a different build. The report a problem block vanished.

  • Status changed to Needs review 4 months ago
  • Issue was unassigned.
  • 🇨🇦Canada joseph.olstad

    This regression slipped in in october 2023 with commit bd23160547

  • Status changed to Needs work 4 months ago
  • 🇨🇦Canada smulvih2 Canada 🍁

    @joseph.olstad the issue is with block caching, and the removal from the template file from your patch does fix the issue with the Did you find block, but this needs to be fixed globally for the two feedback form blocks. There are changes in the Block Preprocess file in wxt_bootstrap that needs to be reviewed as well. The change/ticket you reference toggles the two webform blocks, I think we should remove the old webform block (Report a Problem) from the block layout and just keep the Did you find webform block.

  • 🇨🇦Canada joseph.olstad

    lol, on one of my projects they're using the did you find
    on another they're using the report a problem

Production build 0.71.5 2024