jDiction Forum

English => General Questions => Topic started by: Finarfin on July 05, 2013, 06:21:52 pm

Title: Notice: Use of undefined constant parent - assumed 'parent' in jddatabase:101
Post by: Finarfin on July 05, 2013, 06:21:52 pm
Quote
As for the "parent" issue:

Use of undefined constant parent - assumed 'parent'
You are seeing this because you have the following code:

if (method_exists(parent, '__construct')) parent::__construct();
Which should actually be:

if (method_exists(get_parent_class($this), '__construct')) parent::__construct();

From here http://stackoverflow.com/questions/4794483/zend-framework-phpunit-path-issues
Title: Re: Notice: Use of undefined constant parent - assumed 'parent' in jddatabase:101
Post by: Harald Leithner on July 07, 2013, 08:33:08 am
Thx for figure this out but if there is no __construct function I should not call it ;)
Title: Re: Notice: Use of undefined constant parent - assumed 'parent' in jddatabase:101
Post by: Finarfin on July 07, 2013, 12:53:49 pm
Sorry, I didn´t explain properly the point :D

Arount 101 on jddatabase.php, you´ll get the error "Notice: Use of undefined constant parent - assumed 'parent' in jddatabase:101"

You have a function there that says (method_exists(parent, '__wakeup'), that generates the notice.

The example I gave you is the solution for a really similar problem, but not the same (he was calling a function called __construct, yours is __wakeup). Apart from that , is the same problem :P
Title: Re: Notice: Use of undefined constant parent - assumed 'parent' in jddatabase:101
Post by: Finarfin on July 07, 2013, 03:01:57 pm
Changing the one on line 88 seems to generate differents error. It seems that it didn´t enter there before
Title: Re: Notice: Use of undefined constant parent - assumed 'parent' in jddatabase:101
Post by: Harald Leithner on July 15, 2013, 02:37:58 pm
schould be solve.