From 5f3d60276a4dfe699af91a2382a4eb2ea9afea15 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Fri, 2 Sep 2016 19:46:58 +0200 Subject: [PATCH] [Bridge] Use original input values to guess context --- lib/Bridge.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Bridge.php b/lib/Bridge.php index 0f8ad1a..f5afc71 100644 --- a/lib/Bridge.php +++ b/lib/Bridge.php @@ -253,13 +253,12 @@ abstract class BridgeAbstract implements BridgeInterface { } } - protected function getQueriedContext(){ + protected function getQueriedContext(array $inputs){ $queriedContexts=array(); foreach(static::PARAMETERS as $context=>$set){ $queriedContexts[$context]=null; foreach($set as $id=>$properties){ - if(isset($this->inputs[$context][$id]['value']) && - !empty($this->inputs[$context][$id]['value'])){ + if(isset($inputs[$id]) && !empty($inputs[$id])){ $queriedContexts[$context]=true; }elseif(isset($properties['required']) && $properties['required']===true){ @@ -322,7 +321,7 @@ abstract class BridgeAbstract implements BridgeInterface { $this->setInputs($inputs); // Guess the paramter context from input data - $this->queriedContext = $this->getQueriedContext(); + $this->queriedContext = $this->getQueriedContext($inputs); if(is_null($this->queriedContext)){ $this->returnClientError('Required parameter(s) missing'); } elseif($this->queriedContext === false){