Physikerwelt has uploaded a new change for review.

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

Change subject: FormulaInfo: Update variable statistics on the fly
......................................................................

FormulaInfo: Update variable statistics on the fly

Change-Id: I68dadc4951d469f496cec2e5c428f9493ddeede7
---
M MathObject.php
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/42/189442/1

diff --git a/MathObject.php b/MathObject.php
index 21b07d2..7d2b646 100644
--- a/MathObject.php
+++ b/MathObject.php
@@ -98,7 +98,7 @@
                }
        }
 
-       public function getObservations() {
+       public function getObservations( $update = true) {
                global $wgOut;
                $dbr = wfGetDB( DB_SLAVE );
                try {
@@ -118,7 +118,12 @@
                }
                $wgOut->addWikiText($res->numRows(). 'results');
                if ($res->numRows() == 0){
-                       $wgOut->addWikiText("no statistics present please run 
the maintenance script ExtractFeatures.php");
+                       if ( $update ){
+                               $this->updateObservations();
+                               $this->getObservations( false );
+                       } else {
+                               $wgOut->addWikiText("no statistics present 
please run the maintenance script ExtractFeatures.php");
+                       }
                }
                $wgOut->addWikiText($res->numRows(). ' results');
                if ( $res ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I68dadc4951d469f496cec2e5c428f9493ddeede7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <[email protected]>

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

Reply via email to