Skip to content

Commit

Permalink
Bugfix for the getTranslationAttribute method
Browse files Browse the repository at this point in the history
  • Loading branch information
Egemen Berker Kızılcan committed Jan 10, 2016
1 parent d6d4b1d commit 9ffca5d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"laravel",
"laravel5"
],
"version": "1.1.17",
"version": "1.1.18",
"authors": [
{
"name": "Hyleeh",
Expand Down
4 changes: 3 additions & 1 deletion src/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ public function getTranslationAttribute($key, $locale = null, $fallback = true)
{
$locale = $locale ?: $this->locale();

$attribute = $this->translate($locale)->$key;
$translation = $this->translate($locale);

$attribute = ($translation) ? $translation->$key : null;

if (empty($attribute) && $fallback)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/HierarchyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class HierarchyServiceProvider extends ServiceProvider {

const version = '1.1.17';
const version = '1.1.18';

/**
* Register the service provider.
Expand Down

0 comments on commit 9ffca5d

Please sign in to comment.