// The URI and the contact is taken from the direct parent which needn't to be the top parent
$thr_parent_uri = $toplevel_item['uri'];
- if ($toplevel_item['id'] != $toplevel_item['parent']) {
+ if ($toplevel_item['gravity'] != GRAVITY_PARENT) {
$toplevel_item = Item::selectFirst([], ['id' => $toplevel_item['parent']]);
}
}
// We set the datarray ID to -1 because in preview mode the dataray
// doesn't have an ID.
$datarray["id"] = -1;
+ $datarray["uri-id"] = -1;
$datarray["item_id"] = -1;
$datarray["author-network"] = Protocol::DFRN;
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
+
throw new HTTPException\InternalServerErrorException(DI::l10n()->t('Item wasn\'t stored.'));
}