fuel / orm

Fuel PHP Framework - Fuel v1.x ORM
http://fuelphp.com/docs/packages/orm/intro.html
151 stars 95 forks source link

Query class error #370

Closed takahc9 closed 9 years ago

takahc9 commented 9 years ago

I updated to newest version of 1.8 develop. then fatal error comes up. there were no problem until update to new version. I think its related latest commit.(12days ago?)

Fatal error: Cannot access protected property Orm\Query::$alias in /var/www/html/xxxx/fuel/packages/orm/classes/query.php on line 347 Fatal Error - Cannot access protected property Orm\Query::$alias in PKGPATH/orm/classes/query.php on line 347

WanWizard commented 9 years ago

I assume you use PHP 5.3.x ?

WanWizard commented 9 years ago

Could you test if this solves your problem?

it-can commented 9 years ago

@WanWizard Geting this error now:

Fuel\Core\PhpErrorException [ Notice ]:
Undefined variable: self

orm/classes/query.php @ line 283
WanWizard commented 9 years ago

Hmm, that's odd, $i isn't defined either at that moment. Ah, wait, missing &... Blimey...

WanWizard commented 9 years ago

Assuming no further feedback means this is solved.

WanWizard commented 9 years ago

Not fixed: http://fuelphp.com/forums/discussion/13482#Item_1, issue is visibility in the closure, that is not by default bound to $this in PHP 5.3.x.

WanWizard commented 9 years ago

fix backported to 1.7/master in https://github.com/fuel/orm/commit/91fc9879a78ec278166964b3700c6ad86c9a33f4