[Vtigercrm-developers] Vtiger_Request get and a default value

Zygmuntowicz Michal m.zygmuntowicz at onet.pl
Wed Dec 11 14:46:49 GMT 2013


Hello,

I've just took a look at Vtiger_Request class and found
the following code:

    ...
    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])) {

Regards,
Michał Zygmuntowicz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20131211/e622b33b/attachment.html>


More information about the vtigercrm-developers mailing list