gabordemooij / redbean

ORM layer that creates models, config and database on the fly
https://www.redbeanphp.com
2.31k stars 280 forks source link

R::loadJoined() on null value #900

Closed marios88 closed 2 years ago

marios88 commented 2 years ago

PHP 8.1.7 RB 5.7.2

$user->company_id is NULL

$user = \R::load('user', 1);
\R::loadJoined([$user], 'company');

Throws on https://github.com/gabordemooij/redbean/blob/0a599233f3c5a11b67afc17ca5601a334378554e/RedBeanPHP/Finder.php#L554

ErrorException Undefined array key

Not sure where the problem originates

gabordemooij commented 2 years ago

It looks like in previous versions of PHP this triggered a warning. Anyway it was just returning null for those properties anyway.

gabordemooij commented 2 years ago

Should be fixed now!