The shortcut_set_delete() function has code which is intended to prevent the sitewide default shortcut set from ever being deleted - however, I just realized this doesn't quite work correctly. Instead of checking the sitewide default, it actually checks the default for the current logged-in user, which might be different and which we do not actually want to prevent from being deleted (plus, checking things for the current logged-in user does not make sense in an API function).
One could also argue that an API function should not be preventing this deletion at all... however, unless you have another module installed which interacts with the shortcuts in a very particular way, deleting the sitewide default is pretty much guaranteed to break things. So for now, this patch leaves that feature in place.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | shortcut-delete-default-set.patch | 790 bytes | David_Rothstein |
Comments
Comment #1
David_Rothstein commentedPatch.
Comment #2
jhodgdonThis will not fix the problem, because there is a hook in the shortcuts module that lets other modules select defaults for particular users. This will not prevent deleting those defaults.
I will fix this so it makes sense and works along with #647084: Missing shortcut edit and delete operations on shortcuts admin. It's needed in order to have the UI work...
Comment #3
David_Rothstein commentedWhy should deleting the default for a particular user be forbidden? (The sitewide default is a fallback and needs to be there for that reason, but I don't see why it's a problem to delete any others.)
Anyway, let's see what you come up with for the other issue.
Comment #4
jhodgdonI take it back: Your patch is fine. But I had to do some stuff with permissions on the other issue, because we were exposing a delete set link, so I put I think the same line in there.
Comment #5
jhodgdonThis was fixed on that other issue.