Skip to content
Snippets Groups Projects
Commit 93a34c43 authored by Jared Hancock's avatar Jared Hancock
Browse files

orm: Don't null out value on assignment

This fixes an issue where the PK of ThreadEntry will be NULLed in the
following code

```php
$entry = ThreadEntry::create(array(...));
$entry->save();
$entry->email_info = new ThreadEntryEmailInfo(array(
    'mid' => 'xyzAbc',
));
```

In the above code, the $entry->__set('email_info', <ThreadEntryEmailInfo>)
would be invoked. The ThreadEntryEmailInfo object is new, and so will cause
the local part of the relationship (`id` in this case) to
become null further down in the `__set` method.

This issue is fixed in this commit by removing the NULL assignment to the
new object. This was added in 11322766,
however, it is unclear why the null assignment is performed.
parent 00a1371d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment