if (empty($data['fileHash'])) $data['fileHash'] = sha1_file($additionalData['fileLocation']);
// get user id
- if ($data['userID']) $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
+ $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
// save attachment
$action = new AttachmentAction(array(), 'create', array(
* @see wcf\system\importer\IImporter::import()
*/
public function import($oldID, array $data, array $additionalData = array()) {
- if ($data['userID']) $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
+ $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
$action = new CommentAction(array(), 'create', array(
'data' => array_merge($data, array('objectTypeID' => $this->objectTypeID))
* @see wcf\system\importer\IImporter::import()
*/
public function import($oldID, array $data, array $additionalData = array()) {
- if ($data['userID']) $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
+ $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
$data['commentID'] = ImportHandler::getInstance()->getNewID($this->objectTypeName, $data['commentID']);
if (!$data['commentID']) return 0;
* @return integer $newID
*/
public function getNewID($type, $oldID) {
+ if (!$oldID) return null;
$objectTypeID = $this->objectTypes[$type]->objectTypeID;
if (!isset($this->idMappingCache[$objectTypeID][$oldID])) {