[17:48:50] Base: ping [18:09:30] lbenedix: pong\ [18:10:27] you asked me where I live... I wonder why you asked... [18:12:04] lbenedix: did you answer? :) i'm looking for somebody to halp me with making photos of ukrainian embassies in various countries - thats why i'd like to know where do you live) [18:12:42] Berlin [18:15:23] lbenedix: we have a photo from there https://uk.wikipedia.org/wiki/Посольство_України_в_Німеччині but if you like you may make some extra :) Here is it's page on ministry of foreign affairs site http://germany.mfa.gov.ua/de/embassy/contacts [18:21:42] I'm not a photorgrapher [18:26:33] lbenedix: i'm not speaking about professional photos) just normal photo made with amatory photo cam or smart-phone is ok for wiki in most cases) [20:45:10] [travis-ci] wikimedia/mediawiki-extensions-Wikibase#1157 (master - 4dec34d : Translation updater bot): The build is still failing. [20:45:10] [travis-ci] Change view : https://github.com/wikimedia/mediawiki-extensions-Wikibase/compare/0f15c3cb23c1...4dec34d86232 [20:45:10] [travis-ci] Build details : http://travis-ci.org/wikimedia/mediawiki-extensions-Wikibase/builds/13775697 [20:49:57] hoo: ping [20:50:12] lbenedix: hey ;) [20:50:59] you told me, that I could use jquery.wikibase.siteselector for the autocompletion... can you tell me a little more about this? [20:52:01] Sure, what exactly do you need? [20:52:19] I have no idea, how to use it ;) [20:53:40] $( ' ' ).siteselector( { resultSet: foo } ); [20:53:44] that's it ;) [20:54:52] lbenedix: ^ [20:55:07] foo has to vary depending on which sites the user should be able to select from [20:55:37] eg. for all sites pass wb.getSites ... [20:55:50] Is the jquery thingy loaded on the specialpages? [20:56:37] Well, you have to set two dependencies (AFAIR): wikibase.sites and jquery.wikibase.siteselector for this [20:56:59] wikibase.sites to be able to use wb.getSites (and similar methods) [20:58:39] I think I dont get the resultSet: part [20:59:10] lbenedix: resultSet are the sites the user can select from... the possible results [20:59:52] I dont want any restrictions [21:00:09] Ok, make it resultSet: wb.getSites() then [21:00:17] that will include all sites known to wikibase [21:01:32] okay [21:01:37] works fine [21:01:40] thx a lot! [21:01:44] \o/ :) [21:03:11] what is siteselector(...) doing exactly? I see, that it adds some css classes and other attributes to the [21:03:57] Well, it mainly adds the necessary statehandlers to be able to react on user input [21:04:10] but I can't tell you details without looking at the code of it either [21:04:17] ok [21:04:23] no problem [21:04:27] probably it's just a wrapper around jquery ui's suggestor [21:04:43] with a bit of extra logic needed for sites [21:05:30] the js is obviously not loaded on the specialpages... [21:05:45] It's not, yes [21:05:51] just create a new module for that ;) [21:06:52] https://www.mediawiki.org/wiki/ResourceLoader/Developing_with_ResourceLoader although our stuff may look a little different at times, it still uses that ;) [21:12:01] It tells me wb is not defined on the specialpage [21:12:42] lbenedix: Have you yet created a new module for whatever you're planning to do [21:12:44] ? [21:13:28] I added some dependecies to the 'wikibase.special' Module [21:13:51] I'm not sure taht's loaded everywhere [21:14:07] but you can check that using mw.loader.getState( moduleName ) [21:14:44] "registered" [21:15:02] that means it's not loaded, so you can't use it [21:15:15] (without loading it, ofc) [21:15:32] I remember, that I had problems with this module-stuff in my extension [21:16:29] That's something that is very specific to MediaWiki ... [21:24:23] works, if i load "wikibase.ui.entityViewInit" on the specialpage... creating a new Module seems not to work [21:25:01] lbenedix: Remember to load the new module in the PHP code ;) [21:25:32] you mean in the code of the specialpage? [21:25:36] I do [21:25:52] $this->getOutput()->addModules( 'wikibase.ui.entityViewInit' ); [21:25:53] mh [21:25:56] Exactly [21:27:50] I just copied the module 'wikibase.special' to 'wikibase.special.foobar' and loaded it within the specialpage, but I get null from mw.loader.getState( 'wikibase.special.foobar' ) [21:29:38] lbenedix: Cleared your caches and everything? [21:30:20] ahhh [21:30:47] damn cache... I reload with ctrl+f5, shouldn't this clear the cache?! [21:31:30] not really... browsers are nasty :D [21:33:34] * YuviPanda waves at hoo [21:33:44] hi YuviPanda :) [21:33:58] allmost the last question is, how I call $('#wb-entitieswithoutpage-language').siteselector( { resultSet: wb.getSites() }); when loading the page automagically [21:34:08] :D took time during my flight to do https://gerrit.wikimedia.org/r/#/c/94585/ [21:34:15] do take a look when you can [21:35:33] lbenedix: $( document ).ready( function() { /* whatever you want to run by the time the DOM is ready */ } ); [21:35:34] ;) [21:35:50] YuviPanda: Looks neat, needs tests [21:36:01] but in the speicalpages php code... [21:36:18] We want tests for 100% of the API functionality, so it would be great if you could just write up smth :) [21:36:32] lbenedix: Just use addModule [21:37:04] hoo: hah! will do [21:37:11] hoo: is jenkins configured to run them? [21:37:13] So I have to write additional javascript? [21:37:24] so I don't have to setup testing locally [21:37:28] YuviPanda: Yes :) Jenkins runs all of our PHPunits [21:37:34] sweet! [21:37:46] lbenedix: Just load the new module using addModules() [21:38:00] I'm practicing myself on a new keyboard now so gonna be a while before I can get to writing code on this one :) [21:38:06] and have those few lines in there $( document ).ready( workload ); [21:38:09] that's it ;) [21:38:10] hoo: anything other than missing tests? [21:38:26] if nothing, can you +1 it? :D [21:39:47] YuviPanda: yep, PARAM_TYPE shouldn't be string, but $this->getSiteLinkTargetSites()->getGlobalIdentifiers() [21:40:23] that way you can also cut down the desc. of that param a bit [21:40:24] hoo: That doesn't work because SearchEntities doesn't inherit from ApiWikiBase [21:40:32] oh really? [21:40:33] Sucks [21:40:37] yeah [21:40:50] and I don't want to move that. Unrelated and potentially large patch? [21:41:42] mh :( [21:44:34] hmmmm... I get Uncaught Error: Unknown dependency: wikibase.special/wikibase.special.entitiesWithout.js [21:44:41] but I just created this file... [21:44:57] lbenedix: Dependencies must be modules, not individual files [21:45:14] I added it to my 'wikibase.special.entitiesWithout' module [21:45:43] hmmmm... [21:45:59] YuviPanda: Porting that to ApiWikibase shouldn't eat to much time... could you try it maybe? [21:46:12] It's not enough to add the filelocation to the dependencies-array? [21:46:48] ahhh [21:46:54] lbenedix: Nope.. if it's module specific you can add it to the modules script array though [21:47:22] script array, dependencies array... I think I'm tired [21:47:47] :D That's something I could explain during a hackathon in a few minutes, I presume [21:48:06] It's working! whoop whoop [21:48:14] might be a bit hard to understand on IRC... best is to just copy what the other modules do [21:48:19] wow :) \o/ [21:48:28] but... one more thing ;) [21:48:40] yes? [21:49:02] the nice text from the autocompletion have to reduced to the language code before or after sending the form [21:49:37] lbenedix: They are reduced to site ids, isn't that good enough? [21:50:31] the get parameter is &language=Deutsch+%28dewiki%29 [21:50:39] should be just 'de' [21:50:54] ewk [21:51:00] ah I know, damn [21:51:15] forgot about that, we usually only use it from JS [21:51:45] $( yourInput ).siteselector( 'getSelectedSite' ).getId(); [21:52:00] do that in an onsubmit of the form ;) [21:53:08] I tried this in the JS Console, and I get 'dewiki' not 'de' [21:53:22] the special page should be "eating" those [21:53:28] if it doesn't, it sucks badly [21:53:54] especially to search on eg. dewikivoyage you need full site ids, not only language codes [21:53:57] nope, it doesnt [21:54:04] lang. codes should be avoided for searching [21:54:05] -.- [21:54:08] "dewiki" is not a valid language code. [21:54:26] $( yourInput ).siteselector( 'getSelectedSite' ).getLanguageCode() or so will fit your need [21:54:37] but that sucks badly... you should consider fixing the special page [21:57:28] I jsut wanted to fix a small bug and fell into the rabbit hole... [21:58:00] lbenedix: Like that https://d3j5vwomefv46c.cloudfront.net/photos/large/795272903.gif?1375176386 :D [21:58:33] hehe [21:58:37] exactly [21:59:17] lbenedix: I know that feeling... especially MediaWiki itself has some dark corners ... [22:00:33] hoo: i just changed the class it inherits from. Nothing seems to have broken [22:00:37] let me run tests' [22:01:03] :D [22:01:04] :) [22:02:10] At the ground of the rabbit hole I found the function: getEntitiesWithoutTerm [22:02:32] $joinConditions .= ' AND term_language = ' . $dbr->addQuotes( $language ); [22:02:51] (03PS1) 10Yuvipanda: Make SearchEntities inherit from WikiBaseApi [extensions/Wikibase] - 10https://gerrit.wikimedia.org/r/94679 [22:03:07] now to wait for jenkins [22:03:20] lbenedix: oh wait... what special page are we talking about again? :P [22:03:59] The errormessage is generated in the Specialpage... the error is in "if ( $this->language !== '' && !in_array( $this->language, Utils::getLanguageCodes() ) " [22:04:38] hoo: it didn't run tests? [22:04:43] I guess I'm not whitelisted [22:04:46] :( [22:04:57] YuviPanda: Sucks [22:05:10] If I were on my working set up atm, I could run them for you... [22:05:20] legoktm: you did something yesterday to make those tests run didn't you? [22:05:32] I edited the commit message. [22:05:40] hoo: I think someone with those perms need to minorly edit the commit message [22:05:42] hah [22:05:47] do it again? [22:05:58] I think the bug is Utils::getLanguageCodes() [22:06:05] (03PS2) 10Legoktm: Make SearchEntities inherit from WikiBaseApi [extensions/Wikibase] - 10https://gerrit.wikimedia.org/r/94679 (owner: 10Yuvipanda) [22:06:41] ty legoktm [22:06:43] Is there something like this for the wikidata sites? [22:07:33] lbenedix: All site ids, you mean? [22:07:46] jepp... but this time in php [22:07:46] $wgConf->getLocalDatabases() or something. [22:08:11] legoktm: Oh now [22:08:18] * no [22:08:24] * legoktm huggles hoo  [22:09:05] \SiteSQLStore::newInstance()->getSites() [22:11:19] that is no array... [22:11:37] hoo: tests passed! https://gerrit.wikimedia.org/r/#/c/94679/ [22:11:56] I can rebase my patch on top of this [22:12:07] lol namespaces. [22:13:02] YuviPanda: would be great [22:17:31] hoo: think you can +2 this one? ;) [22:19:08] YuviPanda: Not sure... maybe it should call the parent methods properly... dunno [22:19:23] to busy to decide that now :P [22:19:26] heh [22:19:31] ok [22:19:39] I'll just wait for tomorrow then [22:20:08] YuviPanda: Sure... I'll be around almost all of the UTC+1 work day (at least I guess) [22:20:21] :D [22:20:39] hopefully this can be merged before whenever you guys deploy next [22:21:21] code freeze is on Wednesday, probably [22:21:33] you have to ask aude for that, not sure [22:23:52] * YuviPanda waves at aude who is probably not here [23:07:50] how do I get an array of sites from \SiteSQLStore::newInstance()->getSites()? [23:09:13] lbenedix: that's supposed to return an array [23:11:55] but an array of MediawikiSites [23:12:27] I'd like to check if that array is containing 'dewiki' [23:14:31] lbenedix: Loop through it then [23:15:18] foreach ( \SiteSQLStore::newInstance()->getSites() as $site ) { if ( $site->getGlobalId() === 'dewiki' ) { die( "I'm so happy, I could die" ); } } [23:19:57] feels dirty [23:20:59] it is, you could just is ->getSite( 'dewiki' ) I guess [23:22:44] lbenedix: ^ [23:22:58] and I get null if I call it with 'foobar'? [23:23:11] yep [23:23:14] * @return Site|null [23:23:28] Though [23:23:39] you probably want ->hasSite( 'dewiki' ) [23:23:46] which is what you actually want. [23:23:50] I just wrote up the big thing above because it was the only proper answer to your question (not altering the original question) [23:23:53] I'm tired :P [23:24:02] me too ;) [23:24:17] * lbenedix wants to have it done today [23:25:12] wow, we have a SiteList object as it seems [23:26:18] how exactly do I call hasSite? [23:26:38] lbenedix: getSites()->hasSite( ' ... ' ); [23:27:17] but its false for 'dewiki' [23:28:33] > echo \SiteSQLStore::newInstance()->getSites()->hasSite( 'dewiki' ); [23:28:34] 1 [23:31:48] adding a ! helps... [23:32:32] only missing piece is the replacing of the "Deutsch (dewiki)" with "dewiki" [23:33:05] maybe this could be done in php as well, so the User wont be confused [23:33:50] if I submit only 'dewiki' this will be found in the inputbox on the specialpage... but was 'Deutsch (dewiki)' before sending [23:34:38] lbenedix: Well, there are several ways to do that... you can eg. use a hidden input for the real data [23:36:38] good idea [23:46:48] It finally works [23:47:02] thx a lot [23:47:03] \o/ [23:47:05] :) [23:47:17] next fun will be comitting this fix ;) [23:47:36] heh... hope I don't have to ripe it apart in code review :D [23:47:56] * rip [23:48:25] I have to remember how to commit... but not today [23:48:36] heh :) [23:48:45] going to be around tomorrow, feel free to ping [23:49:00] thx