By Steven Koontz on Monday, 31 March 2014
Posted in Technical Issues
Replies 3
Likes 0
Views 777
Votes 0
Hi,

I am having a problem with ES 1.2.4 and uploading Jreviews listing images. Basically, all images are being attributed to a single listing, even though they are actually photos spread out over a number of listings.

Please look here: coinvalues.com/community

You will see the photo stream "28 photos for 1951 Washington Quarter". However, the uploads were actually 2 pics each for 14 listings. For some reason all of the image uploads are being attributed to the 1951 listing. There are other examples of this behavior farther down the stream (if logged in).

I posted on the Jreviews forum and Alejandro believes it might be because ES is basing the stream on user id rather than listing id. Here is Alejandro's answer: http://www.reviewsforjoomla.com/forum/index.php?topic=25999.msg109284#msg109284

Could you guys please take a look?

Thanks!
Hello Steven,

Ideally, the app should only generate a maximum of 5 photos and it should be using the same css class as our photos app. From the looks of it, the app seems to be listing all the photos
·
Monday, 31 March 2014 17:00
·
0 Likes
·
0 Votes
·
0 Comments
·
I'm not sure if I was clear. Those images are all for different listings. If you click through to "1951 Washington Quarter" you will see it has 2 photos, not 18. Same thing with 1952, 1953, etc... But according to Alejandro's explanation something in ES is causing all the photo uploads to be related to only one listing instead of the ones they really belong to.

I need to take an answer back to Alejandro regarding the cause of the problem.

Here is Alejandro's idea in full:

So I can replicate it, and it seems to me like this is a bug in ES. I don't recall this being an issue prior to ES v1.2 being released and we didn't change anything in our code for aggregate activities. ES uses two main DB tables to handle the stream. #__social_stream and #__social_stream_items.

#__social_stream_items includes all activities, while #__social_stream doesn't. If there's an aggregate activity, like submitting multiple photos for a listing, then #__social_stream only has one entry and the 'id' column is referenced in #__social_stream_items.uid for each sub-activity in the aggregate activity.

As an example, upload two photos for a listing. One entry is made in #__social_stream and two in #__social_stream_items and the rows are related via one-to-many relationship #__social_stream.id = #__social_stream_items.uid

My best guess is that ES appears to be aggregating the activities based on the user and not the listing id and so it keeps adding rows #__social_stream_items with the 'uid' column referencing the activity corresponding to the first listing. If we exclude the line below from the ES plugin we have in JReviews, then activities are not aggregated and also not messed up.

Code:
$tmpl->setAggregate(true);

The #__social_stream_items.target_id column is different for different listings as it should be so that's why my best guess is that they are incorrectly using the actor_id.

Please share this post with them and hopefully they have an answer. If we need to change something in our code to make this work in ES v1.2 we can do that. We just need to know where and what.
·
Monday, 31 March 2014 18:26
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Steven,

Ah okay, I'll reply in JReviews forum instead
·
Monday, 31 March 2014 23:45
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post