Author: mattmann
Date: Thu Aug 27 02:25:37 2015
New Revision: 1698044

URL: http://svn.apache.org/r1698044
Log:
fix for OODT-480: Balance: default view not found contributed by Nesbert 
Hidalgo.

Modified:
    oodt/trunk/CHANGES.txt
    oodt/trunk/balance/lib/pear/Core/ApplicationRequest.class.php

Modified: oodt/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/oodt/trunk/CHANGES.txt?rev=1698044&r1=1698043&r2=1698044&view=diff
==============================================================================
--- oodt/trunk/CHANGES.txt (original)
+++ oodt/trunk/CHANGES.txt Thu Aug 27 02:25:37 2015
@@ -2,6 +2,8 @@ Apache OODT Change Log
 ======================
 Release 0.10 - Current Development
 
+* OODT-480 Balance: default view not found (Nesbert Hidalgo via mattmann)
+
 * OODT-598 XMLQuery DIS-style query parser needs to treat "#" as a word 
character (kelly via mattmann)
 
 * OODT-870 Integrate Curator into OPSUI (mattmann)

Modified: oodt/trunk/balance/lib/pear/Core/ApplicationRequest.class.php
URL: 
http://svn.apache.org/viewvc/oodt/trunk/balance/lib/pear/Core/ApplicationRequest.class.php?rev=1698044&r1=1698043&r2=1698044&view=diff
==============================================================================
--- oodt/trunk/balance/lib/pear/Core/ApplicationRequest.class.php (original)
+++ oodt/trunk/balance/lib/pear/Core/ApplicationRequest.class.php Thu Aug 27 
02:25:37 2015
@@ -78,7 +78,7 @@ class Org_Apache_Oodt_Balance_Core_Appli
        
        protected function processAsView() {
                // Determine the view to use
-               list($thePage) = explode('index.php',$this->uri);
+               list($thePage) = explode('index.php', parse_url($this->uri, 
PHP_URL_PATH)); // we only care about URL path info
                $thePage = ltrim($thePage,'/');
 
                if ($thePage == '') { $thePage = 'index'; }     
@@ -100,7 +100,9 @@ class Org_Apache_Oodt_Balance_Core_Appli
                // directory, chop off the last segment and try again. Add the 
chopped
                // segment to the "segments" array since it is likely a 
parameter.
                $partCount = count($parts);
-               while ($partCount > 0) {
+
+               // check for view at least once
+               do {
                        $testPath    = implode('/',$parts);
                        $homeTest    = (($this->isModule) ? 
"{$this->modulePath}/views" : $this->config['views_dir']) . '/' . $testPath . 
'.php';
                        $homeIdxTest = (($this->isModule) ? 
"{$this->modulePath}/views" : $this->config['views_dir']) . '/' . $testPath . 
'/index.php';
@@ -119,7 +121,7 @@ class Org_Apache_Oodt_Balance_Core_Appli
                        $this->segments[] = $parts[$partCount - 1];
                        array_pop($parts);
                        $partCount--;
-               }
+               } while ($partCount > 0);
                
                // If no view has been found by this point, display a 404 
message
                if (!$this->viewPath) {


Reply via email to