Fix #6622: image::newFromTitle deprecated but still used
authorAntoine Musso <hashar@users.mediawiki.org>
Mon, 10 Jul 2006 19:49:22 +0000 (19:49 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Mon, 10 Jul 2006 19:49:22 +0000 (19:49 +0000)
RELEASE-NOTES
includes/CategoryPage.php
includes/ExternalEdit.php
includes/Image.php
includes/Parser.php
includes/SpecialNewimages.php

index aa5e64b..f67cbfb 100644 (file)
@@ -47,6 +47,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   cache object.
 * (bug 6299) Maintain parser's revision ID across recursive calls to fix
   {{REVISIONID}} when Cite extension is used
+* (bug 6622) Removed deprecated function image::newFromTitle
 
 
 == Languages updated ==
index 53d6997..440f41c 100644 (file)
@@ -124,11 +124,13 @@ class CategoryPage extends Article {
                                array_push( $children_start_char, $wgContLang->convert( $sortkey ) ) ;
                        } elseif( $showGallery && $title->getNamespace() == NS_IMAGE ) {
                                // Show thumbnails of categorized images, in a separate chunk
+                               $anImage = new Image($title);
                                if( $flip ) {
-                                       $ig->insert( Image::newFromTitle( $title ) );
+                                       $ig->insert( $anImage );
                                } else {
-                                       $ig->add( Image::newFromTitle( $title ) );
+                                       $ig->add( $anImage );
                                }
+                               unset($anImage);
                        } else {
                                // Page in this category
                                array_push( $articles, $sk->makeSizeLinkObj( $x->page_len, $title, $wgContLang->convert( $title->getPrefixedText() ) ) ) ;
index 21f632e..14b55fd 100644 (file)
@@ -48,7 +48,7 @@ class ExternalEdit {
                        $extension="wiki";
                } elseif($this->mMode=="file") {
                        $type="Edit file";
-                       $image = Image::newFromTitle( $this->mTitle );
+                       $image = new Image( $this->mTitle );
                        $img_url = $image->getURL();
                        if(strpos($img_url,"://")) {
                                $url = $img_url;
index fd0f8a3..c5cf3e9 100644 (file)
@@ -66,14 +66,6 @@ class Image
                }
        }
 
-       /**
-        * Obsolete factory function, use constructor
-        * @deprecated
-        */
-       function newFromTitle( $title ) {
-               return new Image( $title );
-       }
-
        function Image( $title ) {
                if( !is_object( $title ) ) {
                        throw new MWException( 'Image constructor given bogus title.' );
index 9f60030..8a6314d 100644 (file)
@@ -1634,7 +1634,7 @@ class Parser
                                $s .= $this->makeKnownLinkHolder( $nt, $text, '', $trail, $prefix );
                                continue;
                        } elseif( $ns == NS_IMAGE ) {
-                               $img = Image::newFromTitle( $nt );
+                               $img = new Image( $nt );
                                if( $img->exists() ) {
                                        // Force a blue link if the file exists; may be a remote
                                        // upload on the shared repository, and we want to see its
index 976611a..1bd3e4c 100644 (file)
@@ -130,7 +130,7 @@ function wfSpecialNewimages( $par, $specialPage ) {
                $ut = $s->img_user_text;
 
                $nt = Title::newFromText( $name, NS_IMAGE );
-               $img = Image::newFromTitle( $nt );
+               $img = new Image( $nt );
                $ul = $sk->makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut );
 
                $gallery->add( $img, "$ul<br />\n<i>".$wgLang->timeanddate( $s->img_timestamp, true )."</i><br />\n" );