Ich habe ein Problem mit meinem cms; wenn ich meine Bugtracker verwenden möchten, ich diesen Fehler:Schwerwiegender Fehler: Aufruf zu undefinierter Methode Module_model :: active()
Fatal error: Call to undefined method Module_model::active() in C:\wamp\www\CI\application\controllers\Support.php on line 107 A PHP Error was encountered
Severity: Error
Message: Call to undefined method Module_model::active()
Filename: controllers/Support.php
Line Number: 107
Dies ist der Code:
public function bugtracker()
\t {
\t \t $this->load->model('CMS_model', 'CMSManager');
\t \t if($this->session->has_userdata('guid') || $this->ModuleManager->active(23) != TRUE){
\t \t \t $data['account'] = $this->AccountManager->info('guid', $this->session->userdata('guid'));
\t \t }
\t \t else{
\t \t \t $data = array();
\t \t }
\t \t $data['bugtrackers'] = $this->CMSManager->bugtrackers();
\t \t $this->layout->view('support/bugtracker', $data);
\t \t foreach($data['bugtrackers'] as $bugtracker){
\t \t \t if(isset($_POST['vote'])){
\t \t \t \t if(!$this->session->has_userdata('guid')){
\t \t \t \t \t redirect('home/');
\t \t \t \t }
\t \t \t \t else{
\t \t \t \t \t $this->CMSManager->add_vote($bugtracker->id, $bugtracker->vote_account.$data['account']->guid.'|', $bugtracker->vote + 1);
\t \t \t \t \t $this->message->alert('1', 'Vote accepté, redirection en cours...', site_url('support/bugtracker'), '3');
\t \t \t \t }
\t \t \t }
\t \t }
\t \t if(isset($_POST['post'])){
\t \t \t if(!$this->session->has_userdata('guid')){
\t \t \t \t redirect('home/');
\t \t \t }
\t \t \t else{
\t \t \t \t $title = post($this->input->post('title'));
\t \t \t \t $content = post(nl2br($this->input->post('content')));
\t \t \t \t if(empty($title) || empty($content)){
\t \t \t \t \t $this->message->alert('2', 'Champs vides.', site_url('support/bugtracker'), '3');
\t \t \t \t }
\t \t \t \t elseif(strlen($title) > 50 || strlen($title) < 5){
\t \t \t \t \t $this->message->alert('2', 'La longueur de votre titre est incorrect.', site_url('support/bugtracker'), '3');
\t \t \t \t }
\t \t \t \t elseif(strlen($content) < 10){
\t \t \t \t \t $this->message->alert('2', 'La longueur de votre report est incorrect.', site_url('support/bugtracker'), '3');
\t \t \t \t }
\t \t \t \t else{
\t \t \t \t \t $this->CMSManager->add_bug($data['account']->guid, $title, $data['account']->guid.'|', $content);
\t \t \t \t \t $this->message->alert('1', 'Bug publié, redirection en cours...', site_url('support/bugtracker'), '3');
\t \t \t \t }
\t \t \t }
\t \t }
\t }
Wie kann ich diesen Fehler beheben?
Es ist ein kompliziertes Problem, Sie haben wahrscheinlich Code vererbt und Sie wissen nicht genau, wo Sie sind. Ich sehe keinen Aufruf der statischen Methode: 'Module_model :: active()', welche Zeile die Zeilennummer ist. 107? Vielleicht 'if ($ this-> session-> has_userdata ('guid') || $ this-> ModuleManager-> aktiv (23)! = TRUE) {'? Entfernen von statischen von Funktion ist auch nicht die Lösung, hatte früher Software-Hersteller Absichten, die Sie erforschen sollten. Versuchen Sie, der Frage weitere Details hinzuzufügen. – cssBlaster21895