aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-01-26 06:37:35 +1100
committerGitHub <noreply@github.com>2017-01-26 06:37:35 +1100
commitc916906716528648d8559608216ca353507c23df (patch)
tree315989dd17ba37604069033e703bd09e89d0c71c /Zotlabs/Module
parent54f7cd53022284570ca38daba97386f929fd6f4a (diff)
parent1db57c498d0edceac705ba027790cfa9d4e04c6d (diff)
downloadvolse-hubzilla-c916906716528648d8559608216ca353507c23df.tar.gz
volse-hubzilla-c916906716528648d8559608216ca353507c23df.tar.bz2
volse-hubzilla-c916906716528648d8559608216ca353507c23df.zip
Merge pull request #653 from git-marijus/dev
fixes for wiki create/delete page
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Wiki.php18
1 files changed, 3 insertions, 15 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index 222c10155..d694a28ae 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -416,7 +416,7 @@ class Wiki extends \Zotlabs\Web\Controller {
}
$page = Zlib\NativeWikiPage::create_page($owner['channel_id'],$observer_hash, $name, $resource_id);
- if($page['success']) {
+ if($page['item_id']) {
$ob = \App::get_observer();
$commit = Zlib\NativeWikiPage::commit(array(
'commit_msg' => t('New page created'),
@@ -547,20 +547,8 @@ class Wiki extends \Zotlabs\Web\Controller {
$deleted = Zlib\NativeWikiPage::delete_page(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName));
if($deleted['success']) {
- $ob = \App::get_observer();
- $commit = Zlib\NativeWikiPage::git_commit(array(
- 'commit_msg' => 'Deleted ' . $pageUrlName,
- 'resource_id' => $resource_id,
- 'observer' => $ob,
- 'files' => null
- ));
- if($commit['success']) {
- Zlib\NativeWiki::sync_a_wiki_item($owner['channel_id'],$commit['item_id'],$resource_id);
- json_return_and_die(array('message' => 'Wiki git repo commit made', 'success' => true));
- }
- else {
- json_return_and_die(array('message' => 'Error making git commit','success' => false));
- }
+ Zlib\NativeWiki::sync_a_wiki_item($owner['channel_id'],$commit['item_id'],$resource_id);
+ json_return_and_die(array('message' => 'Wiki git repo commit made', 'success' => true));
}
else {
json_return_and_die(array('message' => 'Error deleting page', 'success' => false));