[Solved] Making new module using tuto / adodblite error

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
sirber
Forum Members
Forum Members
Posts: 12
Joined: Tue Apr 24, 2012 2:41 pm
Location: Québec, Canada

[Solved] Making new module using tuto / adodblite error

Post by sirber »

Hi

I'm fellowing this tutorial to make a new module. I'm a noob in cms/modules.

In my config.php, I have: $config['dbms'] = 'mysqli';

Code: Select all

function Install() {
		/* Database */
		$oDb = $this->cms->db;
		$aTableOption = array('mysql' => 'TYPE=InnoDB');
		
		# jobs
		$oTable = NewDataDictionary($oDb);
		$sFields = "id I KEY, name C(100), description X";
		$sqlarray = $oTable->CreateTableSQL(cms_db_prefix().'module_lcmcarriere_jobs', $sFields, $aTableOption);
    $oTable->ExecuteSQLArray($sqlarray);
		
		# sequences
		$oDb->CreateSequence(cms_db_prefix().'module_lcmcarriere_jobs_seq');
		
		/* Permissions */
		$this->CreatePermission('LCMCarriere Admin', 'Manage LCMCarriere');
	}
when I try to install the module, I get:

Code: Select all

Notice: Trying to get property of non-object in /var/www/lacitemedicale.com/dev/lib/adodb_lite/adodb.inc.php on line 156 Warning: include_once(/var/www/lacitemedicale.com/dev/lib/adodb_lite/adodbSQL_drivers//_datadict.inc): failed to open stream: No such file or directory in /var/www/lacitemedicale.com/dev/lib/adodb_lite/adodb.inc.php on line 158 Warning: include_once(): Failed opening '/var/www/lacitemedicale.com/dev/lib/adodb_lite/adodbSQL_drivers//_datadict.inc' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/lacitemedicale.com/dev/lib/adodb_lite/adodb.inc.php on line 158 Fatal error: Class 'ADODB2_' not found in /var/www/lacitemedicale.com/dev/lib/adodb_lite/adodb.inc.php on line 161
I looked in adodb.inc.php. The default is "mysql".

Code: Select all

function &ADONewConnection( $dbtype = 'mysql', $modules = '' )
so maybe a non null / empty var is used.. Any idea? Thanks!
Last edited by sirber on Wed Apr 25, 2012 12:44 pm, edited 1 time in total.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1968
Joined: Mon Jan 29, 2007 4:47 pm

Re: NMaking new module using tuto / adodblite error

Post by Jo Morg »

I would venture a guess: the tutorial is pre-1.10.x, meaning it won't work like that.

For starters try:

Code: Select all

$oDb = $gCms->GetDb();
instead of:

Code: Select all

$oDb = $this->cms->db;
If by any reason you can't get an instance of the cms object
try this:

Code: Select all

$gCms = cmsms();
$oDb = $gCms->GetDb();
HTH
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
sirber
Forum Members
Forum Members
Posts: 12
Joined: Tue Apr 24, 2012 2:41 pm
Location: Québec, Canada

Re: NMaking new module using tuto / adodblite error

Post by sirber »

Code: Select all

$oDb = $gCms->GetDb();
worked. thanks!
Post Reply

Return to “Developers Discussion”