1
0
Fork 0

Some more foreign keys added

This commit is contained in:
Michael 2020-11-19 06:26:30 +00:00
commit 3af5f6b8ee
5 changed files with 138 additions and 39 deletions

View file

@ -476,21 +476,30 @@ function notification($params)
$notify_id = 0;
if ($show_in_notification_page) {
$notification = DI::notify()->insert([
$fields = [
'name' => $params['source_name'] ?? '',
'name_cache' => substr(strip_tags(BBCode::convert($params['source_name'])), 0, 255),
'url' => $params['source_link'] ?? '',
'photo' => $params['source_photo'] ?? '',
'link' => $itemlink ?? '',
'uid' => $params['uid'] ?? 0,
'iid' => $item_id,
'uri-id' => $uri_id,
'parent' => $parent_id,
'parent-uri-id' => $parent_uri_id,
'type' => $params['type'] ?? '',
'verb' => $params['verb'] ?? '',
'otype' => $params['otype'] ?? '',
]);
];
if (!empty($item_id)) {
$fields['iid'] = $item_id;
}
if (!empty($uri_id)) {
$fields['uri-id'] = $uri_id;
}
if (!empty($item_id)) {
$fields['parent'] = $parent_id;
}
if (!empty($item_id)) {
$fields['parent-uri-id'] = $parent_uri_id;
}
$notification = DI::notify()->insert($fields);
// Notification insertion can be intercepted by an addon registering the 'enotify_store' hook
if (!$notification) {