#5763 - Periodic content: delete action causes critical error
| Identifier | #5763 |
|---|---|
| Issue type | Minor issue (breaks specific functionality) |
| Title | Periodic content: delete action causes critical error |
| Status | Completed |
| Tags |
Roadmap: v11 (custom) |
| Handling member | PDStig |
| Version | 11 alpha3 |
| Addon | content_reviews |
| Description | You cannot delete items in periodic content reviews because the code in content_reviews2.php is invalid.
This code was based on v10 where low/mid/high range content was explicitly defined in content meta aware hooks. That is no longer the case for v11, and the code is trying to do something invalid. |
| Steps to reproduce | Enable periodic content reviews on a piece of content (specifically a catalogue entry) and set the action to delete. View as a moderator and not as admin. |
| Additional information | This issue is too complex to resolve for me; it looks like we'd have to find privilege overrides by extracting functions from the modules. I could be wrong but I see no easy way to resolve this right now. |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
After doing some investigation and checking with AI to help diagnose the bug, I think I found a solution path. Instead of checking on the privilege (which we cannot do anymore), we should be using the CRUD permission module's "may_delete_this" function instead. I am modifying it to allow a null content ID for when we are adding a new piece of content to see if it could be later deleted by the member.
I am also adding a new function which, when given the name of a permission module, will try to find it (since some are CMS modules, others are Admin Zone ones, etc).
EDIT: Actually this might not work for cns_* modules. Investigating, most calls to make periodic content fields come from modules, so we could just put a parameter whether to include a delete option based on a direct call from the module's may_delete_this. Will need to work out chat and member settings though as these are not called directly from their modules.