https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112599

Revision: 112599
Author:   emsmith
Date:     2012-02-28 14:43:52 +0000 (Tue, 28 Feb 2012)
Log Message:
-----------
bug 34090 - follow up to r111211  - rename things to make them "less confusing" 
- only they're still confusing - comment copiously, return if the pageid is 
bogus

Modified Paths:
--------------
    trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php

Modified: trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php
===================================================================
--- trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php        
2012-02-28 14:42:08 UTC (rev 112598)
+++ trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php        
2012-02-28 14:43:52 UTC (rev 112599)
@@ -219,13 +219,20 @@
                        return;
                }
 
-               // create a title for the page
-               $page = Title::newFromID( $pageId );
-               $title = $page->getPartialURL();
+               // we only have the page id, we need the string page name for 
the permalink
+               $title_object = Title::newFromID( $pageId );
 
-               // to build our permalink, use the feedback entry key 
-               $title = SpecialPage::getTitleFor( 'ArticleFeedbackv5', 
"$title/$itemId" );
+               // no title object? no page? well then no logging
+               if (!$title_object) {
+                       return;
+               }
 
+               // get the string name of the page
+               $page_name = $title_object->getPartialURL();
+
+               // to build our permalink, use the feedback entry key + the 
page name (isn't page name a title? but title is an object? confusing)
+               $permalink = SpecialPage::getTitleFor( 'ArticleFeedbackv5', 
"$page_name/$itemId" );
+
                // Make sure our notes are not too long - we won't error, just 
hard substr it
                global $wgArticleFeedbackv5MaxActivityNoteLength;
                $notes = substr($notes, 0, 
$wgArticleFeedbackv5MaxActivityNoteLength);


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to