Plugins/af_psql_trgm/init.php:263 array_search() expects parameter 2 to be array, boolean given


#1

After enabling of af_psql_trgm plugin, I do have errors in log (probably during refresh), which I can’t figure out.

E_WARNING (2)	plugins/af_psql_trgm/init.php:263 array_search() expects parameter 2 to be array, boolean given

1. plugins/af_psql_trgm/init.php(263): array_search(5, )
2. classes/rssutils.php(745): hook_article_filter(Array)
3. classes/rssutils.php(192): update_rss_feed(5, 1, )
4. update.php(197): update_daemon_common(50)

The problematic code

261                 if (!$enable_globally) {
262                         $enabled_feeds = $this->host->get($this, "enabled_feeds");
263                         $key = array_search($article["feed"]["id"], $enabled_feeds);
264                         if ($key === FALSE) return $article;
265                 }

Tiny Tiny RSS v18.8 (df0115f)

Distributor ID: Debian
Description: Debian GNU/Linux 9.5 (stretch)
Release: 9.5
Codename: stretch

PHP 7.0.30-0+deb9u1 (cli) (built: Jun 14 2018 13:50:25) ( NTS )
Copyright © 1997-2017 The PHP Group


#2

it seems like a minor bug caused by uninitialized plugin data, try enabling the plugin for at least one feed (or maybe even saving plugin preferences once is enough) and see if it helps.


#3

well, this points me to something. I have not enabled PostgreSQL extension correctly on first try (didn’t apply on tt-rss separate DB, but to root one only) and then I didn’t re-enable plugin, so this could be actually reason for not populating with plugins data…

So I did so and enabled it also for one of feed too. Let’s see if it helps.