fix lockview for photos
- use the private field only for items because other tables than the item table don't have the private field
This commit is contained in:
parent
31cbc80981
commit
88d25f977a
|
@ -24,11 +24,12 @@ function lockview_content(App $a) {
|
||||||
if (!in_array($type, ['item','photo','event']))
|
if (!in_array($type, ['item','photo','event']))
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
$fields = ['uid', 'private', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid'];
|
$fields = ['uid', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid'];
|
||||||
$condition = ['id' => $item_id];
|
$condition = ['id' => $item_id];
|
||||||
if ($type != 'item') {
|
if ($type != 'item') {
|
||||||
$item = DBA::selectFirst($type, $fields, $condition);
|
$item = DBA::selectFirst($type, $fields, $condition);
|
||||||
} else {
|
} else {
|
||||||
|
$fields[] = 'private';
|
||||||
$item = Item::selectFirst($fields, $condition);
|
$item = Item::selectFirst($fields, $condition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue