fix lockview for photos
authorrabuzarus <rabuzarus@t-online.de>
Wed, 5 Sep 2018 12:12:56 +0000 (14:12 +0200)
committerrabuzarus <rabuzarus@t-online.de>
Wed, 5 Sep 2018 12:12:56 +0000 (14:12 +0200)
- use the private field only for items because other tables than the item table don't have the private field

mod/lockview.php

index 893764c..7617d6f 100644 (file)
@@ -24,11 +24,12 @@ function lockview_content(App $a) {
        if (!in_array($type, ['item','photo','event']))
                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];
        if ($type != 'item') {
                $item = DBA::selectFirst($type, $fields, $condition);
        } else {
+               $fields[] = 'private';
                $item = Item::selectFirst($fields, $condition);
        }