Roy,<div><br></div><div>The alternative is calling the View directly. As you said you have done now.</div><div><br></div><div>As I said, I didn&#39;t read the post closely and I don&#39;t have time to now. I just wanted to help remove at least one variable for you by alerting you to the fact that testing a View via its &quot;Preview&quot; doesn&#39;t work all the time.</div>
<div><br></div><div>Sounds like that isn&#39;t your problem and hopefully others will jump in to help.</div><div><br></div><div>Shai<br><br><div class="gmail_quote">On Mon, Feb 15, 2010 at 12:08 PM, Roy R <span dir="ltr">&lt;<a href="mailto:roy.redirect@gmail.com">roy.redirect@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Shai<br>
Whats the alternative?<br>
Actually I get the same results when I call the view directly.<br>
So the display Page&#39;s path is &quot;contrib/my&quot;  ( no arguments), and<br>
typing &quot;<a href="http://localhost/contrib/my" target="_blank">http://localhost/contrib/my</a>&quot;  gives the following:<br>
<br>
Membership #   Name     Uid<br>
M1019              SGOCI      1<br>
<br>
This is the result of the first query, not the result of the second.<br>
The SQL statement in the preview mode is correct as far as I can tell.<br>
So it seems this is a display issue when View arguments are supplied<br>
programatically. The view-&gt;execute() statement in my PHP code seems to<br>
be having some undesired effects, because if I replace the php code<br>
with just<br>
<br>
return &#39;M1019&#39;;<br>
<br>
it works.<br>
<br>
Any clues?<br>
<br>
Thanks!<br>
Roy<br>
<br>
<br>
<br>
SELECT node.nid AS nid,<br>
   node_data_field_contrib_checkdate.field_contrib_checkdate_value AS<br>
node_data_field_contrib_checkdate_field_contrib_checkdate_value,<br>
   node.type AS node_type,<br>
   node.vid AS node_vid,<br>
   node_data_field_contrib_checkdate.field_contrib_checkno_value AS<br>
node_data_field_contrib_checkdate_field_contrib_checkno_value,<br>
   node_data_field_contrib_checkdate.field_contrib_voucherno_value AS<br>
node_data_field_contrib_checkdate_field_contrib_voucherno_value,<br>
   node_data_field_contrib_checkdate.field_contrib_voucherdate_value<br>
AS node_data_field_contrib_checkdate_field_contrib_voucherdate_value,<br>
   node_data_field_contrib_checkdate.field_contrib_accountno_value AS<br>
node_data_field_contrib_checkdate_field_contrib_accountno_value,<br>
   node_data_field_membernumber.field_membernumber_value AS<br>
node_data_field_membernumber_field_membernumber_value,<br>
   node.title AS node_title,<br>
   node_data_field_contrib_checkdate.field_contrib_amount_value AS<br>
node_data_field_contrib_checkdate_field_contrib_amount_value,<br>
   node_data_field_contrib_checkdate.field_contrib_memo_value AS<br>
node_data_field_contrib_checkdate_field_contrib_memo_value<br>
 FROM node node<br>
 LEFT JOIN content_type_contribution_record<br>
node_data_field_contrib_checkdate ON node.vid =<br>
node_data_field_contrib_checkdate.vid<br>
 INNER JOIN users users ON node.uid = users.uid<br>
 INNER JOIN node node_users ON users.uid = node_users.uid AND<br>
node_users.type = &#39;profile&#39;<br>
 LEFT JOIN content_field_membernumber node_data_field_membernumber ON<br>
node.vid = node_data_field_membernumber.vid<br>
 WHERE ((node.type in (&#39;contribution_record&#39;)) AND<br>
(node_data_field_membernumber.field_membernumber_value = &#39;M1019&#39;))<br>
    AND ((DATE_FORMAT(node_data_field_contrib_checkdate.field_contrib_checkdate_value,<br>
&#39;%Y&#39;) &lt;= &#39;2009&#39; AND<br>
DATE_FORMAT(node_data_field_contrib_checkdate.field_contrib_checkdate_value,<br>
&#39;%Y&#39;) &gt;= &#39;2009&#39;))<br>
   ORDER BY node_data_field_contrib_checkdate_field_contrib_checkdate_value DESC<br>
<div><div></div><div class="h5"><br>
<br>
On Mon, Feb 15, 2010 at 11:46 AM, Shai Gluskin &lt;<a href="mailto:shai@content2zero.com">shai@content2zero.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi Roy,<br>
&gt; Please note that I did not read your post thoroughly or truly consider your question.<br>
&gt; I&#39;m just writing to let you know that Views &quot;Preview&quot; functionality is a bit funky, it doesn&#39;t work reliably in all situations. I don&#39;t rely on Views Preview for anything. Do you really need it?<br>

&gt; Shai<br>
&gt;<br>
&gt; On Mon, Feb 15, 2010 at 7:14 PM, Roy R &lt;<a href="mailto:roy.redirect@gmail.com">roy.redirect@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hello Drupal gurus,<br>
&gt;&gt; Newbie drupal user trying to set up a website for a non-profit org.<br>
&gt;&gt;<br>
&gt;&gt; I am using Content Profile to capture a Member Account Number field in<br>
&gt;&gt; a CCK text field.<br>
&gt;&gt; I have a Content Type for Contributions which basically lists each<br>
&gt;&gt; contribution received, it has CCK fields for amount, check#, date, and<br>
&gt;&gt; Member Account Number (shared field with Content Profile)<br>
&gt;&gt;<br>
&gt;&gt; I want to add a menu option called &quot;My Contributions&quot; that will<br>
&gt;&gt; display a table listing the contributions for the current user for a<br>
&gt;&gt; given year (exposed filter on year) i.e. I need to get the Member<br>
&gt;&gt; Number field, and use that to filter the Contributions nodes.<br>
&gt;&gt;<br>
&gt;&gt; Reading various posts online I understood the best way to do this was<br>
&gt;&gt; to use Views to retrieve the Member Account Number from Content<br>
&gt;&gt; Profile and use that to create a default argument for another<br>
&gt;&gt; Contributions table View. So I have a view called<br>
&gt;&gt; &quot;user_profile_select&quot; that basically retrieves the user profile for<br>
&gt;&gt; the current user. (1 record only), and a second view that takes two<br>
&gt;&gt; parameters, a date, and a Member Number. The following code is added<br>
&gt;&gt; to the default argument section of the Contributions table view.<br>
&gt;&gt;<br>
&gt;&gt; $view = views_get_view(&#39;user_profile_select&#39;);<br>
&gt;&gt; $view-&gt;execute();<br>
&gt;&gt; if ( count($view-&gt;result) ) {<br>
&gt;&gt;   $ret =<br>
&gt;&gt;     $view-&gt;result[0]-&gt;node_users_node_data_field_membernumber_field_membernumber_value;<br>
&gt;&gt;   return $ret;<br>
&gt;&gt; }<br>
&gt;&gt; else {<br>
&gt;&gt;   return false;<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt; This kind of works, I can see that the correct Member number is being<br>
&gt;&gt; retrieved from the first view, and the second view&#39;s SQLs WHERE clause<br>
&gt;&gt; shows the correct argument. But the View does not display any records<br>
&gt;&gt; in Preview mode. If I pass in the same parameters manually, via the<br>
&gt;&gt; Preview text box, it works.<br>
&gt;&gt;<br>
&gt;&gt; What could be going wrong?? Thanks in advance for your help.<br>
&gt;&gt;<br>
&gt;&gt; Also please let me know if there are any easier alternatives to doing<br>
&gt;&gt; this? I tried playing with Panels and Contexts. My thought was I<br>
&gt;&gt; should be able to put the first view (user_profile_select) in a Panel,<br>
&gt;&gt; and add the second view to the same panel and have the second view<br>
&gt;&gt; pull its arguments from the first view&#39;s context. But this apparently<br>
&gt;&gt; does not work, I cannot see any CCK fields in the context.  I thought<br>
&gt;&gt; this kind of simple header/detail displays might be supported out of<br>
&gt;&gt; the box.<br>
&gt;&gt;<br>
&gt;&gt; Regards<br>
&gt;&gt; Roy<br>
&gt;&gt; --<br>
&gt;&gt; [ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; [ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</div></div>--<br>
<div><div></div><div class="h5">[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</div></div></blockquote></div><br></div>