[Bug 25580] Missing argument 5 for WikiImporter::finishImportPage() during xml dump import via API
https://bugzilla.wikimedia.org/show_bug.cgi?id=25580 --- Comment #8 from Dmitriy c...@uniyar.ac.ru 2010-11-09 18:51:39 UTC --- Yes, ResourceLoader issue has disappeared. However, SpecialImport issue is still here: [09-Nov-2010 20:43:13] PHP Warning: Missing argument 5 for WikiImporter::finishImportPage() in C:\www\phase3\includes\ImportXMLReader.php on line 182 [09-Nov-2010 20:43:13] PHP Warning: Missing argument 5 for WikiImporter::finishImportPage() in C:\www\phase3\includes\ImportXMLReader.php on line 182 [09-Nov-2010 20:43:13] PHP Warning: Missing argument 5 for WikiImporter::finishImportPage() in C:\www\phase3\includes\ImportXMLReader.php on line 182 [09-Nov-2010 20:43:14] PHP Warning: Missing argument 5 for WikiImporter::finishImportPage() in C:\www\phase3\includes\ImportXMLReader.php on line 182 [09-Nov-2010 20:43:15] PHP Warning: Missing argument 5 for WikiImporter::finishImportPage() in C:\www\phase3\includes\ImportXMLReader.php on line 182 [09-Nov-2010 20:43:15] PHP Warning: Missing argument 5 for WikiImporter::finishImportPage() in C:\www\phase3\includes\ImportXMLReader.php on line 182 Besides ImportReporter, also ApiImportReporter uses only four parameters while WikiImporter::finishImportPage() expects five parameters and not providing the default value for 5th parameter. Sounds like this bug is very easy to fix. The question is, what is better - to provide the default value of 5th parameter in WikiImporter::finishImportPage(), or to modify calls to provide proper value of $pageInfo in ImportReporter and ApiImportReporter. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
[Bug 25580] Missing argument 5 for WikiImporter::finishImportPage() during xml dump import via API
https://bugzilla.wikimedia.org/show_bug.cgi?id=25580 Andrew Garrett agarr...@wikimedia.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #9 from Andrew Garrett agarr...@wikimedia.org 2010-11-10 00:54:53 UTC --- Should be fixed by r76420. If not, let me know and I'll investigate in depth. Thanks for the bug report! -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
[Bug 25580] Missing argument 5 for WikiImporter::finishImportPage() during xml dump import via API
https://bugzilla.wikimedia.org/show_bug.cgi?id=25580 --- Comment #7 from Roan Kattouw roan.katt...@gmail.com 2010-10-26 20:22:45 UTC --- (In reply to comment #6) $files=array(2) { [0]= string(23) skins/monobook/main.css [1]= array(1) { [media]= string(8) handheld } } This one should no longer be there as of r75006. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
[Bug 25580] Missing argument 5 for WikiImporter::finishImportPage() during xml dump import via API
https://bugzilla.wikimedia.org/show_bug.cgi?id=25580 --- Comment #5 from Dmitriy c...@uniyar.ac.ru 2010-10-25 05:26:47 UTC --- Roan, after a brief observation, the first bug seems to be very simple: includes/specials/SpecialImport.php function reportPage( $title, $origTitle, $revisionCount, $successCount ) { global $wgOut, $wgUser, $wgLang, $wgContLang; $args = func_get_args(); call_user_func_array( $this-mOriginalPageOutCallback, $args ); There is a call_user_func_array with $args, where $args is a four reportPage arguments, while the callback has been modified to include 5th parameter: includes/ImportXMLReader.php /** * Mostly for hook use */ public function finishImportPage( $title, $origTitle, $revCount, $sRevCount, $pageInfo ) { $args = func_get_args(); return wfRunHooks( 'AfterImportPage', $args ); } which expects five parameters. Thus, the warning is produced. Either, the 5th parameter should be added to SpecialImport's reportPage; or the default value for finishImportPage should be provided. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
[Bug 25580] Missing argument 5 for WikiImporter::finishImportPage() during xml dump import via API
https://bugzilla.wikimedia.org/show_bug.cgi?id=25580 --- Comment #6 from Dmitriy c...@uniyar.ac.ru 2010-10-25 05:46:17 UTC --- Roan, it seems that ResourceLoader bug is quite simple, too. My 1.17 testing site uses Monobook skin, not Vector. and in ResourceLoaderFileModule::getModifiedTime() there is a following line: $filesMtime = max( array_map( 'filemtime', array_map( array( __CLASS__, 'remapFilename' ), $files ) ) ); which produced a warning with bad consequences, because $files[] elements might be Array, not just strings: $files=array(1) { [0]= string(23) skins/vector/screen.css } $files=array(1) { [0]= string(28) skins/common/commonPrint.css } $files=array(1) { [0]= string(23) skins/common/shared.css } $files=array(2) { [0]= string(23) skins/monobook/main.css [1]= array(1) { [media]= string(8) handheld } } note that in last case resourceloadermodule $files[1] is array which indicates media type of stylesheet. One should not do direct array_map() on such arrays to expect valid string result. Array string is produced and of course it is not a valid file name so one could not filemtime() it. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
[Bug 25580] Missing argument 5 for WikiImporter::finishImportPage() during xml dump import via API
https://bugzilla.wikimedia.org/show_bug.cgi?id=25580 Roan Kattouw roan.katt...@gmail.com changed: What|Removed |Added CC||agarr...@wikimedia.org, ||roan.katt...@gmail.com --- Comment #4 from Roan Kattouw roan.katt...@gmail.com 2010-10-20 13:58:35 UTC --- Andrew, could this be related to your import rewrite? -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
[Bug 25580] Missing argument 5 for WikiImporter::finishImportPage() during xml dump import via API
https://bugzilla.wikimedia.org/show_bug.cgi?id=25580 --- Comment #1 from Dmitriy c...@uniyar.ac.ru 2010-10-19 06:27:58 UTC --- Oops.. Could you remote the http links to my testing wiki (phase3), please? I've posted in haste and forgot to conceal them. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
[Bug 25580] Missing argument 5 for WikiImporter::finishImportPage() during xml dump import via API
https://bugzilla.wikimedia.org/show_bug.cgi?id=25580 Reedy s...@reedyboy.net changed: What|Removed |Added Severity|enhancement |minor --- Comment #2 from Reedy s...@reedyboy.net 2010-10-19 13:01:08 UTC --- I don't think we can easily. As for the above, the second half is a Resource loader issue Which hook are you calling? -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
[Bug 25580] Missing argument 5 for WikiImporter::finishImportPage() during xml dump import via API
https://bugzilla.wikimedia.org/show_bug.cgi?id=25580 --- Comment #3 from Dmitriy c...@uniyar.ac.ru 2010-10-20 05:36:23 UTC --- I am not calling any hook remotely. I use that 1.17 wiki remotely via API action=importxmltoken: static function importXML( $dstImportToken, $xmldata ) { if ( self::$directionToLocal ) { $json_result = new WikiSyncJSONresult( false ); // TODO: unfinished.. return $json_result-getResult(); } else { $APIparams = array( 'action' = 'import', 'format' = 'json', 'token' = $dstImportToken, ); list( $fname, $fp ) = self::tempnam_sfx( '', '.xml' ); fwrite( $fp, $xmldata, strlen( $xmldata ) ); fclose( $fp ); $APIfiles = array( 'xml'=$fname ); $jr = self::remoteAPIget( self::$remoteContextJSON, $APIparams, $APIfiles, false, true ); return $jr; } } static function remoteAPIget() { # get params $args = func_get_args(); // by default will encode JSON result to string $encodeResult = count( $args ) 4 || $args[3] !== false; // by default will NOT use 'multipart/form-data' encoding $useMultipart = count( $args ) 4 $args[4] === true; $json_result = new WikiSyncJSONresult( $encodeResult ); if ( !WikiSyncSetup::initUser() ) { # not enough priviledges to run this method return $json_result-getResult( 'noaccess' ); } # snoopy api_params are associative array $api_params = is_array( $args[1] ) ? $args[1] : json_decode( $args[1], true ); $api_files = count( $args ) 2 ? $args[2] : ''; $snoopy = new WikiSnoopy(); $snoopy-setContext( $args[0] ); if ( $useMultipart ) { $snoopy-set_submit_multipart(); $snoopy-httpmethod = POST; } else { $snoopy-set_submit_normal(); $snoopy-httpmethod = GET; } $snoopy-submitToApi( $api_params, $api_files ); # transport level error ? if ( $snoopy-error != '' ) { return $json_result-getResult( 'http', $snoopy-error ); } $response = json_decode( $snoopy-results, true ); # proxy returned html instead of json ? if ( $response === null ) { return $json_result-getResult( 'http' ); } $json_result-append( $response ); // no HTTP error valid AJAX if ( isset( $response['error'] ) ) { return $json_result-getResult( $response['error']['code'], $response['error']['info'] ); // API reported error } $json_result-setStatus( '1' ); // API success return $json_result-getResult(); } XML seems to be remotely imported fine, but with warnings in error_log file. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l