diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index 43946049d..eebec4b0e 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -405,7 +405,7 @@ function advancedcontentfilter_get_variables_guid(ServerRequestInterface $reques $condition = ["`guid` = ? AND (`uid` = ? OR `uid` = 0)", $args['guid'], local_user()]; $params = ['order' => ['uid' => true]]; - $item = Item::selectFirst(local_user(), Item::DISPLAY_FIELDLIST, $condition, $params); + $item = Item::selectFirstForUser(local_user(), [], $condition, $params); if (!\Friendica\Database\DBM::is_result($item)) { throw new HTTPException\NotFoundException(L10n::t('Unknown post with guid: %s', $args['guid'])); diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index a68e0b361..bc6d490c7 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -336,7 +336,7 @@ function mailstream_cron($a, $b) { if (!$ms_item_id['message-id'] || !strlen($ms_item_id['message-id'])) { logger('mailstream_cron: Item ' . $ms_item_id['id'] . ' URI ' . $ms_item_id['uri'] . ' has no message-id', LOGGER_NORMAL); } - $item = Item::selectFirst($ms_item_id['uid'], Item::DISPLAY_FIELDLIST, ['id' => $ms_item_id['id']]); + $item = Item::selectFirst([], ['id' => $ms_item_id['id']]); $users = q("SELECT * FROM `user` WHERE `uid` = %d", intval($item['uid'])); $user = $users[0]; if ($user && $item) { diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 566391171..6a3090da3 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -462,7 +462,7 @@ function statusnet_post_hook(App $a, &$b) } $condition = ['uri' => $b["thr-parent"], 'uid' => $b["uid"]]; - $orig_post = Item::selectFirst($b["uid"], ['author-link', 'uri'], $condition); + $orig_post = Item::selectFirst(['author-link', 'uri'], $condition); if (!count($orig_post)) { logger("statusnet_post_hook: no parent found " . $b["thr-parent"]); return; @@ -683,7 +683,7 @@ function statusnet_prepare_body(App $a, &$b) $item["plink"] = $a->get_baseurl() . "/display/" . $a->user["nickname"] . "/" . $item["parent"]; $condition = ['uri' => $item["thr-parent"], 'uid' => local_user()]; - $orig_post = Item::selectFirst(local_user(), ['author-link', 'uri'], $condition); + $orig_post = Item::selectFirst(['author-link', 'uri'], $condition); if (count($orig_post)) { $nick = preg_replace("=https?://(.*)/(.*)=ism", "$2", $orig_post["author-link"]); diff --git a/twitter/twitter.php b/twitter/twitter.php index d9f6ece3a..3e2d90d72 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -454,7 +454,7 @@ function twitter_post_hook(App $a, &$b) } $condition = ['uri' => $b["thr-parent"], 'uid' => $b["uid"]]; - $orig_post = Item::selectFirst($b["uid"], [], $condition); + $orig_post = Item::selectFirst([], $condition); if (!DBM::is_result($orig_post)) { logger("twitter_post_hook: no parent found " . $b["thr-parent"]); return; @@ -758,7 +758,7 @@ function twitter_prepare_body(App $a, &$b) $item["plink"] = $a->get_baseurl() . "/display/" . $a->user["nickname"] . "/" . $item["parent"]; $condition = ['uri' => $item["thr-parent"], 'uid' => local_user()]; - $orig_post = Item::selectFirst(local_user(), ['author-link'], $condition); + $orig_post = Item::selectFirst(['author-link'], $condition); if (DBM::is_result($orig_post)) { $nicknameplain = preg_replace("=https?://twitter.com/(.*)=ism", "$1", $orig_post["author-link"]); $nickname = "@[url=" . $orig_post["author-link"] . "]" . $nicknameplain . "[/url]"; diff --git a/windowsphonepush/windowsphonepush.php b/windowsphonepush/windowsphonepush.php index a7453b1d3..dd461ea49 100644 --- a/windowsphonepush/windowsphonepush.php +++ b/windowsphonepush/windowsphonepush.php @@ -197,7 +197,7 @@ function windowsphonepush_cron() $senditemtext = PConfig::get($rr['uid'], 'windowsphonepush', 'senditemtext'); if ($senditemtext == 1) { // load item with the max id - $item = Item::selectFirst(local_user(), ['author-name', 'body'], ['id' => $count[0]['max']]); + $item = Item::selectFirst(['author-name', 'body'], ['id' => $count[0]['max']]); // as user allows to send the item, we want to show the sender of the item in the toast // toasts are limited to one line, therefore place is limited - author shall be in