You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user deletes different types of items, many orphaned data is left behind, forever.
This happens because years ago the codebase moved from a foreach delete() for each child to a delete_many() aproach, that is faster but doesn't delete child items.
One can only imagine the ammout of orphaned data out there! :)
Cases:
Delete Glossary: Doesn't delete Glossary entries!
Delete Translation Set: Doesn't delete its Glossary or entries!
Delete Project: Doesn't delete Project translations, Glossaries or entries!
Step-by-step reproduction instructions
Create a Project, import originals, add a Translation Set, Translations, a Glossary with some entries.
Delete a translation set that has translations.
Check the database, see the orphaned glossary and for the inexistent Translation Set.
Delete a glossary.
Check the database, see the orphaned glossary entries for the inexistent Glossary.
Make sure the project has all the above data again.
Delete the Project.
Check the database for orphaned translations, glossaries and glossary entries.
If you don't have an easy access to the DB data, you can use GP Toolbox to quickly test the orphaned data just created.
Expected behavior
On deleting an item, it's expected to delete any child items.
Examples:
Delete Project
Delete Originals
Delete Translation Sets
Delete Translations
Delete project Glossaries
Delete project Glossary Entries
Delete Translation Set
Delete Translations
Delete project Glossary
Delete project Glossary Entries
Delete project Glossary
Delete project Glossary Entries
Actual behavior
Delete Glossary: Doesn't delete Glossary entries!
Delete Translation Set: Doesn't delete its Glossary or entries!
Delete Project: Doesn't delete Project translations, Glossaries or entries!
Note
Might be usefull to add a wp-cli to quickly get and delete orphaned data for old and big GlotPress databases.
The text was updated successfully, but these errors were encountered:
Description
When a user deletes different types of items, many orphaned data is left behind, forever.
This happens because years ago the codebase moved from a foreach
delete()
for each child to adelete_many()
aproach, that is faster but doesn't delete child items.One can only imagine the ammout of orphaned data out there! :)
Cases:
Step-by-step reproduction instructions
If you don't have an easy access to the DB data, you can use GP Toolbox to quickly test the orphaned data just created.
Expected behavior
On deleting an item, it's expected to delete any child items.
Examples:
Actual behavior
Note
Might be usefull to add a
wp-cli
to quickly get and delete orphaned data for old and big GlotPress databases.The text was updated successfully, but these errors were encountered: