[Vtigercrm-commits] [Vtiger development] #7840: Vtiger_Request::get default values from the defaultmap always override values from the request

Vtiger development vtiger-tickets at trac.vtiger.com
Wed Dec 11 15:50:05 GMT 2013


#7840: Vtiger_Request::get default values from the defaultmap always override
values from the request
--------------------------+------------------------
 Reporter:  zygmuntowicz  |      Owner:  developer
     Type:  defect        |     Status:  new
 Priority:  unassigned    |  Milestone:  Unassigned
Component:  vtigercrm     |    Version:  6.0.0 RC
 Severity:  Low           |   Keywords:
--------------------------+------------------------
 Hello,

 I've just took a look at Vtiger_Request class and found
 the following code (includes/http/Request.php):

 {{{
     function get($key, $defvalue = '') {
         $value = $defvalue;
         if(isset($this->valuemap[$key])) {
             $value = $this->valuemap[$key];
         }
         if($defvalue === '' && isset($this->defaultmap[$key])) {
             $value = $this->defaultmap[$key];
         }
 }}}

 It seems that if a default value is set in the defaultmap,
 it always overrides the value from the request - is it intentional?

 My guess is that the condition should look like:

 {{{
         if($value === '' && isset($this->defaultmap[$key])) {
 }}}

 instead of:

 {{{
         if($defvalue === '' && isset($this->defaultmap[$key])) {
 }}}

--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7840>
Vtiger development <http://trac.vtiger.com/>
Vtiger CRM


More information about the vtigercrm-commits mailing list