From 315d92afcdb95b360b5a4217f222a8b408a33290 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Tue, 24 Apr 2012 21:47:34 +0200 Subject: Uncatched exception, if a tag had no translation for current language. Now fixed. These tags are now filtered out. Also, Beta 5 --- ratatoeskr/frontend.php | 21 ++++++++++++++------- .../src/systemtemplates/backend_login.html | 2 +- .../templates/src/systemtemplates/master.html | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) (limited to 'ratatoeskr') diff --git a/ratatoeskr/frontend.php b/ratatoeskr/frontend.php index 7198c09..883f842 100644 --- a/ratatoeskr/frontend.php +++ b/ratatoeskr/frontend.php @@ -55,12 +55,19 @@ function section_transform_ste($section, $lang) */ function tag_transform_ste($tag, $lang) { - return array( - "id" => $tag->get_id(), - "name" => $tag->name, - "title" => $tag->title[$lang]->text, - "__obj" => $tag - ); + try + { + return array( + "id" => $tag->get_id(), + "name" => $tag->name, + "title" => $tag->title[$lang]->text, + "__obj" => $tag + ); + } + catch(DoesNotExistError $e) + { + return False; + } } /* @@ -107,7 +114,7 @@ function article_transform_ste($article, $lang) "status" => $article->status, "section" => section_transform_ste($a_section, $lang), "timestamp" => $article->timestamp, - "tags" => array_map(function($tag) use ($lang) { return tag_transform_ste($tag, $lang); }, $article->get_tags()), + "tags" => array_filter(array_map(function($tag) use ($lang) { return tag_transform_ste($tag, $lang); }, $article->get_tags())), "languages" => $languages, "comments_allowed" => $article->allow_comments, "__obj" => $article diff --git a/ratatoeskr/templates/src/systemtemplates/backend_login.html b/ratatoeskr/templates/src/systemtemplates/backend_login.html index f38317c..251af98 100755 --- a/ratatoeskr/templates/src/systemtemplates/backend_login.html +++ b/ratatoeskr/templates/src/systemtemplates/backend_login.html @@ -9,7 +9,7 @@
-
Ratatöskr::Noctilucent clouds (v. 0.1 β 4)
+
Ratatöskr::Noctilucent clouds (v. 0.1 β 5)

diff --git a/ratatoeskr/templates/src/systemtemplates/master.html b/ratatoeskr/templates/src/systemtemplates/master.html index 07a47c3..ddf6d08 100755 --- a/ratatoeskr/templates/src/systemtemplates/master.html +++ b/ratatoeskr/templates/src/systemtemplates/master.html @@ -31,7 +31,7 @@
- Ratatöskr::Noctilucent clouds (v. 0.1 β 4) + Ratatöskr::Noctilucent clouds (v. 0.1 β 5) $user[name] | -- cgit v1.2.3-70-g09d2