[12:09:37] Hey everyone. I'm developing an extension and I'm using the resource loader to load my stylesheets and script files. Now that I've developed on multiple branches for a while, I can see that the resource loader loads my stylesheet multiple times: Once in its current version and once in an old version or a version that may come from a different branch of my project. How can I purge the cache of the resource loader to remove that [14:18:42] Hey everyone. I'm developing an extension and I'm using the resource loader to load my stylesheets and script files. Now that I've developed on multiple branches for a while, I can see that the resource loader loads my stylesheet multiple times: Once in its current version and once in an old version or a version that may come from a different branch of my project. How can I purge the cache of the resource loader to remove that [14:56:56] Hey everyone. I'm developing an extension and I'm using the resource loader to load my stylesheets and script files. Now that I've developed on multiple branches for a while, I can see that the resource loader loads my stylesheet multiple times: Once in its current version and once in an old version or a version that may come from a different branch of my project. How can I purge the cache of the resource loader to remove that [15:00:50] It may be worth noting, that the old version of the stylesheet comes with the response of the resource loader call to a different extension (ext.bootstrap) than my own...but the question remains the same, I guess. [15:02:04] how can I try to reproduce this? [15:02:58] I don't think it's a cache problem [15:03:13] are you using the debug mode and see single files loaded? [15:04:10] I'm using the debug mode but the issue occurs in both modes [15:04:51] but do you see old version being loaded from a different URL or something? [15:05:20] To be honest, I don't know how to exactly reproduce this. I've just developed my extension and used multiple branches and at some point I noticed that my style directives didn't apply. Debugging the situation I recognized this issue [15:05:38] the old version is loaded with the call to load ext.bootstrap [15:05:39] well, try to reproduce that from the clean [15:05:47] the call to ext.mooc (my extension) looks fine [15:06:00] I am almost certain something got forgotten somewhere [15:06:21] so trying to rebuild from scratch may help to identify the issue [15:06:39] even by diffing directories if nothing else [15:06:56] it might be composer, whatever [15:08:20] Thanks for this hint, I'll try to check this on file level [16:00:02] @saper Would you assist me to debug the issue with the old stylesheet in the resource loader response? [16:02:17] I've searched for a unique identifier, used in my stylesheet, inside the mediawiki folder but outside the directory of my extension. The result revealed the file 'serialized/commonpasswords.cdb' but I guess this isn't what I have to look for. [16:07:54] A search on the whole vagrant directory also reveals files in the srv/docroot but these are up-to-date and can't cause the issue. [16:09:43] So, if it it isn't findable on the file system, it's either encoded as a non-string or it's somewhere in a database, am I right? [18:10:35] Hi [18:11:07] I'm sure this is a coding error - https://en.wikisource.org/wiki/User:ShakespeareFan00/Sandbox/Short-titles [18:11:44] that I've made... [18:12:23] but I've got no way of determining precisely what's getting crunched or not [18:13:24] Special:ExpandTemplates doesn't expand the tag so I am not able to see one of the intermediate stages which would nail down conclusively where I should be placing certain characters [18:14:36] What I think has gone wrong is that ugh. is there a table somewhere showing how number of uploads compare between wikis? [19:52:24] Like https://stats.wikimedia.org/EN/TablesDatabaseImageLinks.htm but up to date [19:54:00] bawolff: Yvette could probably whip something up [19:54:28] Its not important enough to actually make someone do work for it, I'm just hoping something already exists [19:59:36] bawolff can whip it up on his own if he really cares. ;-) [19:59:45] Yvette: indeed [20:14:17] And indeed, i made https://tools.wmflabs.org/bawolff/imagestats.txt [20:18:30] Hi all, does anybody knows an OAuth system for mediaWiki? I don't need a OAuth Server, my wiki should use an existing non-mediaWiki-OAuthServer to manage the user. So I need to customize the OAuth urls and data-fields for user_id, email etc. (No idea how to do that with Extension:OAuth or OAuthAuthentication, i think they are just for wiki-wiki connection) [20:27:01] E:OAuth is for when you want to use oauth to authorize applications to edit your wiki [20:27:37] OAuthAuthentication is meant for wiki-wiki login delegation [20:27:58] although it may be possible to get it to work with non-mediawiki oauth servers [20:31:01] bawolff: ygg [20:31:05] re: stats. [20:32:36] @bawolff so there is no existing extension for that and i must change OAuthAuthentication to realize that? [20:33:00] Well, i don't actually know what you want to do, so that's tough to answer [20:40:06] okay, i have an existing system for our users called hiorg-server. they have an oauth2 api. now i want to use the hiorg-server as sso-server so that my users can user their login-data of hiorg-server to login into mediawiki [20:41:32] OAuthAuthentication uses OAuth 1 not 2 [20:41:39] so it probably won't work [20:43:58] I don't think anyone has written any extensions for oAuth2 to do SSO, so you'd probably have to write one yourself [20:44:15] Most enterprisey people who have single sign on solutions, usually end up using LDAP [21:04:22] Ugh, what's a good hook if I want to output an HTTP header? [21:04:31] or i guess i could just do it on all requests. [21:05:04] bawolff: Depends whether you have a Varnish or equivalent in front? [21:05:30] oh yeah, I guess i could add it there [21:05:46] I think most of Wikimedia's custom headers come from there. [21:05:52] Though surely one or two come from MediaWiki... [21:06:37] Backend-Timing ? [21:13:00] Nope. [21:15:42] https://github.com/wikimedia/puppet/blob/e959321aa620b77403cc9379db2e86080323c6e8/modules/apache/files/defaults.conf [21:47:01] I'm setting up mediawiki 1.28 on an ubuntu vm. I've exported Template:Infobox from wikipedia, included all templates/modules, and and trying to import. what's weird is that every page imports, but with the wrong content. Module:Infobox has Module:Hatnote content. I've done a direct export and import, no changes, I have scibunto installed and working, etc. [21:47:06] anyone know what the heck could be wrong? [21:48:36] this is on a brand new install too, so the import is the first thing done after install and login [21:50:07] vive: what MediaWiki version are you using? [21:50:22] 1.28 [21:51:43] 1.28.0, ubuntu 16.04, php7, latest scribunto [21:55:53] vive: I was unable to reproduce the issue. Can you check, the history of Module:Infobox on your wiki, and see if the page already existed before you imported it? [21:57:02] import inserts revisions ordering by the timestamp of each revision. If the page exists and latest revision is more recent than the revision being imported, the imported revisions won't be the current versions of the page [21:58:31] the page didn't exist already, the history shows the last edit from wikipedia and then my import [21:58:47] I tried a second time after blasting the db and re-installing [21:58:59] same issue, it's odd. [22:00:03] did you use Special:Import? [22:00:41] yes [22:03:48] same here and no problem [22:04:19] so if Module:Infobox has the contents of Module:Hatnote, what content has Module:Hatnote? [22:05:14] I have three extensions, ParserFunctions, SpamBlacklist, SyntaxHighlight_GeSHi, could those affect anything? ParserFunctions is required so I assume not [22:05:58] no, they shouldn't affect this [22:12:21] ok, so I deleted my db, removed my local settings.php, reinstalled mw, just now exported Template:Infobox with all templates, then imported that file, and all the content is wrong. Template:Infobox has Module:Info content, Module:Info has Module:Hatnote content [22:13:18] by "Module:Info" I meant "Module:Infobox" [22:14:00] and Module:Hatnote has...? [22:14:46] I can't tell, it's this: local p = {} -- Returns the permission required to perform a given action on a given title. -- If no title is specified, the title of the page being displayed is used. function p._main(action, pagename) local title if type(pagename) == 'table' and pagename.prefixedText then title = pagename elseif pagename then title = mw.title.new(pagename) else title = mw.title.getCurrentTitle() end pagename = tit [22:14:49] oops [22:14:59] https://pste.me/#/kZaXQ [22:16:05] it's definitely not what wikipedia shows for hatnote: https://en.wikipedia.org/w/index.php?title=Module:Hatnote&action=edit [22:16:20] that *content* is what's listed for "Module:Infobox" for me [22:16:22] what are you importing to an wmf wiki or a third party? [22:16:53] Module:Effective protection expiry [22:16:58] this is a mediawiki install I've setup on a brand new ubuntu vm [22:18:20] those pages don't even appear next to each other in the exported XML, so this situation makes no sense, really [22:19:04] vive: it could read/write quota limit potentially [22:19:47] we don't have such quota limit on mediawiki AFAIK [22:20:53] vive: yeah, that sounds weird. Is your wiki publically accessible so that we could see? [22:21:26] unfortunately it's not, I have it running a local vagrant box [22:21:37] Amazing when you put your mind to something [22:21:52] You find you've been doing something wrong for a LONG time. [22:22:34] the only other thing I can try is to re-download mw and scrib, just to 100% ensure I have fresh copies [22:22:58] I do have a custom theme installed but I assume that can't possibly affect this [22:25:32] vive: probably not. You can try adding a url parameter ?useskin=vector to test with the normal skin [22:25:58] my skin wasn't even active this last attempt, so it's not that [22:26:19] Vulpix: i meant on the vm i am aware mw doesnt have an quota limit [22:27:13] that should give errors at least [22:27:56] Vulpix: it would be visable to the web client it would only show in logs on vm and etc [22:28:00] Wouldnt* [22:28:20] Ok, fresh install of mw 1.28.0, dropped the db, scribunto REL1_28-a665621, new install, absolutely nothing custom, still happening [22:28:38] if the database file can't grow, an insert would fail and MediaWiki (or PHP) throw an error [22:29:06] Are you exporting with all edit history if so only export with the latest edit history being saved [22:29:09] vive: can you check the contents of the XML file you're trying to import? [22:31:12] I'm exporting only the latest revision [22:31:23] From where [22:32:10] the xml file is accurate, the file names match the contents [22:32:32] I'm exporting from https://en.wikipedia.org/wiki/Special:Export [22:32:48] Template:Infobox, latest revision only, including templates [22:33:09] I did a fresh export just a few minutes ago to be sure [22:33:16] Hmm, idk [22:33:30] so the content is definitely getting mangled on import, it's doesn't look to be anything wrong with the xml [22:34:10] vive, anyting interesting in debug logging or php error reporting? [22:34:19] Try running the maintainence.php [22:35:52] What? [22:36:03] maintainence.php isn't even a mediawiki script [22:36:34] Maintenance.php [22:36:58] nonetheless, that's not going to do anything [22:37:53] hmm, there are message about some php pcntl functions being disabled [22:38:09] php7 may be the problem [22:38:25] I mean, it worked for me but I'm in php5 [22:38:28] There's no reason that Special:Import should need pcntl [22:38:46] the scrib extension does [22:39:03] yeah, but if that failed, it would fail at a later step [22:39:47] e.g. The contents of Module:Inputbox should still be right, you would just run in to trouble when you tried to use the module [22:42:55] that was it [22:43:31] removing those pcntl functions from php's disable_functions config worked. I wiped the db and did a re-import and now the files are in the right place [22:44:00] I had removed one pcntl func already because it was breaking installation but I didn't realize the others were breaking something [22:44:24] still this doesn't make sense to me... [22:45:02] yeah, I don't understand how that would happen [22:45:02] how could page titles and content be shuffled this way because of an error? :\ [22:46:54] Using Special:Import and Special:Export? [22:46:58] They're real pieces of shit. [22:47:39] Well I don't disagree, its still a weird error case [22:48:05] I mean it only broke because of scribunto, it's the only reason pcntl is needed. I just removed them all because I saw a dozen errors like this: pcntl_wexitstatus() has been disabled for security reasons in /var/www/public/wiki/extensions/Scribunto/engines/LuaStandalone/LuaStandaloneEngine.php on line 654 [22:48:06] I was just potentially answering "how could X happen?" [22:48:21] The answer to that question is that those two Special pages are really bad. [22:48:49] lol [22:48:49] I'm really surprised the import process didn't error out though, I was oblivious until I checked the php error log [22:49:29] You'd almost be better off using api.php and fetching each revision and just using a bot account to re-play the edits. [22:49:43] thb, from a user perspective, I really wish there was an easier way to make info boxes [22:49:44] Probably only need one revision per page anyway. [22:50:05] And you could re-run the script later to update the pages (if contents have changed). [22:50:11] Maybe infoboxs main template needs to be included with mw? [22:50:13] At least api.php is a lot more tested and less terrible. [23:07:42] uh oh, no channel logs since 20170219 :( [23:08:35] uh? [23:09:32] I see [23:09:38] * Platonides does have such logs [23:11:15] would anyone mind creating a task on phabricator about logs? I'm creating one about this Special:Import thing [23:12:38] oh... I have no logs because I was relying on wm-bot [23:13:41] wm-bot is connected, though [23:15:15] vive: There are easier ways to make infoboxes. enwikipedia likes things to be insanely complex [23:15:58]
Contents of my infobox here
[23:16:23] well it can't quite be that simple, I do want a template I can re-use [23:16:46] but I'm open to simpler ways for sure [23:17:22] It depends on how pretty you want [23:17:40] but if you just want some content in a callout box on the side [23:17:42] Hi. [23:18:01] a template with the contents:
{{{1}}}
[23:18:04] will do that for you [23:18:06] Does anyone know if there is any documentation for so called dynamic layouts? [23:18:21] What's a dynamic layout? [23:18:29] I found this [[https://en.wikisource.org/wiki/Help:Layout]] which gave an example I'd like to try and understand further [23:18:46] I'll probably wind up with something like http://stardewvalleywiki.com/Iron_Bar - but I'll have specific templates with set data [23:19:04] bawollf : Dynamic Layouts are something (English) Wikisource uses to do special layouts [23:19:23] Think of it's as a kind of Mediawiki specifc stylesheet [23:19:51] I couldn't find ANY other documentation , other than the page iv'e linked... [23:20:03] I call a MediaWiki specific stylesheet, a stylesheet :P [23:20:28] And I'm having a hard time realting whats in the example... to anything that appears as class/id names in Firefox's Element inspector [23:21:07] https://en.wikisource.org/wiki/User:ShakespeareFan00/vector.js was my tweaked version of the example from the linked page [23:21:10] It looks like custom javascript made by wikisource [23:21:17] Quite [23:21:50] But it's undocumented to the extent that it's like trying to figure out Ancient Greek without a dictionary [23:21:53] :( [23:23:49] it looks like its defined at https://en.wikisource.org/wiki/MediaWiki:PageNumbers.js or https://en.wikisource.org/wiki/MediaWiki:Gadget-PageNumbers-core.js [23:24:22] i guess its basically the "alternate stylesheet" feature if browsers didn't totally kill that feature [23:24:33] * bawolff remembers alternate stylesheets had a cool UI in firefox 1.0 [23:25:42] ShakespeareFan00: appears its just a button adding an alternate stylesheet [23:25:46] import bug filed at T159658 [23:25:46] T159658: Special:Import dumps contens in wrong titles when scribunto is installed and pcntl_* functions are not available - https://phabricator.wikimedia.org/T159658 [23:25:53] it wouldn't be documented at mediawiki, since its not part of mediawiki [23:26:18] is there a way I can use "named" parameters in a template" that's really all I want I guess [23:26:49] bawollf: Okay... [23:26:51] I could probably make due with the numbered format [23:26:57] but it's not user-friendly [23:27:15] So it's basicly something specifc to Wikisource that's undcoumented... [23:27:21] (Sigh) [23:27:24] yeah [23:27:31] also the js code is super sketchy :( [23:27:39] Perhaps I should start billing WMF for my wasted time? XD [23:27:44] :( [23:28:15] Well, not our fault that wikis do silly undocumented things [23:28:27] True [23:28:38] And that was a joke BTW [23:28:40] of course, for the rest of the undocumented crap that is our fault... [23:29:24] like parse functions that can't be logically subst? [23:29:58] In some other systems when you call a function you get an output.... [23:30:17] Parser functions don't do that when you subst them [23:30:57] The put the WHOLE raw function in , rather than just the relevant clause :) [23:31:07] This caught me out a couple of times. [23:31:18] channel logs bug reported at T159659 [23:31:19] T159659: Channel logs aren't being generated since 20170219 - https://phabricator.wikimedia.org/T159659 [23:45:21] not sure if anyone saw this question: is there a way I can use "named" parameters in a template?