diff --git a/include/wiki.php b/include/wiki.php index d52308b08..1d1e20e27 100644 --- a/include/wiki.php +++ b/include/wiki.php @@ -192,8 +192,9 @@ function wiki_exists_by_name($uid, $urlName) { function wiki_get_permissions($resource_id, $owner_id, $observer_hash) { // TODO: For now, only the owner can edit $sql_extra = item_permissions_sql($owner_id, $observer_hash); - $r = q("SELECT * FROM item WHERE resource_type = '%s' AND resource_id = '%s' $sql_extra LIMIT 1", - dbesc(WIKI_ITEM_RESOURCE_TYPE), + $r = q("SELECT * FROM item WHERE uid = %d and resource_type = '%s' AND resource_id = '%s' $sql_extra LIMIT 1", + intval($owner_id), + dbesc(WIKI_ITEM_RESOURCE_TYPE), dbesc($resource_id) ); diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 4e76a79be..26a0a72e8 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -544,10 +544,5 @@ {{else}} $('#new-wiki-button').hide(); {{/if}} - {{if $showPageControls}} - $('#edit-wiki-button').show(); - {{else}} - $('#edit-wiki-button').hide(); - {{/if}} }); \ No newline at end of file diff --git a/view/tpl/wikilist.tpl b/view/tpl/wikilist.tpl index 3997741dc..eb6dbc722 100644 --- a/view/tpl/wikilist.tpl +++ b/view/tpl/wikilist.tpl @@ -3,7 +3,7 @@