http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88602

Revision: 88602
Author:   hartman
Date:     2011-05-22 20:13:56 +0000 (Sun, 22 May 2011)
Log Message:
-----------
Not every author cell of Information template contains a link.

Was causing an error in mw.absoluteUrl because authUrl was undefined.

Modified Paths:
--------------
    
trunk/extensions/MwEmbedSupport/MwEmbedModules/MediaWikiSupport/resources/mw.MediaWikiPlayerSupport.js

Modified: 
trunk/extensions/MwEmbedSupport/MwEmbedModules/MediaWikiSupport/resources/mw.MediaWikiPlayerSupport.js
===================================================================
--- 
trunk/extensions/MwEmbedSupport/MwEmbedModules/MediaWikiSupport/resources/mw.MediaWikiPlayerSupport.js
      2011-05-22 19:58:49 UTC (rev 88601)
+++ 
trunk/extensions/MwEmbedSupport/MwEmbedModules/MediaWikiSupport/resources/mw.MediaWikiPlayerSupport.js
      2011-05-22 20:13:56 UTC (rev 88602)
@@ -145,11 +145,14 @@
                                $author.find('br').remove();
                                
                                // Update link to be absolute per page url 
context: 
-                               var authUrl = $author.find('a').attr('href');
-                               authUrl = mw.absoluteUrl( authUrl,  articleUrl 
);
-                               $author.find('a').attr('href', 
-                                       authUrl
-                               )
+                               var $links = $author.find('a');
+                               if( $links.length ) {
+                                       var authUrl = 
$author.find('a').attr('href');
+                                       authUrl = mw.absoluteUrl( authUrl,  
articleUrl );
+                                       $author.find('a').attr('href', 
+                                               authUrl
+                                       )
+                               }
                                $creditLine.append( $( '<br />' ),
                                        gM('mwe-embedplayer-credit-author', 
$author.html() )
                                )
@@ -263,4 +266,4 @@
                });
        };
                
-} )( window.mediaWiki, window.jQuery );
\ No newline at end of file
+} )( window.mediaWiki, window.jQuery );


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

Reply via email to