aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Wiki.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-01-26 10:46:44 +0100
committerMario Vavti <mario@mariovavti.com>2017-01-26 10:46:44 +0100
commit02e8058c5069506952e4c9979b7dfe02b5dc5480 (patch)
tree50352e4468b4b0eccef1a5889e067ccba60facb3 /Zotlabs/Module/Wiki.php
parent93057fae8c7ea264b4fd76878475b594c067e26b (diff)
downloadvolse-hubzilla-02e8058c5069506952e4c9979b7dfe02b5dc5480.tar.gz
volse-hubzilla-02e8058c5069506952e4c9979b7dfe02b5dc5480.tar.bz2
volse-hubzilla-02e8058c5069506952e4c9979b7dfe02b5dc5480.zip
fix renaming of wiki pages
Diffstat (limited to 'Zotlabs/Module/Wiki.php')
-rw-r--r--Zotlabs/Module/Wiki.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index 75a620c37..d075c02aa 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -619,23 +619,23 @@ class Wiki extends \Zotlabs\Web\Controller {
}
// Determine if observer has permission to rename pages
- $perms = Zlib\NativeWikiPage::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash);
+ $perms = Zlib\NativeWiki::get_permissions($resource_id, intval($owner['channel_id']), $observer_hash);
if(! $perms['write']) {
logger('Wiki write permission denied. ' . EOL);
json_return_and_die(array('success' => false));
}
$renamed = Zlib\NativeWikiPage::rename_page(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName, 'pageNewName' => $pageNewName));
+
if($renamed['success']) {
$ob = \App::get_observer();
- $commit = wiki_git_commit(array(
+ $commit = Zlib\NativeWikiPage::commit(array(
+ 'channel_id' => $owner['channel_id'],
'commit_msg' => 'Renamed ' . urldecode($pageUrlName) . ' to ' . $renamed['page']['htmlName'],
'resource_id' => $resource_id,
- 'observer' => $ob,
- 'files' => array($pageUrlName . substr($renamed['page']['fileName'], -3), $renamed['page']['fileName']),
- 'all' => true
+ 'observer_hash' => $ob['xchan_hash'],
+ 'pageUrlName' => $pageNewName
));
-
if($commit['success']) {
Zlib\NativeWiki::sync_a_wiki_item($owner['channel_id'],$commit['item_id'],$resource_id);
json_return_and_die(array('name' => $renamed['page'], 'message' => 'Wiki git repo commit made', 'success' => true));