<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16981" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=758132920-02092010><FONT face=Arial
color=#0000ff size=2>I'm not an expert here, but I'm reading the coments
differently than you are. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=758132920-02092010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=758132920-02092010><FONT face=Arial
color=#0000ff size=2>I think you should be working with $row->data ( or at
least $row) and not with $output. That's got html in it, right?
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=758132920-02092010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=758132920-02092010><FONT face=Arial
color=#0000ff size=2>Dave</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> support-bounces@drupal.org
[mailto:support-bounces@drupal.org] <B>On Behalf Of </B>Shai
Gluskin<BR><B>Sent:</B> Thursday, September 02, 2010 1:24 PM<BR><B>To:</B>
support@drupal.org<BR><B>Subject:</B> [support] Unserializing Data for Use in a
View<BR></FONT><BR></DIV>
<DIV></DIV>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="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"><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 face="'courier new', monospace" color=#222222
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></BODY></HTML>