Question

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);
    }   
}
Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top