As designed Inline mod options show actions that won't have any effect

W1zzard

Well-known member
Affected version
2.0.0
For example, "undelete post" is displayed on a post that's not deleted. Same for "approve post"

Just need to pass a closure to canApplyToEntity() that checks entity status?
 
This is the same behavior through XF1 and I don't recall any particular problems with it off hand.

However, if you take the approach you suggest, then there are situations where you would prevent a perfectly valid action. For example, if you only allowed locking a thread that was unlocked, selecting an already locked thread (plus an unlocked one) would hide the lock option as it's not available for one of the items (which prevents you from taking the action at all). Conversely, if you consider the intent of "I want to lock all selected threads", it doesn't matter that they are locked as the result is the same. Thus, the current behavior is really as expected.

The only case I could potentially see a change is if you (for example) selected only locked threads, but that is a definite edge case IMO and it potentially creates more confusion over options being hidden unexpectedly (which right now, only happens if you have varied permissions).
 
Back
Top Bottom