View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
5312 | Composr alpha bug reports | General / Uncategorised | public | 2023-02-20 22:29 | 2023-02-21 00:30 |
Reporter | PDStig | Assigned To | PDStig | ||
Priority | normal | Severity | major | ||
Status | resolved | Resolution | fixed | ||
Summary | 5312: Forums: Adding a new topic results in either 404 not found or POST parameter id having invalid integer | ||||
Description | ditto ^ | ||||
Additional Information | It redirects to a URL with an undefined in it | ||||
Tags | No tags attached. | ||||
Attach Tags | |||||
Sponsorship open | |||||
|
Issue was cns_forum.js was not properly re-writing the action attribute on the form due to recent changes made as recommended by esLint (now that we are doing strict type comparisons, the undefined variable which was being compared to null was failing an if condition). |
|
Additional note: This was a hard bug to spot as there were no JS calls on posting-form directly. I was able to locate the source by using the JavaScript mutationObserver on the form to monitor for changes to its attributes. And in the callback, I called console.error to produce a stack trace so I can locate what exactly was modifying the action attribute (and how). |
|
Whoops. I shouldn't have actually done that change, as ESLint didn't require it, I was just flooded in little issues and it looked like one of those issues. We actually are allowing type week checks against null in our JS codebase, presumably for this kind of issue. |
|
No worries. I simply just initialized the variable to null instead of undefined to fix the issue and keep type strict comparison in place. I can revert that and remove the type strict check if you wish. |
|
Your change is good. |
Date Modified | Username | Field | Change |
---|---|---|---|
2023-02-20 22:29 | PDStig | New Issue | |
2023-02-20 22:29 | PDStig | Status | Not Assigned => Assigned |
2023-02-20 22:29 | PDStig | Assigned To | => user4172 |
2023-02-21 00:00 | PDStig | Status | Assigned => Resolved |
2023-02-21 00:00 | PDStig | Resolution | open => fixed |
2023-02-21 00:02 | PDStig | Note Added: 0007937 | |
2023-02-21 00:07 | PDStig | Note Added: 0007938 | |
2023-02-21 00:15 | Chris Graham | Note Added: 0007939 | |
2023-02-21 00:25 | PDStig | Note Added: 0007940 | |
2023-02-21 00:30 | Chris Graham | Note Added: 0007941 | |
2023-02-26 18:29 | Chris Graham | Category | General => General / Uncategorised |