30 Dec, 2024
The problem is that when a user likes a poem, the age restriction set by the author when adding the poem is removed.
Here are the technical details: there is an "update" event that triggers when an author edits a poem. During this event, the system deletes the old age restrictions and adds new ones if they were changed. However, there's an issue: the ratings for poems are stored in the same table as the poems. When a user likes or dislikes a poem, the rating field is updated (+1 or -1). The system treats this as an "update" and triggers the event. As a result, the age restrictions for the poem are removed, even though they were not changed.