2007年12月29日星期六

cakephp, bake.php 1.x遗留的bug

cakephp, bake.php 1.x遗留的bug
cakephp在bake的时候, name总是空的, 如下:
Name:
Type: integer
---------------------------------------------------------------
Please select one of the following validation options:
---------------------------------------------------------------
1- VALID_NOT_EMPTY
2- VALID_EMAIL
3- VALID_NUMBER
4- VALID_YEAR
5- Do not do any validation on this field.

以mysql为例, 问题出在dbo_mysql.php describe table时, 漏掉了column的name.

更改如下:

File: dbo_mysql.php

line: 179

change: $fields[$column[0]['Field']] = array(

to: $fields[$column[0]['Field']] = array('name'=>$column[0]['Field'],


其他的数据库类似.

以前搞过, 搞了很长时间. 今天又遇到, 不写笔记很容易忘掉问题在哪, 还好今天花了不长时间.

立此存照, 也希望cakephp项目组别只顾着2.x的开发, 至少应该把以前版本的这么明显的 bug 补好.

没有评论: