Foxtrott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/352284 )

Change subject: Fix Fatal error: Call to undefined function Lingo\string()
......................................................................

Fix Fatal error: Call to undefined function Lingo\string()

Change-Id: Ib969467ecfe9c352614675ad6c53a37571311747
---
M src/Element.php
1 file changed, 16 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/84/352284/1

diff --git a/src/Element.php b/src/Element.php
index b17f639..18fc24a 100644
--- a/src/Element.php
+++ b/src/Element.php
@@ -141,7 +141,7 @@
                $link = $doc->createElement( 'a', $this->mDefinitions[ 0 ][ 
self::ELEMENT_TERM ] );
 
                // set the link target
-               $link->setAttribute( 'href', $target->getLinkUrl() );
+               $link->setAttribute( 'href', $target->getLinkURL() );
 
 
                $link = $this->addClassAttributeToLink( $target, $link );
@@ -151,9 +151,9 @@
        }
 
        /**
-        * @param $target
-        * @param $link
-        * @return mixed
+        * @param Title $target
+        * @param DOMElement $link
+        * @return DOMElement
         */
        protected function &addClassAttributeToLink( $target, &$link ) {
 
@@ -163,28 +163,30 @@
                // part here.
 
                // set style
-               $classes = string( $this->mDefinitions[ 0 ][ 
self::ELEMENT_STYLE ] );
+               $classes = array();
+
+               if ( $this->mDefinitions[ 0 ][ self::ELEMENT_STYLE ] !== null ) 
{
+                       $classes[] = $this->mDefinitions[ 0 ][ 
self::ELEMENT_STYLE ];
+               }
 
                if ( !$target->isKnown() ) {
-                       $classes .= ' new';
+                       $classes[] = 'new';
                }
 
                if ( $target->isExternal() ) {
-                       $classes .= ' extiw';
+                       $classes[] = 'extiw';
                }
 
-               $classes = trim( $classes );
-
-               if ( $classes !== '' ) {
-                       $link->setAttribute( 'class', $classes );
+               if ( count($classes) > 0 ) {
+                       $link->setAttribute( 'class', join(' ', $classes ) );
                }
 
                return $link;
        }
 
        /**
-        * @param $target
-        * @param $link
+        * @param Title $target
+        * @param DOMElement $link
         * @return mixed
         */
        protected function &addTitleAttributeToLink( $target, &$link ) {
@@ -203,7 +205,7 @@
 
        /**
         * @param StashingDOMDocument $doc
-        * @return string
+        * @return DOMElement
         * @throws \MWException
         */
        protected function getFullDefinitionAsTooltip( StashingDOMDocument 
&$doc ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/352284
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib969467ecfe9c352614675ad6c53a37571311747
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott <[email protected]>

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

Reply via email to