Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch '1.3' into 1.3-misc

  • Loading branch information...
commit c5a41913c37c12aaacca8f4d5348785aaf843fc9 2 parents f5cfab7 + db526dd
@markstory markstory authored
View
2  app/config/bootstrap.php
@@ -29,7 +29,7 @@
* 'plugins' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'),
* 'models' => array('/full/path/to/models/', '/next/full/path/to/models/'),
* 'views' => array('/full/path/to/views/', '/next/full/path/to/views/'),
- * 'controllers' => array(/full/path/to/controllers/', '/next/full/path/to/controllers/'),
+ * 'controllers' => array('/full/path/to/controllers/', '/next/full/path/to/controllers/'),
* 'datasources' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'),
* 'behaviors' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'),
* 'components' => array('/full/path/to/components/', '/next/full/path/to/components/'),
View
0  app/tmp/cache/views/empty
No changes.
View
4 cake/console/libs/tasks/model.php
@@ -80,6 +80,8 @@ class ModelTask extends Shell {
* @access public
*/
function execute() {
+ App::import('Model', 'Model', false);
+
if (empty($this->args)) {
$this->__interactive();
}
@@ -165,8 +167,6 @@ function inOptions($options, $prompt = null, $default = null) {
* @access private
*/
function __interactive() {
- App::import('Model', 'Model', false);
-
$this->hr();
$this->out(sprintf("Bake Model\nPath: %s", $this->path));
$this->hr();
View
2  cake/console/libs/tasks/project.php
@@ -236,7 +236,7 @@ function corePath($path) {
$File =& new File($path . 'webroot' . DS . 'test.php');
$contents = $File->read();
if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
- $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', ". (strpos(CAKE_CORE_INCLUDE_PATH, '/')===0? " DS . '":"'") . str_replace('/', '\' . DS . \'', trim(CAKE_CORE_INCLUDE_PATH, '/')) . "');", $contents);
+ $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', " . $root . str_replace(DS, "' . DS . '", trim(CAKE_CORE_INCLUDE_PATH, DS)) . "');", $contents);
if (!$File->write($result)) {
return false;
}
View
4 cake/libs/view/helper.php
@@ -646,7 +646,9 @@ function value($options = array(), $field = null, $key = 'value') {
}
$habtmKey = $this->field();
- if (empty($result) && isset($this->data[$habtmKey]) && is_array($this->data[$habtmKey])) {
+ if (empty($result) && isset($this->data[$habtmKey][$habtmKey])) {
+ $result = $this->data[$habtmKey][$habtmKey];
+ } elseif (empty($result) && isset($this->data[$habtmKey]) && is_array($this->data[$habtmKey])) {
if (ClassRegistry::isKeySet($habtmKey)) {
$model =& ClassRegistry::getObject($habtmKey);
$result = $this->__selectedArray($this->data[$habtmKey], $model->primaryKey);
View
4 cake/tests/cases/console/libs/tasks/project.test.php
@@ -144,6 +144,10 @@ function testIndexPhpGeneration() {
$file =& new File($path . 'webroot' . DS . 'index.php');
$contents = $file->read();
$this->assertNoPattern('/define\(\'CAKE_CORE_INCLUDE_PATH\', \'ROOT/', $contents);
+
+ $file =& new File($path . 'webroot' . DS . 'test.php');
+ $contents = $file->read();
+ $this->assertNoPattern('/define\(\'CAKE_CORE_INCLUDE_PATH\', \'ROOT/', $contents);
}
/**
View
20 cake/tests/cases/libs/view/helper.test.php
@@ -367,6 +367,26 @@ function testValue() {
$this->Helper->setEntity('Post.2.created.year');
$result = $this->Helper->value('Post.2.created.year');
$this->assertEqual($result, '2008');
+
+ $this->Helper->data = array('HelperTestTag' => array('HelperTestTag' => ''));
+ $this->Helper->setEntity('HelperTestTag.HelperTestTag');
+ $result = $this->Helper->value('HelperTestTag.HelperTestTag');
+ $this->assertEqual($result, '');
+
+ $this->Helper->data = array('HelperTestTag' => array('HelperTestTag' => array(2, 3, 4)));
+ $this->Helper->setEntity('HelperTestTag.HelperTestTag');
+ $result = $this->Helper->value('HelperTestTag.HelperTestTag');
+ $this->assertEqual($result, array(2, 3, 4));
+
+ $this->Helper->data = array(
+ 'HelperTestTag' => array(
+ array('id' => 3),
+ array('id' => 5)
+ )
+ );
+ $this->Helper->setEntity('HelperTestTag.HelperTestTag');
+ $result = $this->Helper->value('HelperTestTag.HelperTestTag');
+ $this->assertEqual($result, array(3 => 3, 5 => 5));
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.