Closed gullyn closed 2 years ago
@primefac I think that's happening because I'm using the afchPage.getCreator
function, which just returns the user who created the page (not the one who submitted it). I could potentially use a regex to parse the pageText to find the |u= parameter, since I don't think there is a function to do that right now.
90% of the time, the page creator will likely be the one who submitted the draft, but I've seen cases where (for example) a promo username violator created the page, got blocked, and then created a valid new account; the "creator's account" is blocked but the submitting editor isn't.
In other words, if it's possible, try to use the editor that submitted the draft over the page creator.
@siddharthvp I've implemented the suggestions you've made. I tested it on https://test.wikipedia.org/wiki/Draft:AFCH_Issue_106 and it works fine.
Okay, I've removed the $.Deferred
. I'm not an expert on promises, as I usually use async/await. I tested it to make sure and it does still work.
I've made those changes. The Date
object is really annoying and doesn't have a format function like most other languages, so I've made it format like this:
Looks good to me now, thanks!
^ my bad, accidentally merged this with a typo in the commit message
This issue was raised in 2019 and was worked on, but no pull request was made. I've adapted @paul-111's code, updating the API request and fixing the formatting. This is what the warning looks like: