EBernhardson (WMF) has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/88517


Change subject: Workaround for php+apc lambda issues
......................................................................

Workaround for php+apc lambda issues

Some versions of php+apc have issues with lambda's at the top level of
a file, this works arround the issue by not using a lambda.

Change-Id: I81bd07bd545e1284425b033535343bc0e62caa7c
---
M templates/post.html.php
1 file changed, 5 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/17/88517/1

diff --git a/templates/post.html.php b/templates/post.html.php
index dfb69b1..96d8dc8 100644
--- a/templates/post.html.php
+++ b/templates/post.html.php
@@ -1,12 +1,11 @@
 <?php
 
-$self = $this;
-
-$createReplyForm = function() use( $self, $block, $post, $editToken, $user ) {
+$replyForm = '';
+if ( $post->getModerationState() == $post::MODERATED_NONE ) {
        $replyForm = Html::openElement( 'form', array(
                        'method' => 'POST',
                        // root post id is same as topic workflow id
-                       'action' => $self->generateUrl( 
$block->getWorkflowId(), 'reply' ),
+                       'action' => $this->generateUrl( 
$block->getWorkflowId(), 'reply' ),
                        'class' => 'flow-reply-form',
                ) );
        $replyForm .= Html::element( 'input', array( 'type' => 'hidden', 'name' 
=> 'wpEditToken', 'value' => $editToken) );
@@ -16,7 +15,7 @@
                        $replyForm .= $error->text() . '<br>'; // the pain ...
                }
        }
-       return $replyForm .
+       $replyForm .=
                Html::element( 'input', array(
                        'type' => 'hidden',
                        'name' => $block->getName() . '[replyTo]',
@@ -40,15 +39,11 @@
                ), wfMessage( 'flow-disclaimer' )->parse() ) .
                Html::closeElement( 'div' ) .
                '</form>';
-};
+}
 
 $class = $post->isModerated() ? 'flow-post-moderated' : 'flow-post';
 $actions = array();
-$replyForm = '';
 
-if ( $post->getModerationState() == $post::MODERATED_NONE ) {
-       $replyForm = $createReplyForm();
-}
 
 // The actual output
 echo Html::openElement( 'div', array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I81bd07bd545e1284425b033535343bc0e62caa7c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson (WMF) <[email protected]>

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

Reply via email to