Hi,
I embedded Gallery and did have a problem when users where in gallery embed as guest and rating was activated for album.
The problem only occures in embedded gallery and only inside Woltlab Community framework because there warnings and missing variables in templates are catched as errors. The error message was: Fatal error: PHP notice in file /.../smarty/templates_c/%%2878868355/%%4B^4B0^4B09DD88%%RatingInterface.tpl.php (44): Undefined index: userRating
Information:
error message: PHP notice in file /.../smarty/templates_c/%%2878868355/%%4B^4B0^4B09DD88%%RatingInterface.tpl.php (44): Undefined index: userRating
error code: 0
The code part I found creating my problem was this:
$data = array();
while ($result = $searchResults->nextResult()) {
$rating = $result[1] / 1000;
$data[(int)$result[0]] = array('itemId' => (int)$result[0],
'rating' => GalleryUtilities::roundToString($rating, 3),
'votes' => (int)$result[2],
'averagePercent' => GalleryUtilities::roundToString(($rating * 100 / 5), 3),
'stars' => round($rating * 2)
);
if ($rating == 0) {
$data[(int)$result[0]]['stars'] = 1;
}
}
By adding an empty vaule for userRating to the initialization of the $data array, everything is all right now, like this:
$data = array();
while ($result = $searchResults->nextResult()) {
$rating = $result[1] / 1000;
$data[(int)$result[0]] = array('itemId' => (int)$result[0],
'rating' => GalleryUtilities::roundToString($rating, 3),
'votes' => (int)$result[2],
'averagePercent' => GalleryUtilities::roundToString(($rating * 100 / 5), 3),
'userRating' => '',
'stars' => round($rating * 2)
);
if ($rating == 0) {
$data[(int)$result[0]]['stars'] = 1;
}
}
So hopefully I could explain my issue and the solution I found good enough.
BR Markus
Logged In: YES
user_id=942712
Originator: NO
Please verify that this is still a problem with the current development version (subversion / nightly snapshot) of Gallery 2.
We've done related fixes throughout the last year.
Logged In: YES
user_id=1312539
Originator: NO
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).