@@ -187,14 +187,10 @@ private function getBackendChildren() {
187187 return $ this ->children ;
188188 }
189189
190- if ($ this ->board ) {
191- if ($ this ->stack !== null ) {
192- $ this ->children = $ this ->stack ->getCards () ?? [];
193- } else {
194- $ this ->children = $ this ->backend ->getChildren ($ this ->board ->getId ());
195- }
190+ if ($ this ->stack !== null ) {
191+ $ this ->children = $ this ->stack ->getCards () ?? [];
196192 } else {
197- $ this ->children = [] ;
193+ $ this ->children = $ this -> backend -> getChildren ( $ this -> board -> getId ()) ;
198194 }
199195
200196 return $ this ->children ;
@@ -275,7 +271,7 @@ public function propPatch(PropPatch $propPatch) {
275271 * @inheritDoc
276272 */
277273 public function getProperties ($ properties ) {
278- $ displayName = 'Deck: ' . ( $ this ->board ? $ this -> board -> getTitle () : ' no board object provided ' );
274+ $ displayName = 'Deck: ' . $ this ->board -> getTitle ();
279275 if ($ this ->stack !== null ) {
280276 $ displayName .= ' / ' . $ this ->stack ->getTitle ();
281277 }
@@ -289,7 +285,7 @@ public function getProperties($properties) {
289285
290286 private function extractUserIdFromPrincipalUri (): string {
291287 if (preg_match ('#^/?principals/users/([^/]+)$# ' , $ this ->principalUri , $ matches ) !== 1 ) {
292- throw new InvalidDataException ('Invalid principal URI ' );
288+ throw new Forbidden ('Invalid principal URI ' );
293289 }
294290
295291 return $ matches [1 ];
@@ -398,7 +394,7 @@ private function buildPlaceholderCalendarObject(string $name) {
398394
399395 $ placeholder = new Card ();
400396 $ placeholder ->setId ($ cardId );
401- $ placeholder ->setTitle ('Deleted task ' );
397+ $ placeholder ->setTitle ($ this -> translatePlaceholderTitle ( 'Deleted task ' ) );
402398 $ placeholder ->setDescription ('' );
403399 $ placeholder ->setDavUri ($ card ->getDavUri ());
404400 $ placeholder ->setStackId ($ this ->stack ?->getId() ?? $ card ->getStackId ());
@@ -424,7 +420,7 @@ private function buildPlaceholderCalendarObject(string $name) {
424420
425421 $ stack = new Stack ();
426422 $ stack ->setId ($ stackId );
427- $ stack ->setTitle ('Deleted list ' );
423+ $ stack ->setTitle ($ this -> translatePlaceholderTitle ( 'Deleted list ' ) );
428424 $ stack ->setBoardId ($ this ->board ->getId ());
429425 $ stack ->setOrder (0 );
430426 $ stack ->setDeletedAt (time ());
@@ -462,4 +458,16 @@ private function isDirectObjectReadRequest(): bool {
462458 return false ;
463459 }
464460 }
461+
462+ private function translatePlaceholderTitle (string $ text ): string {
463+ if (!class_exists ('\OC ' )) {
464+ return $ text ;
465+ }
466+
467+ try {
468+ return \OC ::$ server ->getL10N ('deck ' )->t ($ text );
469+ } catch (\Throwable $ e ) {
470+ return $ text ;
471+ }
472+ }
465473}
0 commit comments