Problem/Motivation

When working with Views and outputting the field Instagram: Caption the unserialized string get printed instead of the actual caption text of the image. Here's an example of the output:

a:4:{s:12:"created_time";s:10:"1342723357";s:4:"text";s:49:"#finnkino #amazingspiderman #movies #movietickets";s:4:"from";a:4:{s:8:"username";s:15:"aleksijohansson";s:15:"profile_picture";s:73:"http://images.instagram.com/profiles/profile_42026258_75sq_1334577814.jpg";s:2:"id";s:8:"42026258";s:9:"full_name";s:16:"Aleksi Johansson";}s:2:"id";s:18:"239103310451420945";}

Proposed resolution

Add a field handler to drupagram_views_field_handlers.inc to output the correct array item instead of the whole unserialized string. Change the handler from drupagram.views.inc to match the newly created field handler.

Remaining tasks

Review by the community.

Comments

aleksijohansson’s picture

StatusFileSize
new1.21 KB

First version of a patch to fix this issue for review. This adds a new field handler to drupagram_views_field_handlers.inc and changes the drupagram caption handler in drupagram.views.inc to use the new handler.

aleksijohansson’s picture

Status: Active » Needs review

Changed the status of the issue to needs review.

aleksijohansson’s picture

Issue summary: View changes

Changed the issue to match the Issue Summary Template.

frichman’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new225.18 KB

Patch looks good.

rmontero’s picture

Assigned: aleksijohansson » frichman

Fletcher, can you merge that patch in?

Thanks,

RM.

urlM’s picture

Just FYI for anyone that runs into the same issue I just had. When I downloaded the patch to the drupagram module directory via curl and tried to git apply, then I was getting the error of "fatal: unrecognized input".

curl -O http://drupal.org/files/issues/drupagram-fix-caption-1696552-0.patch
git apply drupagram-fix-caption-1696552-0.patch
fatal: unrecognized input

But, if I downloaded the patch directly by right-clicking and "save link as" into the directory then git apply worked. Is there something I'm doing wrong with curl or has something been corrupted?

jfraz’s picture

StatusFileSize
new2.1 KB

Drupal 6.x-1.x git am style patch attached

rmontero’s picture

Component: API Integration / Library » Code
Status: Reviewed & tested by the community » Closed (fixed)

Fixed, changes will be rolled out in the next release (7.x-1.2).

rmontero’s picture

Issue summary: View changes

Changed the remaining tasks.

mburnette’s picture

Using Drupagram 7.x-1.2 and Views 7.x-3.8. Still getting an & in stead of an ampersand (&) in my Instagram captions.

https://dl.dropboxusercontent.com/u/41406170/Screen%20Shot%202015-01-22%...

Is there a patch I need to use or should the captions be using full/filtered text?