ridwanskaterock / cicool

Cicool is a multifunctional application that is used to facilitate your work in creating a system, CMS, E-Comerce and others
20 stars 13 forks source link

Exception "Trying to get property of non-object" #265

Closed arsenkrylov closed 5 years ago

arsenkrylov commented 5 years ago

While opening an individual entry in one of the CRUDs, it throws an error: Exception thrown with message "Trying to get property of non-object" (see stacktrace below). I can add new CRUD and add new entries without issues. Other CRUDs are working fine too. It is just that particular one. I tried to delete it and recreate it again, but the issue is the same. I also checked the data in this particular table and it seems to be fine.

Stacktrace:

12 Exception in /Applications/XAMPP/xamppfiles/htdocs/cicool/application/core/My_Exceptions.php:62

11 My_Exceptions:show_php_error in /Applications/XAMPP/xamppfiles/htdocs/cicool/system/core/Common.php:623

10 _error_handler in /Applications/XAMPP/xamppfiles/htdocs/cicool/application/views/backend/standart/administrator/bt_tours/bt_tours_view.php:63

9 include in /Applications/XAMPP/xamppfiles/htdocs/cicool/system/core/Loader.php:968

8 CI_Loader:_ci_load in /Applications/XAMPP/xamppfiles/htdocs/cicool/system/core/Loader.php:495

7 CI_Loader:view in /Applications/XAMPP/xamppfiles/htdocs/cicool/application/core/My_Loader.php:184

6 My_Loader:view in /Applications/XAMPP/xamppfiles/htdocs/cicool/application/libraries/Template.php:751

5 Template:_load_view in /Applications/XAMPP/xamppfiles/htdocs/cicool/application/libraries/Template.php:712

4 Template:_find_view in /Applications/XAMPP/xamppfiles/htdocs/cicool/application/libraries/Template.php:224

3 Template:build in /Applications/XAMPP/xamppfiles/htdocs/cicool/application/core/My_Controller.php:478

2 Admin:render in /Applications/XAMPP/xamppfiles/htdocs/cicool/application/controllers/administrator/Bt_tours.php:282

1 Bt_tours:view in /Applications/XAMPP/xamppfiles/htdocs/cicool/system/core/CodeIgniter.php:532

0 require_once in /Applications/XAMPP/xamppfiles/htdocs/cicool/index.php:335

ridwanskaterock commented 5 years ago

can i see you model on file application/model/model_bt_tours.php thanks

arsenkrylov commented 5 years ago

Sure. Here it is:

Model_bt_tours.php.txt

ridwanskaterock commented 5 years ago

i think because same id in table

if you use this code that's will working ? line 187


    public function join_avaiable() {
        $this->db->select('bt_tours.*');
        $this->db->join('bt_tours_categories', 'bt_tours_categories.id = bt_tours.category', 'LEFT');

        return $this;
    }
arsenkrylov commented 5 years ago

Thank you for you reply. I have replace join_available function with the one you've sent but unfortunately it throws the same error.

Strange thing I noticed. I can access these individual CRUD entries by entering the url directly into a browser, but with different id. For example,

The id of the record is 4. The link in CRUD view is cicool/administrator/bt_tours/view/4 - gives an error. But if I enter cicool/administrator/bt_tours/view/2 (which does not exist) - I can open it.

Any ideas?

ridwanskaterock commented 5 years ago

Can you share for FTP access or your site, i can debug it more fast Thanks