Commit graph

126 commits

Author SHA1 Message Date
euromark
97c2cb367d CS fixes 2013-05-17 10:36:17 +02:00
Ceeram
842b1802d9 add assert that habtm save does not return false 2013-04-19 19:37:23 +02:00
Ceeram
8374eb92cc fix failing tests. test and mocked sources would cause exceptions 2013-03-13 22:31:23 +01:00
mark_story
33bd7a571a Restore whitelist when save fails.
Fixes whitelist not being restored when save fails due to no data.

Fixes #3646
2013-02-25 20:57:56 -05:00
Graham Weldon
66d856d883 Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
Graham Weldon
7b860debe4 This commit is dedicated to Mark Story, who has put in much dedicated time and effort into CakePHP over the years.
I just wanted to ruin his evening, because this change needs to be merged into CakePHP 3.0.
2013-02-08 20:59:49 +09:00
Ceeram
16be9d4990 remove unused local vars 2013-01-23 17:22:06 +01:00
mark_story
4bdaa2b5a0 Merge branch 'master' into 2.3 2012-12-16 13:32:38 -05:00
mark_story
1528b5c382 Don't return true when there is nothing to save.
Model::save() should not return true when no work has been done.

Fixes #3469
2012-12-16 13:19:14 -05:00
Ceeram
eadc3a75e5 fix coding standards 2012-11-21 15:39:03 +01:00
Ceeram
b18550c667 fix incorrect tests 2012-11-02 12:16:32 +01:00
Ceeram
b8607ca2ed fix fieldlist, refs PR808 and PR851
Squashed commit of the following:

commit 7007dba0eb836f852aaca95fada103bc4ba993a9
Merge: 3ca4d23 7d84486
Author: Ceeram <c33ram@gmail.com>
Date:   Fri Nov 2 10:53:39 2012 +0100

    Merge branch '2.3' into calinseciu-2.3

commit 3ca4d231bf80d2bb1c0572196f633da68c1a0db7
Author: Ceeram <c33ram@gmail.com>
Date:   Sun Sep 23 12:45:00 2012 +0200

    more tests added

commit e6b12532655671aff2b966a9be89b2625a715e8f
Author: Ceeram <c33ram@gmail.com>
Date:   Tue Sep 18 09:18:32 2012 +0200

    change methodname and visbilty

commit 70396265025190ab2fbc159911ec3e064cc44fb2
Author: Ceeram <c33ram@gmail.com>
Date:   Thu Sep 6 17:26:52 2012 +0200

    fix fieldlist, refs PR #808

commit e9db96bfe163609eeefba430d8353c822aabacb0
Merge: 99b798f adb8142
Author: Ceeram <c33ram@gmail.com>
Date:   Thu Sep 6 16:26:40 2012 +0200

    Merge branch '2.3' of git://github.com/calinseciu/cakephp into calinseciu-2.3

commit adb8142d2694692ec71a063ac2ad1b275f3a67c9
Author: calinseciu <calinseciu@gmail.com>
Date:   Thu Aug 30 17:57:50 2012 +0300

    Add foreignKey to whitelist in saveAssociated()

    Association's foreignKey doesn't get saved when saving hasMany associations since it's not in the model's whitelist after validation.
    This happens if you don't send the foreignKey with the associated records data.
2012-11-02 10:56:49 +01:00
mark_story
c24bec679b Merge branch 'master' into 2.3
Conflicts:
	lib/Cake/View/Helper/FormHelper.php
2012-10-27 21:13:53 -04:00
Ber Clausen
a7d9422c09 Test all empty array with assertSame() because assertEquals() does not check the type. 2012-10-26 19:21:51 -03:00
mark_story
c4b9fa6c7a Fix failing tests. 2012-10-24 21:00:56 -04:00
dogmatic69
641ba9f3e6 Merge branch '2.3' into type-checks
Conflicts:
	lib/Cake/Error/ExceptionRenderer.php
	lib/Cake/Routing/Dispatcher.php
2012-10-24 19:03:44 +01:00
Mark Story
746eaf9389 Merge pull request #894 from dereuromark/comp-fix-save-all
BC mod for saveAll()
2012-10-22 18:40:38 -07:00
mark_story
08556ab879 Fix saveAssociated() with validate=first, atomic=false
When using the above options & validation errors on the associated
models, saving would not be aborted.

Fixes #3285
2012-10-20 15:12:05 -04:00
euromark
1e2ac0b9c8 comp mod for saveAll()
better approach

test case to assert saveAll still behaves like previous versions
2012-10-11 14:03:59 +02:00
dogmatic69
b1f26b59a3 converting if ($foo != null) to if ($foo) 2012-09-21 23:30:43 +01:00
mark_story
7d2cbec79d Revert "Fix null not stopping model callbacks."
This reverts commit 82a8400def.

The previous change broke a number of tests as existing tests expect
that a return value of null will not stop events.
2012-09-13 22:49:17 -04:00
mark_story
82a8400def Fix null not stopping model callbacks.
Add a compatibility shim into CakeEventManager to fix `null` not
breaking model callbacks.  This was a regression created when model
callbacks were re-factored to use the event manager. This code should be
removed in 3.x as its inconsistent with events used everywhere else in
the framework.

Fixes #3123
2012-09-13 22:11:46 -04:00
mark_story
c7647b775f Attempt to fix build error in travis. 2012-09-04 17:25:02 -04:00
Jose Lorenzo Rodriguez
60eb228ddf Fixing issues with validation rules not being reset after calling
create() on the model or when calling validates() multiple times
This had interesting side effects when deep saving
2012-08-25 13:29:16 +02:00
Ceeram
cb80338c7d avoid duplication in return value when saving habtm 2012-08-24 00:50:46 +02:00
Ceeram
c5ebbc991c Revert "Merge pull request #784 from ceeram/habtmmerge"
This reverts commit fa5aa6278f, reversing
changes made to 88604ac757.
2012-08-23 16:00:41 +02:00
Ceeram
fb0053753e avoid duplication in returned results for habtm 2012-08-22 13:03:47 +02:00
mark_story
eb7b66b37c Revert default value of allowEmpty.
In 2.1, the default value was null, which does not impart any behavior.
In 2.2 this was changed to false, which makes it hard to validate ''
with validation methods.  Move some tests around and update tests that
probably should have been failing before.

Fixes #2983
2012-06-24 20:06:14 -04:00
Jose Lorenzo Rodriguez
03d31b57f7 Merge remote-tracking branch 'origin/2.1' into 2.2 2012-06-19 19:28:20 -04:30
Ceeram
cd209ce099 Avoid using LC_ALL, on some installs this would cause error:
"setlocale(): Specified locale name is too long"
2012-06-19 23:20:08 +02:00
Ceeram
0df1e90eed show all validation errors when saving/validating Associated and primary model fails validation as well, fixes #2925 2012-06-18 14:20:53 +02:00
Jose Lorenzo Rodriguez
51635c2ca6 Merge remote-tracking branch 'origin/2.1' into 2.2
Conflicts:
	lib/Cake/Model/Model.php
	lib/Cake/Test/Case/Model/ModelValidationTest.php
2012-06-06 11:06:06 -04:30
Jose Lorenzo Rodriguez
111a23274e Fixing yet another issue related to beforeValidate and
validateAssociated
2012-06-06 10:07:01 -04:30
mark_story
1c0f97ea67 Fix some minor code style issues. 2012-05-27 14:20:19 -04:00
Jose Lorenzo Rodriguez
b22c50d8b6 Merge branch '2.1' into 2.2-validator
Conflicts:
	lib/Cake/Model/Model.php
	lib/Cake/Test/Case/Model/ModelValidationTest.php
	lib/Cake/Test/Case/Model/models.php
2012-05-19 15:39:44 -04:30
Ceeram
7dbd6bc3a2 make sure model data is moved to alias, even when first key in data is assoc model
add extra tests for saveAll and validate first
ensure db values dont get reset to default values
2012-05-19 14:41:16 -04:30
Jose Lorenzo Rodriguez
307197da9e Merge branch '2.2' into 2.2-validator
Conflicts:
	lib/Cake/Model/Model.php
	lib/Cake/Test/Case/Model/ModelValidationTest.php
	lib/Cake/Test/Case/Model/ModelWriteTest.php
2012-05-10 22:19:35 -04:30
Jose Lorenzo Rodriguez
7db2b97f87 Fixing error with validateMany and validateAssociated not saving values altered in beforeValidate callbacks 2012-05-10 20:55:47 -04:30
Jose Lorenzo Rodriguez
0fb025f6dc Fixing error with validateMany and validateAssociated not saving values altered in beforeValidate callbacks 2012-05-09 23:51:27 -04:30
Jose Lorenzo Rodriguez
bf0f5ab118 Merge remote-tracking branch 'origin/2.1' into 2.2 2012-04-29 20:05:39 -04:30
Kyle Robinson Young
b8488b8dfe Update 1.x @link in docblocks 2012-04-26 19:49:18 -07:00
mark_story
46bce1a00f Merge branch '2.1' into 2.2 2012-04-26 22:27:44 -04:00
mark_story
6bb8b22cdb Fix space indented code. 2012-04-26 22:27:34 -04:00
Ceeram
ec9966ec6b Adding tests for Validator 2012-04-25 09:38:58 +02:00
Thomas Ploch
324684c14f Moving all validation logic into a new ModelValidator object. 2012-04-25 08:53:31 +02:00
Ceeram
74ee75b0ef Merge branch '2.1' into 2.2 2012-04-23 10:34:04 +02:00
Ceeram
f0bd7386e2 created, modified and updated fields now use static timestamp in testcases 2012-04-21 17:38:49 +02:00
euromark
bc2cd00123 cake 2.2 test case fixes (assert corrections, correct class names) 2012-04-21 15:02:35 +02:00
mark_story
2480ee1beb Fix coding standards. 2012-04-20 20:52:10 -04:00
mark_story
21ba5bf04a Merge branch '2.1' into 2.2 2012-04-17 21:47:24 -04:00