<div dir="ltr">Thank you for the use-case. We have addressed it - (<a href="http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7840#comment:4">please review</a>).<div><br></div><div>Regards,</div><div>Prasad</div></div><div class="gmail_extra">

<br clear="all"><div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><b>Connect with us on: </b><a href="http://twitter.com/vtigercrm" style="color:rgb(0,0,204)" target="_blank">Twitter</a> <b>I</b> <a href="http://www.facebook.com/pages/vtiger/226866697333578?sk=wall" style="color:rgb(0,0,204)" target="_blank">Facebook</a> <b>I</b> <a href="https://blogs.vtiger.com/" style="color:rgb(0,0,204)" target="_blank">Blog</a><b> I</b> <a href="http://wiki.vtiger.com/index.php/Main_Page" style="color:rgb(0,0,204)" target="_blank">Wiki</a> <b>I </b><a href="https://discussions.vtiger.com" style="color:rgb(0,0,204)" target="_blank">Forums </a><b>I</b> <a href="https://www.vtiger.com/" style="color:rgb(0,0,204)" target="_blank">Website</a></span></div>


<br><br><div class="gmail_quote">On Thu, Dec 12, 2013 at 2:48 PM, Zygmuntowicz Michal <span dir="ltr"><<a href="mailto:m.zygmuntowicz@onet.pl" target="_blank">m.zygmuntowicz@onet.pl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<u></u>



<div style="PADDING-LEFT:10px;PADDING-RIGHT:10px;PADDING-TOP:15px" name="Compose message area">
<div><font face="Arial">But the problem I see here is that if the request 
has a value set for some key</font></div>
<div><font face="Arial">(and it is found the the valuemap) and the 
defaultmap has a value for the same key too,</font></div>
<div><font face="Arial">the get function will return the default value 
(from defaultmap) instead of the value</font></div>
<div><font face="Arial">from the request (found in the valuemap). 
E.g.:</font></div>
<div><font face="Arial"></font> </div>
<div><font face="Arial">valuemap contains ('mode' => 
'edit')</font></div>
<div><font face="Arial">defaultmap contains ('mode' => 
'delete')</font></div>
<div><font face="Arial"></font> </div>
<div><font face="Arial">when we call get('mode') the retrun value will 
be always 'delete',</font></div>
<div><font face="Arial">no matter what the valuemap actually 
contains.</font></div>
<div style="FONT:10pt Tahoma">
<div><font face="Arial"></font><font face="Arial"></font><font face="Arial"></font><br></div>
<div style="BACKGROUND:#f5f5f5">
<div><b>From:</b> <a title="prasad@vtiger.com" href="mailto:prasad@vtiger.com" target="_blank">Prasad</a> </div>
<div><b>Sent:</b> Thursday, December 12, 2013 6:27 AM</div>
<div><b>To:</b> <a title="vtigercrm-developers@lists.vtigercrm.com" href="mailto:vtigercrm-developers@lists.vtigercrm.com" target="_blank">vtigercrm-developers@lists.vtigercrm.com</a> 
</div>
<div><b>Subject:</b> Re: [Vtigercrm-developers] Vtiger_Request get and a default 
value</div></div></div><div><div class="h5">
<div><br></div>
<div dir="ltr">Michal, 
<div><br></div>
<div>You are right - (<span style="FONT-FAMILY:Arial">defvalue) has less 
precedence than (defaultmap).</span></div>
<div><font face="Arial">If there is a value defined in defaultmap - 
defvalue will be ignored.</font></div>
<div><span style="FONT-FAMILY:Arial"><br></span></div>
<div><span style="FONT-FAMILY:Arial">Regards,<br>Prasad</span></div>
<div><span style="FONT-FAMILY:Arial"><br></span></div></div>
<div class="gmail_extra"><br clear="all">
<div><span style="BORDER-COLLAPSE:collapse;FONT-FAMILY:arial,sans-serif;FONT-SIZE:13px"><b>Connect 
with us on: </b><a style="COLOR:rgb(0,0,204)" href="http://twitter.com/vtigercrm" target="_blank">Twitter</a> <b>I</b> <a style="COLOR:rgb(0,0,204)" href="http://www.facebook.com/pages/vtiger/226866697333578?sk=wall" target="_blank">Facebook</a> <b>I</b> <a style="COLOR:rgb(0,0,204)" href="https://blogs.vtiger.com/" target="_blank">Blog</a><b> I</b> <a style="COLOR:rgb(0,0,204)" href="http://wiki.vtiger.com/index.php/Main_Page" target="_blank">Wiki</a> <b>I </b><a style="COLOR:rgb(0,0,204)" href="https://discussions.vtiger.com" target="_blank">Forums </a><b>I</b> <a style="COLOR:rgb(0,0,204)" href="https://www.vtiger.com/" target="_blank">Website</a></span></div>

<br><br>
<div class="gmail_quote">On Wed, Dec 11, 2013 at 8:16 PM, Zygmuntowicz Michal 
<span dir="ltr"><<a href="mailto:m.zygmuntowicz@onet.pl" target="_blank">m.zygmuntowicz@onet.pl</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote"><u></u>
  <div style="PADDING-LEFT:10px;PADDING-RIGHT:10px;PADDING-TOP:15px" name="Compose message area">
  <div><font face="Arial">Hello,</font></div>
  <div><font face="Arial"></font> </div>
  <div><font face="Arial">I've just took a look at Vtiger_Request class and 
  found</font></div>
  <div><font face="Arial">the following code:</font></div>
  <div> </div>
  <div>    <font face="Arial">...</font></div>
  <div><font face="Arial">    function get($key, $defvalue = 
  '') {<br>        $value = 
  $defvalue;<br>        if(isset($this->valuemap[$key])) 
  {<br>            $value 
  = 
  $this->valuemap[$key];<br>        }<br>        if($defvalue 
  === '' && isset($this->defaultmap[$key])) 
  {<br>            $value 
  = 
  $this->defaultmap[$key];<br>        }</font></div>
  <div><font face="Arial">    ...<br></font></div>
  <div><font face="Arial">It seems that if a default value is set in the 
  defaultmap,</font></div>
  <div><font face="Arial">it always overrides the value from the request - is it 
  intentional?</font></div>
  <div><font face="Arial"></font> </div>
  <div><font face="Arial">My guess is that the condition should look 
  like:</font></div>
  <div><font face="Arial">        if($value === '' 
  && isset($this->defaultmap[$key])) {</font></div>
  <div><font face="Arial">instead of:</font></div>
  <div><font face="Arial">        if($defvalue === '' 
  && isset($this->defaultmap[$key])) {<br></font></div>
  <div><font face="Arial">Regards,</font></div>
  <div><font face="Arial">Michał 
  Zygmuntowicz<br></font></div></div><br>_______________________________________________<br><a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br></blockquote></div><br></div>
</div></div><p>
</p><hr>

<p></p>_______________________________________________<br><a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><p></p></div>
<br>_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br></blockquote></div><br></div>