#4930 - sources/notifications2.php trying to access NTYPE on a Tempcode object
| Identifier | #4930 |
|---|---|
| Issue type | Minor issue (breaks specific functionality) |
| Title | sources/notifications2.php trying to access NTYPE on a Tempcode object |
| Status | Completed |
| Handling member | Chris Graham |
| Addon | General / Uncategorised |
| Description | Line 180 in notifications2.php is "$ntype = $notification_type['NTYPE'];", which comes from a for loop on $notification_code['NOTIFICATION_TYPES'].
However, $notification_code['NOTIFICATION_TYPES'] is set to $notification_types_tempcode on line 158 when it should be set to $notification_types. This fix does, however, break the template, so we also need to add "'NOTIFICATION_TYPES_TEMPCODE' => $notification_types_tempcode," after line 158. Then, modify NOTIFICATIONS_MANAGE.tpl to use {NOTIFICATION_TYPES_TEMPCODE} instead of {NOTIFICATION_TYPES} . |
| Steps to reproduce | |
| 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
The code had in hackerish way accessed the array structure used for the Tempcode tree (during setting saving).
The correct fix was to clean up the code to not need to do that, having a proper data structure for what settings are active on the UI.