0

I'm learning agile toolkit by following the jobeet tutorial, but the schema generator doesn't work. It throws the following error:

Error in AJAX response: SyntaxError: Unexpected token <

Fatal error: Call to a member function getAllHash() on a non-object in
C:\@Documentos\Personales\CODING\xampp\htdocs\zordon\atk4-addons\mvc\Page\SchemaGenerator.php
on line 77

By the way $this->add('jUI'); is already included in the frontend api, and the model is very simple:

class Model_Group extends Model_Table {
    public $entity_code = 'group';
    function init(){
        parent::init();

        $this->addField('group_id');
        $this->addField('name');
        $this->addField('post_count');

        $this->addField('created_dts')->type('timestamp')->system(true);
        $this->addField('updated_dts')->type('timestamp')->system(true);
        $this->addField('expires_at')->type('date')->system(true);
    }   
}
roco3d
  • 3
  • 2
  • I managed to solve it. The solution is uncomment line //$this->dbConnect(); in frontend api. – roco3d Jan 21 '14 at 12:53

1 Answers1

0

You do not have working DB connection ($this->api->db) in line 77 in SchemaGenerator. Check your DB connection: $this->dbConnect() in Frontent and database configuration in config.php.

Also please note, that using SchemaGenerators is quite evil thing to do, but if you really want to use one, then better use up-to-date one: atk4-addons/dynamic_model/Controller_AutoCreator_MySQL

DarkSide
  • 3,670
  • 1
  • 26
  • 34