Fixed bug where user profile page would display empty thumbs for items not viewable by logged in user
This commit is contained in:
parent
b5290b154c
commit
c61a62574c
|
@ -150,15 +150,17 @@ class photoannotation_event_Core {
|
||||||
$view = new Theme_View("dynamic.html", "collection", "userprofiles");
|
$view = new Theme_View("dynamic.html", "collection", "userprofiles");
|
||||||
//load thumbs
|
//load thumbs
|
||||||
$item_users = ORM::factory("items_user")->where("user_id", "=", $data->user->id)->find_all();
|
$item_users = ORM::factory("items_user")->where("user_id", "=", $data->user->id)->find_all();
|
||||||
$children_count = count($item_users);
|
|
||||||
foreach ($item_users as $item_user) {
|
foreach ($item_users as $item_user) {
|
||||||
$item_thumb = ORM::factory("item")
|
$item_thumb = ORM::factory("item")
|
||||||
->viewable()
|
->viewable()
|
||||||
->where("type", "!=", "album")
|
->where("type", "!=", "album")
|
||||||
->where("id", "=", $item_user->item_id)
|
->where("id", "=", $item_user->item_id)
|
||||||
->find();
|
->find();
|
||||||
$item_thumbs[] = $item_thumb;
|
if ($item_thumb->loaded()) {
|
||||||
|
$item_thumbs[] = $item_thumb;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
$children_count = count($item_thumbs);
|
||||||
$page_size = module::get_var("gallery", "page_size", 9);
|
$page_size = module::get_var("gallery", "page_size", 9);
|
||||||
$page = (int) Input::instance()->get("page", "1");
|
$page = (int) Input::instance()->get("page", "1");
|
||||||
$offset = ($page-1) * $page_size;
|
$offset = ($page-1) * $page_size;
|
||||||
|
|
Reference in New Issue
Block a user