View Issue Details

IDProjectCategoryView StatusLast Update
0005312Composr alpha bug reports[All Projects] General / Uncategorisedpublic2023-02-21 00:30
ReporterPatrick SchmalstigAssigned ToPatrick Schmalstig 
SeverityMajor-bug 
Status resolvedResolutionfixed 
Summary0005312: Forums: Adding a new topic results in either 404 not found or POST parameter id having invalid integer
Descriptionditto ^
Additional InformationIt redirects to a URL with an undefined in it
TagsNo tags attached.
Sponsorship open

Activities

Patrick Schmalstig

2023-02-21 00:02

administrator   ~0007937

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).

Patrick Schmalstig

2023-02-21 00:07

administrator   ~0007938

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).

Chris Graham

2023-02-21 00:15

administrator   ~0007939

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.

Patrick Schmalstig

2023-02-21 00:25

administrator   ~0007940

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.

Chris Graham

2023-02-21 00:30

administrator   ~0007941

Your change is good.

Issue History

Date Modified Username Field Change
2023-02-20 22:29 Patrick Schmalstig New Issue
2023-02-20 22:29 Patrick Schmalstig Status non-assigned => assigned
2023-02-20 22:29 Patrick Schmalstig Assigned To => Patrick Schmalstig
2023-02-21 00:00 Patrick Schmalstig Status assigned => resolved
2023-02-21 00:00 Patrick Schmalstig Resolution open => fixed
2023-02-21 00:02 Patrick Schmalstig Note Added: 0007937
2023-02-21 00:07 Patrick Schmalstig Note Added: 0007938
2023-02-21 00:15 Chris Graham Note Added: 0007939
2023-02-21 00:25 Patrick Schmalstig Note Added: 0007940
2023-02-21 00:30 Chris Graham Note Added: 0007941
2023-02-26 18:29 Chris Graham Category General => General / Uncategorised