Problem/Motivation
On Alert (Content Type) setting up Page visibility condition failed validation on the first line and doesn't continue to the next url for validation
Steps to reproduce
Create/Update an Alert (Content Type)
Test 1:
------
Set Page Visibility
/page1
/page1/*
Navigate to the page /page1 - Alert will not show.
Test 2:
------
Set Page Visibility
/page1/*
/page1
Navigate to the page /page1 - Alert will show on page1 page.
Proposed resolution
Validate all Page visibility url(s) to find the first valid (true) validation.
Don't break the loop when finding the first false
Break the loop on the first true validation (as you don't need to continue)
Comments
Comment #2
joshua1234511Issue fixed in https://github.com/civictheme/uikit/pull/346
Comment #3
richardgaunt commentedThe fix updates the parsing of the incorrect "plain text" from the API but the root cause of this issue is in the `plain_text` field formatter which adds the twig filter `nlbr` to its processing.
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...
The ideal fix will be to change the page visibility field to a multi-value plain text field so it provides an array of page visibility values and we can iterate over the values.
Due to this requiring a new field / update existing field and an upgrade path this will need to be considered.
For the meantime Josh's fix mitigates the issue
Comment #4
fionamorrison23 commentedComment #5
fionamorrison23 commentedComment #6
richardgaunt commentedSorry on further inspection I see that we are using a REST display of alert content types see: /admin/structure/views/view/civictheme_alerts
The `visibility` field needs to be updated to strip tags to remove the `
` tags.
Same underlying cause but we have ability to change field output.
Comment #7
richardgaunt commentedComment #8
fionamorrison23 commentedComment #9
richardgaunt commentedhttps://github.com/civictheme/uikit/pull/346
I have left a few questions, Josh
Comment #10
richardgaunt commentedComment #11
fionamorrison23 commentedComment #12
sonam.chaturvedi commentedVerified and tested on 1.8-dev
Testing Results:
When we set Page visibility condition on Alert content type then validation does not fail for any urls listed - PASS
Screenshot:

Comment #13
sonam.chaturvedi commentedComment #14
fionamorrison23 commentedComment #15
fionamorrison23 commentedComment #17
fionamorrison23 commented@richard noting this issue closed via automation. Kobus tells me this is not in the code base. I will need to check on other tickets that have automatically closed.Comment #18
fionamorrison23 commented