euromark 13 年 前
コミット
9d47914279

+ 2 - 3
Console/Command/UserShell.php

@@ -92,9 +92,8 @@ class UserShell extends AppShell {
 		if (!empty($schema['status']) && method_exists('User', 'statuses')) {
 			$statuses = User::statuses();
 			$this->out(print_r($statuses, true));
-			while (empty($status)) {
-				$status = $this->in(__('Please insert a status'), array_keys($statuses));
-			}
+			$status = $this->in(__('Please insert a status'), array_keys($statuses));
+
 			$data['User']['status'] = $status;
 		}
 

+ 7 - 0
Model/Behavior/ResetBehavior.php

@@ -16,6 +16,13 @@ App::uses('ModelBehavior', 'Model');
  * If you have time-sensitive data, you can modify the limit of records per loop as well as the
  * timeout in between each loop.
  *
+ * It is recommended to attach this behavior dynamically where needed:
+ *
+ *    $this->Model->Behaviors->load('Tools.Reset', array(...));
+ *    $this->Model->resetRecords();
+ *
+ * For tables with lots of records you might want to use a shell and the CLI to invoke the reset/update process.
+ *
  * @author Mark Scherer
  * @license MIT
  * @cakephp 2.x

+ 1 - 1
View/Helper/TreeHelper.php

@@ -512,7 +512,7 @@ class TreeHelper extends AppHelper {
 				$subTree[$model]['show'] = 1;
 				$siblingIsActive = true;
 			}
-			if (!empty($subTree[$model]['show'])) { //!empty($subTree[$model]['parent_show']
+			if (!empty($subTree[$model]['show'])) {
 				foreach ($subTree['children'] as &$v) {
 					$v[$model]['parent_show'] = 1;
 				}