File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -105,10 +105,20 @@ angular.module('mm.addons.mod_wiki')
105105 pageId = createdId ;
106106
107107 return $mmaModWiki . getPageContents ( pageId ) . then ( function ( pageContents ) {
108- wikiId = pageContents . wikiid ;
109- subwikiId = pageContents . subwikiid ;
108+ var promises = [ ] ;
109+ wikiId = parseInt ( pageContents . wikiid , 10 ) ;
110+ if ( ! subwikiId ) {
111+ // Subwiki was not created, invalidate subwikis as well.
112+ promises . push ( $mmaModWiki . invalidateSubwikis ( wikiId ) ) ;
113+ }
114+
115+ subwikiId = parseInt ( pageContents . subwikiid , 10 ) ;
116+ userId = parseInt ( pageContents . userid , 10 ) ;
117+ groupId = parseInt ( pageContents . groupid , 10 ) ;
110118 // Invalidate subwiki pages since there are new.
111- return $mmaModWiki . invalidateSubwikiPages ( pageContents . wikiid ) . then ( function ( ) {
119+ promises . push ( $mmaModWiki . invalidateSubwikiPages ( wikiId ) ) ;
120+
121+ return $q . all ( promises ) . then ( function ( ) {
112122 return gotoPage ( ) ;
113123 } ) ;
114124 } ) . finally ( function ( ) {
Original file line number Diff line number Diff line change @@ -113,11 +113,7 @@ angular.module('mm.addons.mod_wiki')
113113 } ) ;
114114 } ) . catch ( function ( error ) {
115115 $scope . spinner = false ;
116- if ( error ) {
117- $mmUtil . showErrorModal ( error ) ;
118- } else {
119- $mmUtil . showErrorModal ( 'mm.core.errordownloading' , true ) ;
120- }
116+ $mmUtil . showErrorModalDefault ( error , 'mm.core.errordownloading' , true ) ;
121117 } ) ;
122118 }
123119
You can’t perform that action at this time.
0 commit comments