Last modified: 2013-10-23 18:17:35 UTC
Use MediaWiki 1.18.1 and try to look at Release Notes in Installer: http://127.0.0.1/w/mw-config/index.php?page=ReleaseNotes Get the following warning: Warning: file_get_contents([...]/www/w/includes/installer/../../RELEASE-NOTES): failed to open stream: No such file or directory in [...]/www/w/includes/installer/WebInstallerPage.php on line 1236. The file "RELEASE-NOTES" does not exist (anymore) but it was renamed to "RELEASE-NOTES-1.18". WebInstallerPage.php does neither know this renaming nor check on existence of file.
I think we just need to get from $wgVersion the major and minor version, so we can drop the last number, and append that to the link to the release notes file Ideally this needs fixing before 1.19 tarball Attempting to symlink is just going to be asking for trouble
For me the following modification of /includes/installer/WebInstallerPage.php works well: --- trunk/phase3/includes/installer/WebInstallerPage.php (revision 108689) +++ trunk/phase3/includes/installer/WebInstallerPage.php (working copy) @@ 1245,3 1245,11 @@ class WebInstaller_UpgradeDoc extends WebInstaller_Document { - protected function getFileName() { return 'RELEASE-NOTES'; } + protected function getFileName() { + global $wgVersion; + + if(! preg_match( '/^(\d+)\.(\d+).*/i', $wgVersion, $result ) ) { + throw new MWException('Variable $wgVersion has an invalid value.'); + } + + return 'RELEASE-NOTES-' . $result[1] . '.' . $result[2]; + } } Moreover, for me it seems rasonable to check if the user has deleted (or renamed...) one of the files: --- trunk/phase3/includes/installer/WebInstallerPage.php (revision 108689) +++ trunk/phase3/includes/installer/WebInstallerPage.php (working copy) @@ 1235,3 1235,7 @@ public function getFileContents() { - return file_get_contents( dirname( __FILE__ ) . '/../../' . $this->getFileName() ); + $file = dirname( __FILE__ ) . '/../../' . $this->getFileName(); + if( ! file_exists( $file ) ) { + return wfMsgNoTrans( 'config-nofile', $file ); + } + return file_get_contents( $file ); } --- trunk/phase3/includes/installer/Installer.i18n.php (revision 108689) +++ trunk/phase3/includes/installer/Installer.i18n.php (working copy)
Sorry, I missed a bit: --- trunk/phase3/includes/installer/Installer.i18n.php (revision 108689) +++ trunk/phase3/includes/installer/Installer.i18n.php (working copy) @@ 559,2 559,3 @@ * [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]", + 'config-nofile' => 'File "$1" could not be found.', );
moejoe0000, thanks for the patch! Could you please provide the patch as a unified diff against trunk? https://en.wikipedia.org/wiki/en:Diff#Unified_format Short version: $ svn di > /Users/you/Desktop/my_first_patch.diff In case you need help with that: http://openhatch.org/missions/diffpatch Thanks!
Created attachment 9969 [details] Patch as outlined in commets #2, #3
r111198