Render block entities, not plugins unless all plugin settings can be configured

Created on 4 May 2023, over 1 year ago
Updated 6 September 2023, over 1 year ago

Problem/Motivation

I can't figure out a way to select a certain webform to embed into the Ouibounte Exit Intent Modal.

You can select blocks and you can also select the "Webform" *entity type*, but you can't select single webforms.
I think this needs to be checked and implemented correctly.

Also creating a hidden webform block doesn't help, it's not shown.

Steps to reproduce

  1. Create a webform
  2. Try seleting it in the ouibounce block configuration but don't find a way

Proposed resolution

Find a way to allow selecting webforms as content

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Needs work

Version

4.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Comments & Activities

  • Issue created by @Anybody
  • 🇩🇪Germany Anybody Porta Westfalica

    Just had a look into the "Place block" UI in core which works similar and saw that they're filtering out some other blocks, which we should also do, I guess. I'll add that as MR.

    But the key point is, that the "Webform" entry also exists there and the webform entity is selected in the block configuration on the next page. So we're missing that step entirely.

  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    Waiting for branch to pass
  • @anybody opened merge request.
  • Assigned to Anybody
  • Status changed to Needs work over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Okay so finally my result is, that the current options don't make sense as long as you're not able to fully configure all configuration values of the block plugin.

    That would mean we would have to implement the whole block plugin settings (form and save) logic from blocks to be able to provide all required settings. That will be a bunch of work!

    Until that's possible, we should change the selection to

    • Block entities (allows to select all block entities existing in the default theme - so they can be configured there, visible or in a hidden region)
    • Views (can be kept as-is)

    Would be super cool to be able to fully configure block plugins within this module, but that will be a lot more work than the whole module currently has.

    As the current plugin logic can only work for very simple blocks, we should replace it like I implemented (and tested) in the MR.

    At least when implementing 📌 Write tests Active we would have found out that the current logic only works for simple cases, not even for webforms or other blocks with required settings.

    We'll need to create a separate version for this, as a breaking change can't be prevented sadly. An update hook should inform the (currently 13) users about the required manual change.

  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    Waiting for branch to pass
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica
  • Assigned to Anybody
  • Status changed to Needs work over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Back to NW, I forgot to implement the update hook to inform about the BC!
    Like in 📌 Change ouibounce library structure to allow npm-asset / bower-asset installation Fixed

  • 🇩🇪Germany Anybody Porta Westfalica

    Text for the update hook:

    Ouibounce Exit Modal block selection logic breaking-changed (BC) in 4.x! Downgrade to 3.x for now and read the issue for details or reconfigure your Ouibounce Exit Modal block settings. Custom HTML and views are not affected! See https://www.drupal.org/project/ouibounce_exit_modal/issues/3358189 🐛 Render block entities, not plugins unless all plugin settings can be configured Needs work
    No database changes were made from 3.x to 4.x so you can up-/downgrade without fear, but reconfigure the Ouibounce block settings.

  • First commit to issue fork.
  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.2 & MySQL 8
    last update over 1 year ago
    Waiting for branch to pass
  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.2 & MySQL 8
    last update over 1 year ago
    Waiting for branch to pass
  • Status changed to Needs review over 1 year ago
  • 🇩🇪Germany Grevil

    Rebased on 4.x and added the update hook. The rest of the code looks fine! Please review the update hook, if it functions as desired!

  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.2 & MySQL 8
    last update over 1 year ago
    Waiting for branch to pass
    • Anybody committed 0d5cd28d on 4.x
      Issue #3358189 by Anybody, Grevil: Render block entities, not plugins...
  • Issue was unassigned.
  • Status changed to RTBC over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Perfect, thx :)

    Merging and tagging!

  • Status changed to Fixed over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Status changed to Fixed over 1 year ago
  • 🇭🇺Hungary lonalore Budapest, Hungary

    Due to the changes made in this issue, Block plugins do not appear in version 4.0.0-rc1. All block plugins created under "[MODULE]/src/Plugin/Block" disappeared from the list. Please do not remove an existing function from the module. It can be added, but don't remove.

  • Status changed to Needs work over 1 year ago
  • 🇭🇺Hungary lonalore Budapest, Hungary
  • Status changed to Fixed over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    @lonalore thanks, but that change was needed to make a fix. So we created a new major release (4.x) which allows breaking changes. Please use 3.x for now, if you need the old behavior. But I think it will be better to migrate over.

    We added an update hook to inform users, who didn't read the release notes.
    https://git.drupalcode.org/project/ouibounce_exit_modal/-/commit/0d5cd28...

    Please feel free to implement an update hook or suggest improvements to the update hook or release notes. This won't be reverted.

  • 🇩🇪Germany Anybody Porta Westfalica

    @lonalore PS: Sorry I didn't see / recocgnize, you're the original maintainer. My appologies.
    I hope you see the reasons for the BC in 4.x and why we created the new major version.

    So of course we can for example keep the 3.x as alternative recommended branch, for example. But for the future of this module the reasons for the changes in 4.x outlined above should be weighted higher from my perspective.

    Looking at https://www.drupal.org/project/usage/ouibounce_exit_modal the Drupal 8+ usage is quite low, so I think it's still the right time to do this.

  • 🇭🇺Hungary lonalore Budapest, Hungary

    I don't think it's a fix if we throw out an existing function. The update note doesn't mention that block plugin support has been dropped from the module.

  • Status changed to Needs work over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Thanks @lonalore, so you'd suggest just re-adding the block plugin functionality plus keeping the new functionality?
    I wonder if that wouldn't be very confusing for users. How should that be displayed in the UI? As separate group in the select?

    Another option would be to fork the module, instead of creating 4.x with that functionality or using a hook and submodules to split it. The analysis can be found in #4 why we decided to make that change.

    Any suggestions for the update hook text change then?

  • 🇭🇺Hungary lonalore Budapest, Hungary

    Yes, block plugins could be managed in a separate group in the select list. If the function is returned to the module, there is no need to change the update message. Thank you!

  • 🇭🇺Hungary lonalore Budapest, Hungary
  • 🇩🇪Germany Anybody Porta Westfalica

    @lonalore still on my list, but very busy currently, sorry.

Production build 0.71.5 2024