-
-
Notifications
You must be signed in to change notification settings - Fork 540
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
Ghost Taxonomies / Deleted Taxonomy not always deleting associations from entry #11264
Comments
The I know it might be a silly question but are you able to confirm you have a queue driver running in production? |
Yes I am. It's an existing site and as I said in the ticket, once I changed the name, it recreated the taxonomy files and then I could delete them permanently because the queue jobs ran. The fact the site was stuck in limbo that they couldn't be deleted is the issue and Statamic should be architected in a way that's not possible. |
Thanks - I just wanted to confirm. I've seen some people change their queue driver but forget to configure queue workers.
We haven't reviewed it yet, but have you seen #11058? I believe it fixes an issue where changing a term's slug creates duplicates and causes the I don't know if it's exactly what you're seeing here, but maybe it'll help? |
@duncanmcclean Sounds like it might be related. We've been seeing the behavior mentioned by @jonathan-bird as well, where a deleted term would be reawakened from the dead by saving from the cp. Any hints on what's blocking the review of #11058? The fix seems pretty straightforward, but as always, without knowing the internals, it's a cheap shot from the sidelines :) In any case, it fixes an issue where the term reference udpate job wouldn't be triggered due to the term class not picking up changes after initialization. |
I don't think there's any reason other than the fact other PRs have been reviewed instead. |
Bug description
We have been reporting issues whereby they delete a bunch of taxonomy terms from the admin panel UI, and they might temporarily be removed, and the actual taxonomy files within
content/taxonomies/event_category/
are removed, but after a while (a day or two they claim), the taxonomies start showing in the admin panel UI again and the front-end. It doesn't seem to be removing the code from the entries themselves. I'll share some screenshots below.Event Category taxonomy shows a bunch of taxonomies that were deleted:
You can see they don't exist in the folder:
They still exist in the entries:
I try removing them from taxonomy list again but it doesn't make any difference. I've even tried recreating the taxonomies in the admin panel and deleting but still stays referenced in the entries (and therefore still shows on the front-end and just shows back up in the admin panel after a while.
But as soon as I clear the stache (php please stache:clear) it just shows up again.
From reading Statamic issues in Github it seemed to be an old issue but was solved 2020-2022.
I've got this marked as true too just like out of the box: https://github.com/statamic/cms/blob/v3.3.30/config/system.php#L142-L153
It seems to be the same as this issue: #1349
I can't understand why this is occurring. Can you please help?
How to reproduce
Digging in further, it seems that usually there's a "UpdateTermReferences" job that runs when a taxonomy is deleted which is to update all of the entries. However for whatever reason this site was stuck in a state where the taxonomy was deleted, this didn't run/failed and therefore it never run this job again. As you know with queue jobs, failed will retry and then just get removed so it's not ideal for things of this importance imo.
Since stache:clear shows these deleted taxonomies because they're linked to entries, and clicking delete of a taxonomy that didn't exist did not run this job, Statamic was stuck in a state where it was impossible to delete it.
What I had to do as a workaround was rename the taxonomy that appeared (even though the file didn't exist), which created the taxonomy file, and then deleted it which re-triggered the job and deleted everything successfully since it removed it from the associated entries.
This required me as a developer to intervene which isn't a good experience for my client. I'd still consider this a bug (albeit difficult to replicate as it requires that job failing/not running) since and I'd like to see it possible for Statamic to fix states like this so it should re-create the taxonomy file when it realises there's still entries associated, so that when you click delete it will actually work again and the job will fire.
I believe there should be 1 of 2 things to sort this:
Logs
No response
Environment
The text was updated successfully, but these errors were encountered: