Closed Hitman0505 closed 12 years ago
Wheres your login page at? Did you set that up?
I've got a User Model and Controller already in my App and in there I've got the login page...
/*****/
public function login() { if ($this->request->is('post')) { $this->User->set($this->request->data); if ($this->User->validates() && $this->Auth->login()) { if ($user = $this->Auth->user()) { $this->User->Profile->login($user['id']); $this->Session->delete('Forum'); $this->redirect($this->Auth->redirect()); } } else { $this->Session->setFlash(__('Ungueltiger Benutzername oder Passwort, bitte versuche es erneut!')); } $this->request->data['User']['password'] = ''; } }
/*****/
Is that okay?
So is that error appearing on the forum index?
Also, what forum version are you using?
It doesn't appear on the index. I can load the login page and enter my user data and after I submit I get the error. And on every other Page a login is required.
I'm using the forum version 3.1.1 .
You sure its 3.1.1? ForumExceptionRenderer wasn't added until 3.2.0.
Can you check your error logs? Something else should be throwing an exception outside of the forum.
Oh sry , you are right, i got 3.2.0.
The Utility plgin coudn't be loaded right, but thats ok now. I had to change folder name to 'Utility' and load it. Now i can log in and go to the index page of the forum but i have new error's
On top of the page: */-------------------------------------------------------------------------------------------- Strict (2048): Declaration of Setting::update() should be compatible with ForumAppModel::update($id, $data) [APP\Plugin\forum\Model\Setting.php, line 13]
Notice (8): Undefined index: password [APP\Plugin\forum\Controller\ForumAppController.php, line 112]
Strict (2048): Declaration of Topic::beforeSave() should be compatible with Model::beforeSave($options = Array) [APP\Plugin\forum\Model\Topic.php, line 495]
Strict (2048): Declaration of Post::beforeSave() should be compatible with Model::beforeSave($options = Array) [APP\Plugin\forum\Model\Post.php, line 277]
Notice (8): Undefined index: password [APP\Plugin\forum\Controller\ForumAppController.php, line 112] */--------------------------------------------------------------------------------------------
In the middle of the page:
*/-------------------------------------------------------------------------------------------- Missing Plugin
Error: The application is trying to load a file from the Users plugin
Error: Make sure your plugin Users is in the app\Plugin directory and was loaded
<?php CakePlugin::load('Users');
Loading all plugins: If you wish to load all plugins at once, use the following line in your app\Config\bootstrap.php file
CakePlugin::loadAll();
Notice: If you want to customize this error message, create app\View\Errors\missing_plugin.ctp Stack Trace CORE\Cake\Core\App.php line 364 → CakePlugin::path(string) CORE\Cake\Core\App.php line 225 → App::pluginPath(string) CORE\Cake\Core\App.php line 542 → App::path(string, string) [internal function] → App::load(string) [internal function] → spl_autoload_call(string) CORE\Cake\Utility\ClassRegistry.php line 136 → class_exists(string) CORE\Cake\Model\Model.php line 1016 → ClassRegistry::init(array) CORE\Cake\Model\Model.php line 842 → Model->_constructLinkedModel(string, string, string) CORE\Cake\Model\Behavior\ContainableBehavior.php line 337 → Model->__isset(string) CORE\Cake\Model\Behavior\ContainableBehavior.php line 344 → ContainableBehavior->containments(Forum, array, array) CORE\Cake\Model\Behavior\ContainableBehavior.php line 120 → ContainableBehavior->containments(Forum, array) [internal function] → ContainableBehavior->beforeFind(Forum, array) CORE\Cake\Utility\ObjectCollection.php line 130 → call_user_func_array(array, array) [internal function] → ObjectCollection->trigger(CakeEvent) CORE\Cake\Event\CakeEventManager.php line 246 → call_user_func(array, CakeEvent) CORE\Cake\Model\Model.php line 2685 → CakeEventManager->dispatch(CakeEvent) CORE\Cake\Model\Model.php line 2625 → Model->buildQuery(string, array) APP\Plugin\forum\Model\Forum.php line 325 → Model->find(string, array) APP\Plugin\forum\Controller\ForumController.php line 51 → Forum->getIndex() [internal function] → ForumController->index() CORE\Cake\Controller\Controller.php line 485 → ReflectionMethod->invokeArgs(ForumController, array) CORE\Cake\Routing\Dispatcher.php line 186 → Controller->invokeAction(CakeRequest) CORE\Cake\Routing\Dispatcher.php line 161 → Dispatcher->_invoke(ForumController, CakeRequest, CakeResponse) APP\webroot\index.php line 92 → Dispatcher->dispatch(CakeRequest, CakeResponse)
*/--------------------------------------------------------------------------------------------
The Plugin userers does not exist because the UsersController is fully integrated in my app. Is there a way that the Forum does not need a plugin and uses the normal app?
EDIT :
Ok I managed the second part by setting
define('FORUM_USER', 'Users.User');
to
define('FORUM_USER', 'User');
but i'am still getting these error's on top of the forum index */-------------------------------------------------------------------------------------------- Strict (2048): Declaration of Setting::update() should be compatible with ForumAppModel::update($id, $data) [APP\Plugin\forum\Model\Setting.php, line 13]
Strict (2048): Declaration of Topic::beforeSave() should be compatible with Model::beforeSave($options = Array) [APP\Plugin\forum\Model\Topic.php, line 495]
Strict (2048): Declaration of Post::beforeSave() should be compatible with Model::beforeSave($options = Array) [APP\Plugin\forum\Model\Post.php, line 277] */--------------------------------------------------------------------------------------------
And i have a question for better understanding, if i delete the "FORUM_USER" constant the utility plugin is getting errors in my controllers but the forum works fine, why?
/**/
/**/
/**/ EDIT 2:
I've got it up and running without errors now! For the errors of the first edit I added " = array()" to the beforeSave function in the named files so that it looks like this:
/_/ public function beforeSave($options = array()) { /_/
and in the setting Model I added the $id as it looks like it is supposed to: /_/ public function update($id,$data) { /_/
Thanks for your help anyways! I really appreciate your work as it is a great Forum plugin and it really saved me a lot of time!
Best Regards!
It looks you have STRICT error reporting on. I could easily fix those, but I swear I have that enabled also.
Whats your PHP version and error settings?
My PHP Version is 5.4.7.
My Debug Level is 2: Configure::write('debug', 2);
And the Error handler looks like this:
Configure::write('Error', array(
'handler' => 'ErrorHandler::handleError',
'level' => E_ALL & ~E_DEPRECATED,
'trace' => true
));
That were the default Cake settings... Are there any additional error settings?
Done!
Hey, I downloaded and set up Cake-Forum like described in the documentation. After I want to login my application I get this Fatal Error:
( ! ) Fatal error: Class 'ForumAppController' not found in C:\xampp\htdocs\cake\app\Plugin\forum\Error\ForumExceptionRenderer.php on line 23
Do you have any idea what I'm doing wrong? Thanks!