Skip to content
Snippets Groups Projects
  • Jared Hancock's avatar
    93a34c43
    orm: Don't null out value on assignment · 93a34c43
    Jared Hancock authored
    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.
    93a34c43
    History
    orm: Don't null out value on assignment
    Jared Hancock authored
    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.