waifung0207 / ci_bootstrap_3

A multi-tenant website template based on CodeIgniter 3 with integration of some useful tools
MIT License
385 stars 316 forks source link

No respect to config db['dbprefix'] #121

Closed arabiancoder closed 7 years ago

arabiancoder commented 7 years ago

The db['dbprefix'] in config.php is ignored. I wonder if this is an issue in [third_party] Grocery_crud_model.php!

arabiancoder commented 7 years ago

To fix this issue I did the followed 3 steps Edit file application/third_party/grocery_crud/models/Grocery_crud_model.php

LINE 202 Change this $this->table_name = $table_name; To $this->table_name = $this->db->dbprefix($table_name); // To fix dbPrefix added $this->db->dbprefix()

LINE 111 After this list($field_name, $relation_table, $selection_table, $primary_key_alias_to_this_table, $primary_key_alias_to_selection_table, $title_field_selection_table, $priority_field_relation_table) = array_values((array)$relation_n_n); Add these two lines
$selection_table=$this->db->dbprefix($selection_table); // line added to fix dbPrefix $relation_table=$this->db->dbprefix($relation_table); // line added to fix dbPrefix

LINE 53 Change this $select = "{$this->table_name}."; To $select = "{$this->table_name}."; // To fix dbPrefix removed "`"