diff options
author | Kevin Chabowski <kevin@kch42.de> | 2012-04-24 21:47:34 +0200 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2012-04-24 21:47:34 +0200 |
commit | 315d92afcdb95b360b5a4217f222a8b408a33290 (patch) | |
tree | 63f1cc60618cd5965632a01a9a6617700cdb0c4d | |
parent | 958a721cf66eff27629b05d407a028e6f469e2b5 (diff) | |
download | ratatoeskr-cms-315d92afcdb95b360b5a4217f222a8b408a33290.tar.gz ratatoeskr-cms-315d92afcdb95b360b5a4217f222a8b408a33290.tar.bz2 ratatoeskr-cms-315d92afcdb95b360b5a4217f222a8b408a33290.zip |
Uncatched exception, if a tag had no translation for current language.
Now fixed. These tags are now filtered out.
Also, Beta 5
-rw-r--r-- | ratatoeskr/frontend.php | 21 | ||||
-rwxr-xr-x | ratatoeskr/templates/src/systemtemplates/backend_login.html | 2 | ||||
-rwxr-xr-x | ratatoeskr/templates/src/systemtemplates/master.html | 2 |
3 files changed, 16 insertions, 9 deletions
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 @@ <body> <img id="background_image" src="$rel_path_to_root/ratatoeskr/cms_style/images/login_bg.jpg" alt="" /> <div id="main"> - <div id="bar_top"><strong>Ratatöskr</strong>::Noctilucent clouds (v. 0.1 β 4)</div> + <div id="bar_top"><strong>Ratatöskr</strong>::Noctilucent clouds (v. 0.1 β 5)</div> <div class="vcenter_outer"><div class="vcenter_inner"> <div id="login_box"> <h1><ste:get_translation for="login_form_header" /></h1> 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 @@ </head> <body> <div id="bar_top"> - <span class="branding"><strong>Ratatöskr</strong>::Noctilucent clouds (v. 0.1 β 4)</span> + <span class="branding"><strong>Ratatöskr</strong>::Noctilucent clouds (v. 0.1 β 5)</span> <span class="user"> <a href="$rel_path_to_root/backend/admin/users/u/$user[id]">$user[name]</a> | <a href="$rel_path_to_root/backend/logout"><ste:get_translation for="logout" /></a> </span> |