Topic on Project:Support desk

Patch from 1.23.1 to 1.23.2 Error

6
204.90.74.7 (talkcontribs)

I am trying to update Mediawiki 1.23.1 to 1.23.2 using the released patch file. My PHP version is 5.3.3, MySQL is 5.1.73 and OS is CentOS 6.5. I Gunzip'd the patch file and moved it into the Mediawiki main folder and did a dry run, and below shows the error I am getting. There is no tests folder in my wiki folder, so I'm not sure where I am supposed to get those from.

wiki>patch -p1 --dry-run < mediawiki-1.23.2.patch
patching file includes/api/ApiFormatJson.php
patching file includes/db/DatabasePostgres.php
patching file includes/DefaultSettings.php
patching file includes/ImagePage.php
patching file includes/OutputPage.php
patching file includes/parser/ParserOutput.php
patching file includes/Preferences.php
patching file includes/SiteStats.php
patching file maintenance/initSiteStats.php
patching file RELEASE-NOTES-1.23
patching file resources/Resources.php
patching file resources/src/mediawiki.page/mediawiki.page.image.pagination.js
can't find file to patch at input line 276
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -Nruw -x messages -x '*.png' -x '*.jpg' -x '*.xcf' -x '*.gif' -x '*.svg' -x '*.tiff' -x '*.zip' -x '*.xmp' -x '.git*' mediawiki-1.23.1/tests/phpunit/includes/api/format/ApiFormatJsonTest.php mediawiki-1.23.2/tests/phpunit/includes/api/format/ApiFormatJsonTest.php
|--- mediawiki-1.23.1/tests/phpunit/includes/api/format/ApiFormatJsonTest.php   2014-07-30 19:29:15.619144417 +0000
|+++ mediawiki-1.23.2/tests/phpunit/includes/api/format/ApiFormatJsonTest.php   2014-07-30 19:24:41.560514483 +0000
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
Ciencia Al Poder (talkcontribs)
Nierensteinlaus (talkcontribs)

I am having the exact same problem. I have the impression that the last bit of the patch file is where the problem lies.

If I remove the following bit of the patch:

diff -Nruw -x messages -x '*.png' -x '*.jpg' -x '*.xcf' -x '*.gif' -x '*.svg' -x '*.tiff' -x '*.zip' -x '*.xmp' -x '.git*' mediawiki-1.23.1/tests/phpunit/includes/api/format/ApiFormatJsonTest.php mediawiki-1.23.2/tests/phpunit/includes/api/format/ApiFormatJsonTest.php
--- mediawiki-1.23.1/tests/phpunit/includes/api/format/ApiFormatJsonTest.php    2014-07-30 19:29:15.619144417 +0000
+++ mediawiki-1.23.2/tests/phpunit/includes/api/format/ApiFormatJsonTest.php    2014-07-30 19:24:41.560514483 +0000
@@ -14,4 +14,9 @@
                $this->assertInternalType( 'array', json_decode( $data, true ) );
                $this->assertGreaterThan( 0, count( (array)$data ) );
        }
+
+       public function testJsonpInjection( ) {
+               $data = $this->apiRequest( 'json', array( 'action' => 'query', 'meta' => 'siteinfo', 'callback' => 'myCallback' ) );
+               $this->assertEquals( '/**/myCallback(', substr( $data, 0, 15 ) );
+       }

The following happens:

# patch -p1 --dry-run < mediawiki-1.23.2.patch_mod 
patching file includes/api/ApiFormatJson.php
patching file includes/db/DatabasePostgres.php
patching file includes/DefaultSettings.php
patching file includes/ImagePage.php
patching file includes/OutputPage.php
patching file includes/parser/ParserOutput.php
patching file includes/Preferences.php
patching file includes/SiteStats.php
patching file maintenance/initSiteStats.php
patching file RELEASE-NOTES-1.23
patching file resources/Resources.php
patching file resources/src/mediawiki.page/mediawiki.page.image.pagination.js
Hunk #1 succeeded at 60 with fuzz 1.
217.111.210.43 (talkcontribs)

I'm having exactly the same problem, no test folder. 'can't find file to patch at input line 276'

204.90.74.114 (talkcontribs)

Does this seem to you like it's not breaking any needed functionality?

This post was posted by 204.90.74.114, but signed as 204.90.74.7.

88.130.83.237 (talkcontribs)

The errors are all related to files in the folder tests/. This folder is not needed for MediaWiki to run; it is not present in the 1.23.x tarballs. Until the patch file has been fixed, you can just run the "broken" patch file and remove the .rej files, which it leaves behind. Afterwards you have a correctly updated installation - exactly what you should have!

Reply to "Patch from 1.23.1 to 1.23.2 Error"