DiscipleTools / DiscipleTools/disciple-tools-theme

Custom List Icon Bad URL causes site to logout after 5 seconds

Open
#2,512 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
PHP
Stars
48
Forks
66
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
If the URL for a custom list item icon points to a resource that doesn't exist within the DT server, the response will come back as a 302 error. That for some reason clears the logged in cookie, so the later API calls, in my case the `get_new_notifications_count` call will fail and the user will be logged out. This will happen on every page that the icon with the faulty URL appears.

**To Reproduce**
Steps to reproduce the behavior:
1. Create a custom list icon but point it to a URL that doesn't exist. In my case I was on a multisite instance so it was pointing to `/wp-content/images/` instead of `wp-content/themes/disciple-tools-theme-master/dt-assets/images/`
2. Load the page with that item on the front end. In the Dev tools Network tab you will see the get_new_notifications_count eventually fail and the user will be sent to the login screen.
3. Trying to remove the item from the wp-admin seems to fail as well and I am asked to login every time I try to save the item with a new URL or delete it.

The only way I could fix this to go into the DB into the options table and edit the value for `dt_field_customizations` to change the URL.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.