The Bypass message show after redirect

Created on 15 December 2023, over 1 year ago
Updated 15 August 2024, 8 months ago

Problem/Motivation

The bypass message added in https://www.drupal.org/project/rabbit_hole/issues/3341902 ✨ Add message for admins to indicate what action would happen Fixed that is displayed when the 'Display a message when viewing the page' is being display after leaving the page.

Steps to reproduce

Add a rabbithole behavior to redirect a node to another page based on a URI value in a field. Check `Display a message when viewing the page`. Example below:

View a node which should redirect.

You will see the rabbit hole message displayed.

Click on the `admin/content` link in the URL.

You will see the rabbit hole message displayed.

Proposed resolution

The eventSubscriber triggers on onRequest and onResponse. The onReponse handler is causing the message to be displayed on the page viewed after you leave the node.

The message should only be displayed onRequest events.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States zipymonkey Durham, NH

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

Comments & Activities

  • Issue created by @zipymonkey
  • πŸ‡ΊπŸ‡ΈUnited States zipymonkey Durham, NH

    Added a patch that passes a boolean through to the BehaviorInvoker::getBehaviorPlugin() method so the message is only displayed `onResponse` and never `onRequest`.

    I am not sure that this the best way of handling it but it does appear to work when testing this locally.

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.4 + Environment: PHP 8.1 & MariaDB 10.3.22
    last update over 1 year ago
    24 pass
  • πŸ‡ΊπŸ‡ΈUnited States zipymonkey Durham, NH
  • πŸ‡¬πŸ‡§United Kingdom jacobupal Leeds

    I'm having this same issue, in addition to duplicates of the same message (presumably because it is somehow requested more than once, perhaps due to views or some such)... looking forward to testing this patch on alpha5

Production build 0.71.5 2024