jDiction Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

jDiction 2.2.0 released. http://jdiction.org/downloads

Author Topic: Notice: Use of undefined constant parent - assumed 'parent' in jddatabase:101  (Read 21668 times)

Finarfin

  • Full Member
  • ***
  • Posts: 119
    • View Profile

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
Logged

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1688
    • View Profile

Thx for figure this out but if there is no __construct function I should not call it ;)
Logged
Joomla! 5.0 Release Manager
Vote at JED

Finarfin

  • Full Member
  • ***
  • Posts: 119
    • View Profile

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
Logged

Finarfin

  • Full Member
  • ***
  • Posts: 119
    • View Profile

Changing the one on line 88 seems to generate differents error. It seems that it didn´t enter there before
Logged

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1688
    • View Profile

schould be solve.
Logged
Joomla! 5.0 Release Manager
Vote at JED