Module talk:Requested move
Missing error check
Hi, Mr. Stradivarius. In case you didn't notice, I redirected template:move-multi to {{requested move}}, so we are now fully live with your module. I've been busy updating redirects and documentation. I just noticed that while you check the currentn parameters and report
- Invalid title detected in parameter "current2"; check for invalid characters and incorrectly formatted interwiki prefixes
errors, you didn't do a similar check on the newn parameters, and the module doesn't handle them gracefully, e.g., John Green (author) → [[:John Gr>een]] in a test I did. I created Module:Requested move/sandbox to work on this, but thought that you could do it in a fraction of the time it would take me. One of these days I'll take some more time to study Lua. Thanks, Wbm1058 (talk) 19:37, 29 April 2014 (UTC)
- This wouldn't be hard to do, but there's a hidden penalty. At the moment, I'm checking for invalid titles by creating a title object with mw.title.new. That is an expensive function - every time it is called on a new page, the expensive parser function count is increased. And if the expensive function count for the whole page goes over 500 while the module is running, it will produce a script error. On a blank page, this would give us a limit of 250 pages (250 current + 250 new), and on a page that already contains lots of expensive parser functions, that number will be less. We can use pcall to avoid the script error, but the fallback behaviour would be to treat valid titles as if they were invalid, which is just as bad. This would only be a problem if someone made a move request involving hundreds of pages, though - are you aware of any such requests that have happened in the past?
An alternative would be to not use mw.title.new, but to just check for bad characters in the title. This wouldn't increase the expensive function count, but it also wouldn't catch invalid interwiki prefixes. It would, however, have the advantage that we could tell the user exactly what character was invalid, e.g. 'invalid character ">" found in the "new3" parameter'. We could also check the currentn parameters with this check, as it seems like it might be useful. Do you think this is a good idea, and if so, what wording would you like for the error message? — Mr. Stradivarius ♪ talk ♪ 04:50, 30 April 2014 (UTC)
- Recall that we had to hard-code each parameter in move-multi when it was a template, and thus the limit was 30 because that's where we stopped adding parameters. I've seen someone request about 90 moves by putting together three sets of 30-move requests, but don't want to encourage that type of request, which probably is better handled as a proposal to change a naming convention on some guideline's or WikiProject's talk page. I've noticed that the module seems to run a bit slower than the template did, but that trade-off seems worth it compared to the time it takes to manually fix mistakes, and this template isn't used that frequently. Yes, telling the editor which character is invalid seems helpful – 'invalid character ">" found in the "new3" parameter' works for me. I wouldn't worry about the interwiki prefixes as I've never seen anyone request moves for other wikis. Just checking for File: Category: Talk: etc. like we already do is probably enough. Thanks, Wbm1058 (talk) 05:26, 30 April 2014 (UTC)
Moving over a disambiguation page implies that a multi-move request should be submitted
This move request was submitted as a single move over a disambiguation page. With this edit I converted it to a multi-move request. Just wondering if it might be possible for this module to detect requests to move over disambiguation pages and automatically create a multi-move request that includes the implied move of the dab page, i.e. automatically convert to a multi-move request as I did manually. – Wbm1058 (talk) 02:29, 30 April 2014 (UTC)
- That's going to be hard to do. You can grab the page source, but the problem is that you have to then parse the source to find whether it has a disambiguation template in it. You would have to keep an up-to-date list of all disambig templates and their redirects, and you would probably have to keep tabs on the amount of string processing being done if many lengthy pages need to be parsed, so that we can keep execution time down to a reasonable amount. (If we go over 10 seconds in Lua on a given page, we get a script error.) And might there not be situations where you want to move a page over a disambiguation page, but not move the disambiguation page as well? — Mr. Stradivarius ♪ talk ♪ 05:03, 30 April 2014 (UTC)