Open dgtlcrftrs opened 4 years ago
Why not just wrap the number you pass to the setting in brackets? I.e:
$sectionID = 1;
return [
'trackSection' => [$sectionId]
];
return [
'trackDays' => 91, //default is 7 days
'trackSection' => [2], //limit tracking to specific sections
'visitorTimeout' => 30 //default is 15 minutes
];
It is If thats what you meant. This is clearly a bug of some sort that has only occurred since updating to craft 3.4.28.1.
https://github.com/madebyraygun/trending-posts/blob/bbdc7c9dd929d1386de30590a663f1a01f0e8d75/src/TrendingPosts.php#L102
This line is causing an error due to the fact that it is expecting $getSection to be an array. However I am only tracking one section and my query is for that section so the returned variable ($getSection) is a string. I have added a conditional above that line to check if it's an array and if not, to turn it into one which resolved my issue.
$getSection = is_array($getSection) ? $getSection : array($getSection);