File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
apps/workflowengine/lib/Entity Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -136,12 +136,9 @@ protected function getNode(): Node {
136136 if (!$ this ->event instanceof MapperEvent || $ this ->event ->getObjectType () !== 'files ' ) {
137137 throw new NotFoundException ();
138138 }
139- $ nodes = $ this ->root ->getById ((int )$ this ->event ->getObjectId ());
140- if (is_array ($ nodes ) && isset ($ nodes [0 ])) {
141- $ this ->node = $ nodes [0 ];
142- return $ this ->node ;
143- }
144- break ;
139+ $ node = $ this ->root ->getFirstNodeById ((int )$ this ->event ->getObjectId ());
140+ $ this ->node = $ node ;
141+ return $ this ->node ;
145142 }
146143 throw new NotFoundException ();
147144 }
@@ -228,11 +225,11 @@ public function importContextIDs(array $contextIDs): void {
228225 $ this ->eventName = $ contextIDs ['eventName ' ];
229226 if ($ contextIDs ['nodeOwnerId ' ] !== null ) {
230227 $ userFolder = $ this ->root ->getUserFolder ($ contextIDs ['nodeOwnerId ' ]);
231- $ nodes = $ userFolder ->getById ($ contextIDs ['nodeId ' ]);
228+ $ node = $ userFolder ->getFirstNodeById ($ contextIDs ['nodeId ' ]);
232229 } else {
233- $ nodes = $ this ->root ->getById ($ contextIDs ['nodeId ' ]);
230+ $ node = $ this ->root ->getFirstNodeById ($ contextIDs ['nodeId ' ]);
234231 }
235- $ this ->node = $ nodes [ 0 ] ?? null ;
232+ $ this ->node = $ node ;
236233 if ($ contextIDs ['actingUserId ' ]) {
237234 $ this ->actingUser = $ this ->userManager ->get ($ contextIDs ['actingUserId ' ]);
238235 }
Original file line number Diff line number Diff line change @@ -388,7 +388,7 @@ public function getFirstNodeByIdInPath(int $id, string $path): ?INode {
388388 }
389389 }
390390 }
391- $ node = current ( $ this ->getByIdInPath ($ id , $ path) );
391+ $ node = $ this ->getFirstNodeByIdInPath ($ id , $ path );
392392 if (!$ node ) {
393393 return null ;
394394 }
You can’t perform that action at this time.
0 commit comments