【问题标题】:CakePHP "missing table" error when table should not exist当表不应该存在时,CakePHP“丢失表”错误
【发布时间】:2013-07-19 20:59:42
【问题描述】:

我收到以下错误:

 Array (
     [0] => Missing table 'TEST_USERS'. If running from a test you may need to add 'app.TEST_USER' to the fixtures array. See output
 below for more details.
     [1] => Array
         (
             [className] => TESTUSER
             [table] => TEST_USERS
             [code] => 500
         ) 
 )

该表不存在。

该表不应该存在。

我 grep 了我的代码,发现没有对 TEST_USERS、TESTUSERS 或 TEST.USERS 的引用。

我确实有一个名为 USERS_TEST 的表。

我可以获得一些故障排除提示吗?

谢谢!

【问题讨论】:

  • 添加引发该错误的代码。它可能是一个构造错误的数组来保存,因为它似乎是 HABTM 表的命名约定。
  • JURISS_ 是表前缀吗?它是一个 habtm 连接表吗(如果是这样,名称是错误的)?请将错误的完整堆栈跟踪添加到问题中(为什么表和类名是大写的?)

标签: cakephp cakephp-1.3


【解决方案1】:

解决方案:

我变了:

var $useTable = 'TEST';

到:

var $useTable = 'test';

它成功了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-15
    • 1970-01-01
    • 2016-12-18
    • 1970-01-01
    • 2012-06-29
    • 1970-01-01
    • 2017-02-20
    • 2014-08-22
    相关资源
    最近更新 更多