File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -19,15 +19,15 @@ public function invoke(?array $args): bool
19
19
$ this ->model ->acl_allowed = $ this ->model ->active_user
20
20
&& $ this ->model ->active_user ->getOption (\BNETDocs \Libraries \User \User::OPTION_ACL_DOCUMENT_MODIFY );
21
21
22
+ $ this ->model ->document_id = Router::query ()['id ' ] ?? null ;
23
+
22
24
if (!$ this ->model ->acl_allowed )
23
25
{
24
26
$ this ->model ->_responseCode = HttpCode::HTTP_FORBIDDEN ;
25
27
$ this ->model ->error = $ this ->model ->active_user ? EditModel::ERROR_ACL_NOT_SET : EditModel::ERROR_NOT_LOGGED_IN ;
26
28
return true ;
27
29
}
28
30
29
- $ this ->model ->document_id = Router::query ()['id ' ] ?? null ;
30
-
31
31
try { $ this ->model ->document = new \BNETDocs \Libraries \Document ($ this ->model ->document_id ); }
32
32
catch (\UnexpectedValueException ) { $ this ->model ->document = null ; }
33
33
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ $description = 'This form allows an individual to edit a document.';
8
8
$ url = '/document/edit ' ;
9
9
$ comments = $ this ->getContext ()->comments ;
10
10
$ document_id = $ this ->getContext ()->document_id ;
11
- $ document_url = ($ this ->getContext ()->document ? $ this ->getContext ()->document ->getURI () : UrlFormatter::format ('/document/ ' . rawurlencode ($ document_id )));
11
+ $ document_url = ($ this ->getContext ()->document ? $ this ->getContext ()->document ->getURI () : UrlFormatter::format ('/document/ ' . rawurlencode ($ document_id ?? '' )));
12
12
$ error = $ this ->getContext ()->error ;
13
13
switch ($ error )
14
14
{
You can’t perform that action at this time.
0 commit comments