[support] Unserializing Data for Use in a View

Steve Kessler skessler at denverdataman.com
Fri Sep 3 13:58:53 UTC 2010


I may be missing something here but could this not be done with
http://drupal.org/project/uc_views and a Global Rewrite.

On Fri, Sep 3, 2010 at 3:25 PM, Christopher M. Jones <cjones at partialflow.com
> wrote:

> Just a tip, from a coder to a non coder. Install the devel module, and
> in stead of print_r() you can use dpm(), which outputs arrays using
> krumo. Much easier to read and understand.
>
> Glad you figured it out.
>
> On 09/02/2010 10:14 PM, Shai Gluskin wrote:
> > Hi Cory,
> >
> > Thanks.  I think we were writing at the same time.
> >
> > Unserializing the $output won't work, because the $output comes with
> > some other stuff, like html.
> >
> > What works is this:
> >
> > $data = unserialize($row->{$field->field_alias});
> > print $data['attributes']['Attending'][0];
> >
> > To all, I apologize for not quoting the array keys in my previous "I got
> > it" post.
> >
> > But thank you.
> >
> > I've posted an issue for documentation at the Views queue, suggesting a
> > change in the explanatory text of views-view-field.tpl.php to be
> > explicit that the snippet is literal.
> >
> > You can +1 or make alternative suggestions at:
> > http://drupal.org/node/901088
> >
> > Shai
> >
> > On Thu, Sep 2, 2010 at 9:30 PM, Cory Gilliam <imaaxa at gmail.com
> > <mailto:imaaxa at gmail.com>> wrote:
> >
> >
> >     The data you are trying to get is inside an array that is inside an
> >     array.
> >
> >
> >     Array(
> >        [kit_id] => 570
> >        [module] => uc_product_kit
> >        [attributes] => Array(
> >          [Attending] => Array(
> >            [0] => Jane Doe, John Doe
> >          )
> >          [Note] => Array(
> >            [0] => We are friends of Eric Smith and Sandy Smith
> >          )
> >        )
> >        [shippable] => 0
> >        [unique_id] => 4c7d632a8090c7.95333579
> >     )
> >
> >     You need to add the name of the array that this array is in.
> >
> >     $data = unserialize($output);
> >     print $data ['attributes'] ['Attending'][0];
> >
> >     Little rusty at this.  Hope that helps.
> >     Cory
> >
> >
> >     --
> >     [ Drupal support list | http://lists.drupal.org/ ]
> >
> >
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20100903/e000ef7f/attachment.html 


More information about the support mailing list