new extension, blank page
Hello guys
I'm trying to develop my first extension, I have followed the tutorial at http://dev.typolight.org/wiki/TutorialsExtension and edited some stuff to do what I want to do
the extension link shows up in the left menu in the "content" group, under "glossary" but when I click on this link I get a blank page
nothing in the typolight system log nor in the phperror.log, and only this error 500 in the access.log
127.0.0.1 - - [14/Sep/2009:00:46:55 +0200] "GET /typolight/typolight/main.php?do=products HTTP/1.1" 500 -
any clue about how I can troubleshoot what's wrong?
Re: new extension, blank page
I've found that not all errors show up in the error log - try enabling "Display error messages" in your system settings. A blank page usually indicates it's hit a fatal error before it could output.
Re: new extension, blank page
after some investigation I found out what the mistake was ( some errors added editing the extension )
now I got the backend extension to work (partly, it just displays the records pulled from the db table I created) but when I try to add a new record I get this error
Code:
Fatal error: Uncaught exception Exception with message Query error: Unknown column 'tstamp' in 'field list' (INSERT INTO products (tstamp) VALUES (0)) thrown in D:\webservers\xampp\htdocs\typolight\system\libraries\Database.php on line 519
#0 D:\webservers\xampp\htdocs\typolight\system\drivers\DC_Table.php(567): Database_Statement->execute()
#1 D:\webservers\xampp\htdocs\typolight\system\modules\backend\Backend.php(208): DC_Table->create()
#2 D:\webservers\xampp\htdocs\typolight\typolight\main.php(99): Backend->getBackendModule('products')
#3 D:\webservers\xampp\htdocs\typolight\typolight\main.php(294): Main->run()
#4 {main}
any idea? I have no clue where that INSERT statement is created, nor about the tstamp field...
Re: new extension, blank page
It's hard to say without looking at your code. The statement would probably be executed via:
Code:
$this->Database->execute(/*in here*/)
Did you create the table 'products'?
Re: new extension, blank page
This error will be attributed to your data container having the option:
$GLOBALS['TL_DCA']['products']['config']['enableVersioning'] = True;
To have versioning enabled on a DCA there must exist a tstamp field in the database table, this field will take the mysql definition of:
`tstamp` int(10) unsigned NOT NULL default '0'
For more info on the DCA configuration please see: http://dev.typolight.org/wiki/DevelopmentConfiguration
Re: new extension, blank page
I put id, pid and tstamp fields into all tables I create within modules as a matter of course, whether they are needed or not. Typolight always wants id, sometimes pid (to store parent id), often tstamp (to store a Unix timestamp.... the number of seconds since Jan 1, 1970).
Code:
CREATE TABLE `tl_joblistings_jobs` (
`id` int(12) NOT NULL auto_increment,
`pid` int(5) unsigned zerofill NOT NULL default '00000',
`tstamp` int(10) unsigned NOT NULL default '0',
`job_category` varchar(64) NOT NULL default '',
etc