Fixed \XF\Import\Data\AbstractEntityData :: write doesn't return new ID

DragonByte Tech

Well-known member
In \XF\Import\Data\AbstractEntityData you have this function:

PHP:
protected function write($oldId)
{
    $this->entity->save();
}

Which causes this block of code to fail:
PHP:
        try
        {
            $newId = $this->write($oldId);

            if ($newId !== false)
            {
                if ($oldId !== false && $this->log)
                {
                    $this->dataManager->log($this->getImportType(), $oldId, $newId);
                }

                $this->postSave($oldId, $newId);
            }
        }

Since NULL !== false, it will log a blank string for new_id in the log table, and cause every postSave action to fail.


Fillip
 
Thank you for reporting this issue. The issue is now resolved and we are aiming to include that in a future XF release (2.0.12).

Change log:
Fix multiple issues that make it hard to use XF\Import\Data\AbstractEntityData
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Top Bottom