<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1513,7 +1513,6 @@ class Model extends Overloadable {
 						case 'belongsTo':
 							if ($this-&gt;__save($this-&gt;{$association}, $values, $options)) {
 								$data[$this-&gt;alias][$this-&gt;belongsTo[$association]['foreignKey']] = $this-&gt;{$association}-&gt;id;
-								unset($data[$association]);
 							} else {
 								$validationErrors[$association] = $this-&gt;{$association}-&gt;validationErrors;
 								$validates = false;</diff>
      <filename>libs/model/model.php</filename>
    </modified>
    <modified>
      <diff>@@ -567,15 +567,26 @@ class Helper extends Overloadable {
 
 		$result = null;
 
-		if (isset($this-&gt;data[$this-&gt;model()][$this-&gt;field()])) {
-			$result = $this-&gt;data[$this-&gt;model()][$this-&gt;field()];
-		} elseif (isset($this-&gt;data[$this-&gt;field()]) &amp;&amp; is_array($this-&gt;data[$this-&gt;field()])) {
-			if (ClassRegistry::isKeySet($this-&gt;field())) {
-				$model =&amp; ClassRegistry::getObject($this-&gt;field());
-				$result = $this-&gt;__selectedArray($this-&gt;data[$this-&gt;field()], $model-&gt;primaryKey);
+		$modelName = $this-&gt;model();
+		$fieldName = $this-&gt;field();
+		$modelID = $this-&gt;modelID();
+
+		if (is_null($fieldName)) {
+			$fieldName = $modelName;
+			$modelName = null;
+		}
+
+		if (isset($this-&gt;data[$fieldName]) &amp;&amp; $modelName === null) {
+			$result = $this-&gt;data[$fieldName];
+		} elseif (isset($this-&gt;data[$modelName][$fieldName])) {
+			$result = $this-&gt;data[$modelName][$fieldName];
+		} elseif (isset($this-&gt;data[$fieldName]) &amp;&amp; is_array($this-&gt;data[$fieldName])) {
+			if (ClassRegistry::isKeySet($fieldName)) {
+				$model =&amp; ClassRegistry::getObject($fieldName);
+				$result = $this-&gt;__selectedArray($this-&gt;data[$fieldName], $model-&gt;primaryKey);
 			}
-		} elseif (isset($this-&gt;data[$this-&gt;model()][$this-&gt;modelID()][$this-&gt;field()])) {
-			$result = $this-&gt;data[$this-&gt;model()][$this-&gt;modelID()][$this-&gt;field()];
+		} elseif (isset($this-&gt;data[$modelName][$modelID][$fieldName])) {
+			$result = $this-&gt;data[$modelName][$modelID][$fieldName];
 		}
 
 		if (is_array($result)) {</diff>
      <filename>libs/view/helper.php</filename>
    </modified>
    <modified>
      <diff>@@ -651,6 +651,9 @@ class AuthTest extends CakeTestCase {
 
 		$this-&gt;Controller-&gt;params['action'] = 'add';
 		$this-&gt;assertFalse($this-&gt;Controller-&gt;Auth-&gt;startup($this-&gt;Controller));
+
+		$this-&gt;Controller-&gt;params['action'] = 'Add';
+		$this-&gt;assertFalse($this-&gt;Controller-&gt;Auth-&gt;startup($this-&gt;Controller));
 	}
 /**
  * testLoginRedirect method
@@ -962,6 +965,25 @@ class AuthTest extends CakeTestCase {
 		$this-&gt;Controller-&gt;Auth-&gt;startup($this-&gt;Controller);
 		$user = $this-&gt;Controller-&gt;Auth-&gt;user();
 		$this-&gt;assertTrue(!!$user);
+		
+		$this-&gt;Controller-&gt;Session-&gt;del('Auth');
+		Router::reload();
+		Router::connect('/', array('controller' =&gt; 'people', 'action' =&gt; 'login'));
+		$url = '/';
+		$this-&gt;Controller-&gt;params = Router::parse($url);
+		Router::setRequestInfo(array($this-&gt;Controller-&gt;passedArgs, array(
+			'base' =&gt; null, 'here' =&gt; $url, 'webroot' =&gt; '/', 'passedArgs' =&gt; array(),
+			'argSeparator' =&gt; ':', 'namedArgs' =&gt; array()
+		)));
+		$this-&gt;Controller-&gt;data['AuthUser'] = array('username' =&gt; 'felix', 'password' =&gt; 'cake');
+		$this-&gt;Controller-&gt;params['url']['url'] = substr($url, 1);
+		$this-&gt;Controller-&gt;Auth-&gt;initialize($this-&gt;Controller);
+		$this-&gt;Controller-&gt;Auth-&gt;loginAction = array('controller' =&gt; 'people', 'action' =&gt; 'login');
+		$this-&gt;Controller-&gt;Auth-&gt;userModel = 'AuthUser';
+
+		$this-&gt;Controller-&gt;Auth-&gt;startup($this-&gt;Controller);
+		$user = $this-&gt;Controller-&gt;Auth-&gt;user();
+		$this-&gt;assertTrue(!!$user);
 	}
 /**
  * testAdminRoute method</diff>
      <filename>tests/cases/libs/controller/components/auth.test.php</filename>
    </modified>
    <modified>
      <diff>@@ -339,6 +339,25 @@ class NumberTreeCase extends CakeTestCase {
 		$this-&gt;assertIdentical($validTree, true);
 	}
 /**
+ * testAddNotIndexedByModel method
+ *
+ * @access public
+ * @return void
+ */
+	function testAddNotIndexedByModel() {
+		extract($this-&gt;settings);
+		$this-&gt;Tree =&amp; new $modelClass();
+		$this-&gt;Tree-&gt;initialize(2, 2);
+
+		$this-&gt;Tree-&gt;save(array('name' =&gt; 'testAddNotIndexed', $parentField =&gt; null));
+		$result = $this-&gt;Tree-&gt;find(null, array('name', $parentField), $modelClass . '.' . $leftField . ' desc');
+		$expected = array($modelClass =&gt; array('name' =&gt; 'testAddNotIndexed', $parentField =&gt; null));
+		$this-&gt;assertEqual($result, $expected);
+
+		$validTree = $this-&gt;Tree-&gt;verify();
+		$this-&gt;assertIdentical($validTree, true);
+}
+/**
  * testMovePromote method
  *
  * @access public</diff>
      <filename>tests/cases/libs/model/behaviors/tree.test.php</filename>
    </modified>
    <modified>
      <diff>@@ -3741,6 +3741,25 @@ class ModelTest extends CakeTestCase {
 		$this-&gt;assertIdentical(count($result), 1);
 		$result = Set::extract('/Comment/article_id', $result);
 		$this-&gt;assertTrue($result[0] === 1 || $result[0] === '1');
+
+
+		$model-&gt;deleteAll(true);
+		$data = array(
+			'Article' =&gt; array(
+				'title' =&gt; 'Post with Author saveAlled from comment', 
+				'body' =&gt; 'This post will be saved with an author', 
+				'user_id' =&gt; 2
+			),
+			'Comment' =&gt; array(
+				'comment' =&gt; 'Only new comment', 'user_id' =&gt; 2
+			)
+		);
+		$result = $model-&gt;Comment-&gt;saveAll($data, array('validate' =&gt; 'first'));
+		$this-&gt;assertTrue($result);
+	
+		$result = $model-&gt;find('all');
+		$this-&gt;assertEqual($result[0]['Article']['title'], 'Post with Author saveAlled from comment');
+		$this-&gt;assertEqual($result[0]['Comment'][0]['comment'], 'Only new comment');
 	}
 /**
  * testSaveWithCounterCache method</diff>
      <filename>tests/cases/libs/model/model.test.php</filename>
    </modified>
    <modified>
      <diff>@@ -317,6 +317,37 @@ class HelperTest extends CakeTestCase {
 		$this-&gt;assertEqual($this-&gt;View-&gt;fieldSuffix, null);
 	}
 /**
+ * test getting values from Helper
+ *
+ * @return void
+ **/
+	function testValue() {
+		$this-&gt;Helper-&gt;data = array('fullname' =&gt; 'This is me');
+		$this-&gt;Helper-&gt;setEntity('fullname');
+		$result = $this-&gt;Helper-&gt;value('fullname');
+		$this-&gt;assertEqual($result, 'This is me');
+
+		$this-&gt;Helper-&gt;data = array('Post' =&gt; array('name' =&gt; 'First Post'));
+		$this-&gt;Helper-&gt;setEntity('Post.name');
+		$result = $this-&gt;Helper-&gt;value('Post.name');
+		$this-&gt;assertEqual($result, 'First Post');
+
+		$this-&gt;Helper-&gt;data = array('Post' =&gt; array(2 =&gt; array('name' =&gt; 'First Post')));
+		$this-&gt;Helper-&gt;setEntity('Post.2.name');
+		$result = $this-&gt;Helper-&gt;value('Post.2.name');
+		$this-&gt;assertEqual($result, 'First Post');
+
+		$this-&gt;Helper-&gt;data = array('Post' =&gt; array(2 =&gt; array('created' =&gt; array('year' =&gt; '2008'))));
+		$this-&gt;Helper-&gt;setEntity('Post.2.created');
+		$result = $this-&gt;Helper-&gt;value('Post.2.created');
+		$this-&gt;assertEqual($result, array('year' =&gt; '2008'));
+
+		$this-&gt;Helper-&gt;data = array('Post' =&gt; array(2 =&gt; array('created' =&gt; array('year' =&gt; '2008'))));
+		$this-&gt;Helper-&gt;setEntity('Post.2.created.year');
+		$result = $this-&gt;Helper-&gt;value('Post.2.created.year');
+		$this-&gt;assertEqual($result, '2008');
+	}
+/**
  * testFieldsWithSameName method
  *
  * @access public</diff>
      <filename>tests/cases/libs/view/helper.test.php</filename>
    </modified>
    <modified>
      <diff>@@ -614,7 +614,7 @@ class FormHelperTest extends CakeTestCase {
 			'minutesRegex' =&gt; 'preg:/(?:&lt;option value=&quot;([\d]+)&quot;&gt;0?\\1&lt;\/option&gt;[\r\n]*)*/',
 			'meridianRegex' =&gt; 'preg:/(?:&lt;option value=&quot;(am|pm)&quot;&gt;\\1&lt;\/option&gt;[\r\n]*)*/',
 		);
-		
+
 		Configure::write('Security.salt', 'foo!');
 	}
 /**
@@ -1558,7 +1558,7 @@ class FormHelperTest extends CakeTestCase {
 		$this-&gt;assertNoPattern('#&lt;option value=&quot;12&quot;[^&gt;]*&gt;12&lt;/option&gt;#', $result[1]);
 		$this-&gt;assertNoPattern('#&lt;option value=&quot;50&quot;[^&gt;]*&gt;50&lt;/option&gt;#', $result[1]);
 		$this-&gt;assertPattern('#&lt;option value=&quot;15&quot;[^&gt;]*&gt;15&lt;/option&gt;#', $result[1]);
-		
+
 		$result = $this-&gt;Form-&gt;input('prueba', array(
 			'type' =&gt; 'time', 'timeFormat'=&gt; 24 , 'dateFormat'=&gt;'DMY' , 'minYear' =&gt; 2008,
 			'maxYear' =&gt; date('Y') + 1 ,'interval' =&gt; 15
@@ -1568,7 +1568,7 @@ class FormHelperTest extends CakeTestCase {
 		$this-&gt;assertNoPattern('#&lt;option value=&quot;50&quot;[^&gt;]*&gt;50&lt;/option&gt;#', $result[1]);
 		$this-&gt;assertPattern('#&lt;option value=&quot;15&quot;[^&gt;]*&gt;15&lt;/option&gt;#', $result[1]);
 		$this-&gt;assertPattern('#&lt;option value=&quot;30&quot;[^&gt;]*&gt;30&lt;/option&gt;#', $result[1]);
-		
+
 		$result = $this-&gt;Form-&gt;input('prueba', array(
 			'type' =&gt; 'datetime', 'timeFormat'=&gt; 24 , 'dateFormat'=&gt;'DMY' , 'minYear' =&gt; 2008,
 			'maxYear' =&gt; date('Y') + 1 ,'interval' =&gt; 15
@@ -4181,6 +4181,15 @@ class FormHelperTest extends CakeTestCase {
 			'/textarea',
 		);
 		$this-&gt;assertTags($result, $expected);
+
+		$this-&gt;Form-&gt;data = array('Model' =&gt; array('field' =&gt; 'some &lt;strong&gt;test&lt;/strong&gt; data with &lt;a href=&quot;#&quot;&gt;HTML&lt;/a&gt; chars'));
+		$result = $this-&gt;Form-&gt;textarea('Model.field', array('escape' =&gt; false));
+		$expected = array(
+			'textarea' =&gt; array('name' =&gt; 'data[Model][field]', 'id' =&gt; 'ModelField'),
+			'some &lt;strong&gt;test&lt;/strong&gt; data with &lt;a href=&quot;#&quot;&gt;HTML&lt;/a&gt; chars',
+			'/textarea',
+		);
+		$this-&gt;assertTags($result, $expected);
 	}
 /**
  * testTextAreaWithStupidCharacters method</diff>
      <filename>tests/cases/libs/view/helpers/form.test.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d4d865d765b7580b1f905302074ccdeab5f36757</id>
    </parent>
    <parent>
      <id>b1196f8d2eda838d2d93ee91a609a376c5a0d773</id>
    </parent>
  </parents>
  <author>
    <name>Joel Moss</name>
    <email>joel@developwithstyle.com</email>
  </author>
  <url>http://github.com/joelmoss/cakephp/commit/8abb58ee7aec6c9edd35b7e37927e0b7a67f84e0</url>
  <id>8abb58ee7aec6c9edd35b7e37927e0b7a67f84e0</id>
  <committed-date>2009-01-27T01:39:14-08:00</committed-date>
  <authored-date>2009-01-27T01:39:14-08:00</authored-date>
  <message>Merge branch 'master' into pimped</message>
  <tree>36498bd93106e9663cce810c9448831a89d5df4f</tree>
  <committer>
    <name>Joel Moss</name>
    <email>joel@developwithstyle.com</email>
  </committer>
</commit>
