Skip to content

Forum postoptions bug#5423

Open
rica-carv wants to merge 7 commits intoe107inc:masterfrom
rica-carv:forum_postoptions-bug
Open

Forum postoptions bug#5423
rica-carv wants to merge 7 commits intoe107inc:masterfrom
rica-carv:forum_postoptions-bug

Conversation

@rica-carv
Copy link
Contributor

@rica-carv rica-carv commented Jan 31, 2025

Motivation and Context

Prevent duplicated delete buttons when in moderator mode

Description

Added moderator check

How Has This Been Tested?

E107 latest github

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist

@Jimmi08
Copy link
Contributor

Jimmi08 commented Mar 19, 2025

@rica-carv
Where is related issue to this PR? I mean - there is template for any bug. Any PR should have issue or discussion at first. PR without explanation shoudln't be accepted.

Yes, you are fixing problem for you, but others can have other opinion. PR should be created only if there is approved approach to solve issue like this.

Your PR is related to this:

image

If I got it right, you are hidding delete button if user is moderator. This is not correct for me.

User should always had option to delete post if:

  • it is its own post,
  • if it is the last in the thread
  • if post is not the initial post of the topic)

Moderator should see delete button, if:

  • it is not their own post (there is user button already) -
  • rules: only show delete button when post is not the initial post of the topic and not user

Do you see what I mean? It is opposite approach then yours, this should be discussed and only after final solution PR should be created.

To complicate things:

  • what if rules for deleting are different for user and moderators (or will be in future)? And moderator wants to delete post as user (with user rules only)? Then both buttons are needed.

So, yes, this is something what should be solved, but not by direct PR, by discussing and making rules. For example, I don't know why only last post can be deleted by moderator.

This is example of next approach (changed label "mod" - to let know you are deleting post as moderator):
image

Just my 2 cents.

@rica-carv
Copy link
Contributor Author

Moderator should see delete button, if:

* it is not their own post (there is user button already)  -

Moderator already can see the user buttons, so why had duplicated buttons that do the same thing? To add confusion?

I know that the forum plugin needs a major rework, but it's scheduled to do, but....

@Jimmi08
Copy link
Contributor

Jimmi08 commented Mar 19, 2025

Moderator should see delete button, if:

* it is not their own post (there is user button already)  -

Moderator already can see the user buttons, so why had duplicated buttons that do the same thing? To add confusion?

I know that the forum plugin needs a major rework, but it's scheduled to do, but....

You prefer delete button in moderator's section, I prefer delete button in user section and hide it for moderator . The same thing but different approach.

@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit b8a0177 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

The test coverage on the diff in this pull request is 100.0% (80% is the threshold).

This pull request will bring the total coverage in the repository to 48.9% (0.0% change).

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants