Problem/Motivation

The current page specific visibility toggle currently operates opposite to its function. This is to say that if you select "all pages except the listed" the widget will be rendered on all pages listed in the text area. Similarly, if you choose only listed pages (text area) it will render on all pages except those listed in the text area.

Example Scenario

Based on the screenshot below, let's take into consideration this widget visibility being contrary to the visibility settings.

  • All to every page except for listed: About, Help & Contact Us display SiteEngage
  • Only the listed pages: About, Help, & Contact Us do not display SiteEngage widget

screenshot of the visibility form elements

Proposed resolution

Current code is:

$page_match = (($page_match or $visibility) && !($page_match and $visibility));

Modify the $page_match conditional statement to correctly determine:

  1. Matched path & on listed pages only
  2. No matched path & all except the listed pages

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Comments

laughnan created an issue. See original summary.

laughnan’s picture

Issue summary: View changes
laughnan’s picture

Issue summary: View changes
laughnan’s picture

StatusFileSize
new1018 bytes

Adding initial patch. Conditionals make my head spin so eyes on this would be great.

laughnan’s picture

Status: Active » Needs review
laughnan’s picture

I did test this on 8.x-2.0-alpha1 (which is head for 2.x-dev as well) and it looks like @arnested did something in commit 4c54fe99be97d518aa5cbe36ecfe4a1a3bf26be7, but I don't think this worked.

The conditional patch that I supplied seems to have fixed it, but conditionals make my head hurt so any feedback is welcome.

laughnan’s picture

StatusFileSize
new1016 bytes

Adding a new patch that replaces the and with && for consistency.

  • arnested committed 8004f4f on 8.x-2.x authored by laughnan
    Issue #2908382 by laughnan: SnapEngage page visibility configuration...
arnested’s picture

Status: Needs review » Fixed

Sorry for the long delay and thank you for your patch!

I have added it and made a new release 8.x-2.0-alpha2.

Status: Fixed » Closed (fixed)

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

JQTNguyen’s picture

We are currently using the aforementioned 8.x-2.0-alpha2 release where this should have been fixed, and as far as we can tell, this is still an issue (i.e.: in order to get the module working, we selected "Add to the listed pages only.", but left the text area blank).

The logic is still backwards, but it works consistently. Maybe the "fix" here can be just to switch the order that the text labels appear? I've created a patch for 8.x-2.0-alpha2 that does just this.