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

FIX: re-order operations when deleting replies #1256

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

johnhenley
Copy link
Collaborator

@johnhenley johnhenley commented Jan 28, 2025

Description of PR...

Deleting replies causing 'error deleting post'. Investigation uncovered this error which is referential integrity issue:
image

The activeforums_Reply_Delete stored procedure was deleting from activeforums_Replies before setting activeforums_ForumTpics.LastReplyId (which points to record being deleted). When deleting a reply that is LastReplyId, throws exception. Re-order operations to set LastReplyId first before deleting reply.

Changes made

  • Change order of operations to set LastReplyId in activeforums_ForumTopics before deleting reply from activeforums_Replies
  • Set lastreplyid to null not zero (zero not a valid value for foreign key)

How did you test these updates?

PR Template Checklist

  • Fixes Bug
  • Feature solution
  • Other
  • Requires documentation updates
  • I've updated the documentation already

Please mark which issue is solved

Close #1242

@johnhenley johnhenley added bug Something isn't working database Changes to database schema labels Jan 28, 2025
@johnhenley johnhenley added this to the 08.02.03 milestone Jan 28, 2025
@johnhenley johnhenley requested a review from WillStrohl January 28, 2025 19:47
@johnhenley johnhenley self-assigned this Jan 28, 2025
Copy link
Member

@WillStrohl WillStrohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@WillStrohl WillStrohl merged commit 9d37b96 into DNNCommunity:dev Feb 6, 2025
1 check passed
@johnhenley johnhenley deleted the issues/reply-deletes-1240 branch February 6, 2025 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working database Changes to database schema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Error deleting topic
2 participants