I'm creating a view of ubercart order products. I got the necessary data to be accessible to Views using Table Wizard (<a href="http://drupal.org/project/tw">http://drupal.org/project/tw</a>).<div><br></div><div>The product attribute info is stored serialized in the "data" field on the uc_order_products table. Here is an example of the raw serialized data:</div>
<div><br></div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
<font class="Apple-style-span" face="'courier new', monospace">a:5:{s:6:"kit_id";s:3:"570";s:6:"module";s:14:"uc_product_kit";s:10:"attributes";a:2:{s:9:"Attending";a:1:{i:0;s:26:"Jane Doe, John Doe";}s:4:"Note";a:1:{i:0;s:45:"We are friends of Eric Smith and Sandy Smith";}}s:9:"shippable";s:1:"0";s:9:"unique_id";s:23:"4c7d632a8090c7.95333579";}</font></blockquote>
<div><br></div><div>I have no problem printing it out like above. </div><div><br></div><div>Unserialized it looks like this:</div><div><br></div><div><span class="Apple-style-span" style="color: rgb(34, 34, 34); "><font class="Apple-style-span" face="'courier new', monospace">Array<br>
(<br>[kit_id] => 570<br>[module] => uc_product_kit<br>[attributes] => Array<br>(<br>[Attending] => Array<br>(<br>[0] => Jane Doe, John Doe<br>)<br><br>[Note] => Array<br>(<br>[0] => We are friends of Eric Smith and Sandy Smith<br>
)<br><br>)<br><br>[shippable] => 0<br>[unique_id] => 4c7d632a8090c7.95333579<br>)</font></span></div><div><font class="Apple-style-span" color="#222222" face="'courier new', monospace" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br>
</span></font></div><div><font class="Apple-style-span" color="#222222"><font class="Apple-style-span" face="arial, helvetica, sans-serif">I want to print out: Jane Doe, John Doe</font></font></div><div><font class="Apple-style-span" color="#222222"><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br>
</font></font></div><div><font class="Apple-style-span" color="#222222"><font class="Apple-style-span" face="arial, helvetica, sans-serif">Here is what views-view-field.tpl.php has to say:</font></font></div><div><font class="Apple-style-span" color="#222222"><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br>
</font></font></div><div><font class="Apple-style-span" color="#222222"><font class="Apple-style-span" face="arial, helvetica, sans-serif"><div><font class="Apple-style-span" face="'courier new', monospace">// $Id: views-view-field.tpl.php,v 1.1 2008/05/16 22:22:32 merlinofchaos Exp $</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> /**</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> * This template is used to print a single field in a view. It is not</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> * actually used in default Views, as this is registered as a theme</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> * function which has better performance. For single overrides, the</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> * template is perfectly okay.</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> *</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> * Variables available:</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> * - $view: The view object</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> * - $field: The field handler object that can process the input</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> * - $row: The raw SQL result that can be used</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> * - $output: The processed output that will normally be used.</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> *</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> * When fetching output from the $row, this construct should be used:</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> * $data = $row->{$field->field_alias}</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> *</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> * The above will guarantee that you'll always get the correct data,</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> * regardless of any changes in the aliasing that might happen if</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> * the view is modified.</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> */</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div>This is what I'm putting in views-view-field.tpl.php:</div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">$data = unserialize($output);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">print $data['Attending'][0];</font></div><div><br></div><div>Nothing gets returned.</div><div><br></div><div>What am I doing wrong?</div>
<div><br></div><div>thanks,</div><div><br></div><div>Shai</div></font></font></div>