Physikerwelt has submitted this change and it was merged.

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(-)

Approvals:
  Physikerwelt: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I68dadc4951d469f496cec2e5c428f9493ddeede7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Physikerwelt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to