Maldicore / Admin

CakePHP Plugin for automagic admin using Twitter Bootstrap for CakePHP 2.x
52 stars 34 forks source link

Table for model was not found in datasource default. #7

Open sk-zk opened 11 years ago

sk-zk commented 11 years ago

After installing the plugin and going to /admin, I get the following error message:

Error: Table for model was not found in datasource default.

Stack Trace

CORE\Cake\Model\Model.php line 3231 → Model->setSource(string)
APP\Plugin\Admin\Config\bootstrap.php line 65 → Model->getDataSource()
CORE\Cake\Core\CakePlugin.php line 249 → include(string)
CORE\Cake\Core\CakePlugin.php line 169 → CakePlugin::_includeFile(string, boolean)
CORE\Cake\Core\CakePlugin.php line 101 → CakePlugin::bootstrap(string)
APP\Config\bootstrap.php line 74 → CakePlugin::load(string, array)
CORE\Cake\Core\Configure.php line 93 → include(string)
CORE\Cake\bootstrap.php line 164 → Configure::bootstrap(boolean)
APP\webroot\index.php line 91 → include(string)

What exactly am I doing wrong?

EDIT: I used the following line

CakePlugin::load('Admin' ,array('bootstrap' => true));

in bootstrap.php, like you told me. If I change it to this

CakePlugin::load('Admin');

it works.

bigmike7801 commented 11 years ago

I'm getting a simialr message. For me it says:

Missing Database Table Error: Table d_s__stores for model DS_Store was not found in datasource default.

This happens even if I switch to CakePlugin::load('Admin'); as suggested above.

sk-zk commented 11 years ago

.DS_Store is the Mac version of desktop.ini, maybe this file exists in some folder and Cake or the plugin tried to do something with it?

bigmike7801 commented 11 years ago

Yeah I was kind of thinking the same thing, but still find it kind of odd that it would do that.

yusuf commented 11 years ago

If you look at the plugin code /Pluign/Admin/Controller/AdminAppController.php

line 121, plugin actually load and loop all the files in the application App/Model folder using cakephp Folder Utility

I have limited the files to *.php, update the plugin and let me know how it goes...

Also note you will need to load with

CakePlugin::load('Admin', array('bootstrap' => true));

So the plugin bootstrap file Plugin/Config/bootstrap.php will be loaded

Tomicapo commented 11 years ago

Hi, I'm having the same problem. I really can't see what I'm doing wrong... Checking a little I found that on /plugins/Admin/Config/bootstrap.php line: 62 the code should be:

if (isset($parts[1]) && !empty($parts[1])) {

instead of:

if (isset($parts[1])) {
Tomicapo commented 11 years ago

Also: /plugins/Admin/Controller/AdminAppController.php line: 114 should be:

$iconPath = App::pluginPath('Admin') .'webroot' . DS . 'img' . DS . 'admin_icons';

I have the plugin in another folder. This fixes it.

Tomicapo commented 11 years ago

One last thing. links to bootstrap css and responsive css are broken. I fixed all these things and got your plugin up and running! It's quite cool! Cheers!

yusuf commented 11 years ago

Can u create a pull request with those changes (for the benefit of all) :)

mostafamb commented 11 years ago

Hi Tom , i am facing the same problem , but could you explain more about"links to bootstrap css and responsive css are broken." Thanks