Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Items added to settings_errors transient are not displayed on settings update #4314

Closed
4 tasks
Mai-Saad opened this issue Sep 1, 2021 · 2 comments · Fixed by #4502
Closed
4 tasks

Items added to settings_errors transient are not displayed on settings update #4314

Mai-Saad opened this issue Sep 1, 2021 · 2 comments · Fixed by #4502
Assignees
Labels
Module: dashboard priority: low Issues that can wait severity: minor Defect that does not affect functionality type: bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@Mai-Saad
Copy link
Contributor

Mai-Saad commented Sep 1, 2021

Before submitting an issue please check that you’ve completed the following steps:

  • Made sure you’re on the latest version => 3.9.2
  • Used the search feature to ensure that the bug hasn’t been reported before =>yes

Describe the bug
A clear and concise description of what the bug is.
When using an invalid regex, it is removed from UI without displaying a notice

To Reproduce
Steps to reproduce the behavior:

  1. Go to Advanced rules
  2. Add gtag( in Always Purge URLs
  3. Save
  4. gtag( removed and no notice is displayed

Expected behavior
A clear and concise description of what you expected to happen.
Notice is displayed

Additional context
Add any other context about the problem here.
As per change here #4195 (comment) , the notice shall be The following pattern has been escaped to prevent errors:

Backlog Grooming (for WP Media dev team use only)

  • Reproduce the problem
  • Identify the root cause
  • Scope a solution
  • Estimate the effort
@Mai-Saad Mai-Saad added type: bug Indicates an unexpected problem or unintended behavior Module: dashboard priority: low Issues that can wait severity: minor Defect that does not affect functionality labels Sep 1, 2021
@iCaspar iCaspar added this to the 3.10.4 milestone Nov 12, 2021
@iCaspar iCaspar self-assigned this Nov 12, 2021
@iCaspar
Copy link
Contributor

iCaspar commented Nov 12, 2021

This issue is blocking
#4472
#4327
#4013

@iCaspar iCaspar changed the title Notice shall be displayed when escaping invalid regex pattern Items added to settings_errors transient are not displayed on settings update Nov 12, 2021
@iCaspar
Copy link
Contributor

iCaspar commented Nov 12, 2021

Grooming Notes:

Reproduced: ✔️

Root cause: ✔️
Adding settings_errors to the transient does not persist them across the page load because other calls to the settings API get_settings_errors() deletes the transient before we have a chance in our settings to get the contents.

Solution scope: ✔️
Instead of setting the transient, we can use WP's add_settings_error() to store the errors/notices.

Estimated effort:
[XS]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: dashboard priority: low Issues that can wait severity: minor Defect that does not affect functionality type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants