"last-child" is not used anymore

This commit is contained in:
Michael 2018-01-18 06:54:44 +00:00
parent 2d66242b4f
commit 034d46196f
18 changed files with 6 additions and 105 deletions

View file

@ -4713,7 +4713,6 @@ function post_photo_item($hash, $allow_cid, $deny_cid, $allow_gid, $deny_gid, $f
$arr['allow_gid'] = $allow_gid;
$arr['deny_cid'] = $deny_cid;
$arr['deny_gid'] = $deny_gid;
$arr['last-child'] = 1;
$arr['visible'] = $visibility;
$arr['origin'] = 1;

View file

@ -430,7 +430,6 @@ These Fields are not added below (yet). They are here to for bug search.
`item`.`deleted`,
`item`.`origin`,
`item`.`forum_mode`,
`item`.`last-child`,
`item`.`mention`,
`item`.`global`,
`item`.`gcontact-id`,

View file

@ -386,7 +386,6 @@ function event_store($arr) {
$item_arr['deny_cid'] = $arr['deny_cid'];
$item_arr['deny_gid'] = $arr['deny_gid'];
$item_arr['private'] = $arr['private'];
$item_arr['last-child'] = 1;
$item_arr['visible'] = 1;
$item_arr['verb'] = ACTIVITY_POST;
$item_arr['object-type'] = ACTIVITY_OBJ_EVENT;

View file

@ -487,7 +487,6 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
$arr['wall'] = 1;
$arr['type'] = 'wall';
$arr['origin'] = 1;
$arr['last-child'] = 1;
$arr['network'] = NETWORK_DFRN;
$arr['protocol'] = PROTOCOL_DFRN;
@ -624,7 +623,6 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
$arr['title'] = ((x($arr, 'title')) ? trim($arr['title']) : '');
$arr['location'] = ((x($arr, 'location')) ? trim($arr['location']) : '');
$arr['coord'] = ((x($arr, 'coord')) ? notags(trim($arr['coord'])) : '');
$arr['last-child'] = ((x($arr, 'last-child')) ? intval($arr['last-child']) : 0 );
$arr['visible'] = ((x($arr, 'visible') !== false) ? intval($arr['visible']) : 1 );
$arr['deleted'] = 0;
$arr['parent-uri'] = ((x($arr, 'parent-uri')) ? notags(trim($arr['parent-uri'])) : $arr['uri']);
@ -1112,18 +1110,6 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
create_tags_from_item($current_post);
Term::createFromItem($current_post);
/*
* If this is now the last-child, force all _other_ children of this parent to *not* be last-child
* It is done after the transaction to avoid dead locks.
*/
if ($arr['last-child']) {
q("UPDATE `item` SET `last-child` = 0 WHERE `parent-uri` = '%s' AND `uid` = %d AND `id` != %d",
dbesc($arr['uri']),
intval($arr['uid']),
intval($current_post)
);
}
if ($arr['parent-uri'] === $arr['uri']) {
Item::addShadow($current_post);
} else {

View file

@ -238,7 +238,6 @@ EOT;
'deny_gid' => $item['deny_gid'],
'visible' => 1,
'unseen' => 1,
'last-child' => 0
];
$new_item_id = item_store($new_item);