From 76cb2fd8a2f3827472d36ff07819301dcd294642 Mon Sep 17 00:00:00 2001 From: Lynden Jones Date: Thu, 29 Oct 2015 13:46:51 -0600 Subject: [PATCH 1/4] fixes a bug where soft deletes are not being properly detected in L5. --- .../DataTable/Columns/Relationships/Relationship.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Frozennode/Administrator/DataTable/Columns/Relationships/Relationship.php b/src/Frozennode/Administrator/DataTable/Columns/Relationships/Relationship.php index a49792c4b..4ce1287f9 100644 --- a/src/Frozennode/Administrator/DataTable/Columns/Relationships/Relationship.php +++ b/src/Frozennode/Administrator/DataTable/Columns/Relationships/Relationship.php @@ -96,7 +96,7 @@ public function getRelationshipWheres($relationship, $tableAlias, $pivotAlias = //one element of the relationship query's wheres is always useless (it will say pivot_table.other_id is null) //depending on whether or not softdeletes are enabled on the other model, this will be in either position 0 //or 1 of the wheres array - array_splice($query->wheres, (isset($relationshipModel->runSoftDelete) ? 1 : 0), 1); + array_splice($query->wheres, (method_exists($relationshipModel, 'getDeletedAtColumn') ? 1 : 0), 1); //iterate over the wheres to properly alias the columns foreach ($query->wheres as &$where) From 2e239c2aad95ee9d6acb87a2f87b1c30f61d6f58 Mon Sep 17 00:00:00 2001 From: Lynden Jones Date: Thu, 29 Oct 2015 14:47:36 -0600 Subject: [PATCH 2/4] the method 'hasGetMutator' should not be called now that we are detecting soft deletes another way. --- tests/DataTable/Columns/Relationships/RelationshipTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DataTable/Columns/Relationships/RelationshipTest.php b/tests/DataTable/Columns/Relationships/RelationshipTest.php index 5de4d7104..51f74753a 100644 --- a/tests/DataTable/Columns/Relationships/RelationshipTest.php +++ b/tests/DataTable/Columns/Relationships/RelationshipTest.php @@ -79,7 +79,7 @@ public function testGetRelationshipWheres() $eloquentQuery = m::mock('Illuminate\Database\Eloquent\Builder'); $eloquentQuery->shouldReceive('getQuery')->once()->andReturn($query); $relatedModel = m::mock('Illuminate\Database\Eloquent\Model'); - $relatedModel->shouldReceive('hasGetMutator')->once(); + $relatedModel->shouldReceive('hasGetMutator')->never(); $relationship = m::mock('Illuminate\Database\Eloquent\Relations\Relation'); $relationship->shouldReceive('getQuery')->once()->andReturn($eloquentQuery) ->shouldReceive('getRelated')->once()->andReturn($relatedModel); From e6a827432edbc4c136f08b165df96f511eb8a343 Mon Sep 17 00:00:00 2001 From: StephenAntalis Date: Wed, 4 Nov 2015 10:57:58 -0500 Subject: [PATCH 3/4] fixed boolean true bug Fixed issue where if the input field of true has already been loaded into memory (such as through a form request), it resolves as true instead of 'true' --- src/Frozennode/Administrator/Fields/Bool.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Frozennode/Administrator/Fields/Bool.php b/src/Frozennode/Administrator/Fields/Bool.php index 21c94c7dc..5d151551c 100644 --- a/src/Frozennode/Administrator/Fields/Bool.php +++ b/src/Frozennode/Administrator/Fields/Bool.php @@ -38,7 +38,7 @@ public function build() */ public function fillModel(&$model, $input) { - $model->{$this->getOption('field_name')} = $input === 'true' || $input === '1' ? 1 : 0; + $model->{$this->getOption('field_name')} = $input === 'true' || $input === '1' || $input === true ? 1 : 0; } /** From cedf5df8c94c5806b0341fefec418b086b80ae67 Mon Sep 17 00:00:00 2001 From: David Mathews Date: Thu, 5 Nov 2015 09:13:22 -0500 Subject: [PATCH 4/4] updateing to 5.0.7 --- changelog.md | 4 ++++ readme.md | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 9bf65e686..4040e137e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ ## Changelog +### 5.0.7 +- Bugfix: Fixed boolean true bug +- Bugfix: Fixes a bug where soft deletes are not being properly detected in L5 + ### 5.0.6 - Added: Support for custom domains in the admin routes - Added: Ability to access the model from withinthe column output renderer diff --git a/readme.md b/readme.md index 5fba363ad..ddd952ffd 100644 --- a/readme.md +++ b/readme.md @@ -4,7 +4,7 @@ Administrator is an administrative interface builder for [Laravel](http://larave - **Author:** Jan Hartigan - **Website:** [http://frozennode.com](http://administrator.frozennode.com/) -- **Version:** 5.0.6 +- **Version:** 5.0.7 [![Build Status](https://travis-ci.org/FrozenNode/Laravel-Administrator.png?branch=master)](https://travis-ci.org/FrozenNode/Laravel-Administrator) @@ -63,6 +63,10 @@ Administrator is released under the MIT License. See the LICENSE file for detail ## Recent Changelog +### 5.0.7 +- Bugfix: Fixed boolean true bug +- Bugfix: Fixes a bug where soft deletes are not being properly detected in L5 + ### 5.0.6 - Added: Support for custom domains in the admin routes - Added: Ability to access the model from withinthe column output renderer