Re-installation af_img_phash issues

I used to have a decent working tt-rss with af_img_phash in it. For some reason the domains list input field disappeared and I decided to drop the plugin and reinstall it, but after reinstallation I get the following error:

Declaration of Af_Img_Phash::hook_article_image($enclosures, $content, $site_url) must be compatible with Plugin::hook_article_image($enclosures, $content, $site_url, $article)

I had to update the declaration of the hook_article_image method in the Af_Img_Phash class to include the $article parameter so that it matches the declaration in the Plugin class.

Am I alone on this? Anyone else with the same?

https://gitlab.tt-rss.org/tt-rss/plugins/ttrss-perceptual-image-hash/-/blob/master/init.php?ref_type=heads#L397

hm?

e: same here https://git.tt-rss.org/fox/ttrss-perceptual-image-hash.git/tree/init.php#n397 unless i’m missing something

I see what happened, there is a set of cloned code out there on github.

This code was different. Somehow I ended up on this repository.

try be more careful in the future, installing cloned plugins off random github repositories might get you into trouble.

tt-rss has a native plugin installer in preferences, you shouldn’t ever need to git clone anything manually.

Well I didn’t saw the img_phash plugin in there, so that’s why I had to improvise.

the name is a bit different but it’s there.

With the perceptual plugin installed through preferences I’m back at my original problem: no declaration of the domains_list.

Undefined array key “domains_list”

  1. plugins.local/af_img_phash/init.php(39): ttrss_error_handler(Undefined array key “domains_list”, plugins.local/af_img_phash/init.php)
  2. classes/pluginhandler.php(15): save()
  3. backend.php(169): catchall(save)

I see at the beginning that the other variables are defined (host, default_similarity…). where is domains_list supposed to go?

this is no longer used so this error on save does nothing. i’ll make a note to clean this up.

it’s enabled on all domains now. http content type probing is used instead of this.

https://gitlab.tt-rss.org/tt-rss/plugins/ttrss-perceptual-image-hash/-/commit/185921b4d77ae98165c5337e5137d7b42893cce7 and newer commits

I see.

In the init.php I have on my system (after installing it using preferences) I still have plenty of references to domains_list. So Somewhere things are getting mixed up since I don’t pull the latest version.

Version I see on the bottom is v23.09-b15f185e
Perceptual plugin version is v23.08-e78a69f

https://gitlab.tt-rss.org/tt-rss/plugins/ttrss-perceptual-image-hash/-/commit/fe9d59d6cd437362f2de59cfc9158014d8ce00da this should clear this up

I cloned the whole branch for the af_img_phash plugin and it went up to version v23.09-fe9d59d

So default installation through preferences somehow gave me a slightly older version with the domains_list thing lingering around.

It works fine now, thanks for helping out.

gitlab.tt-rss.orggit.tt-rss.org (which plugin installer uses) replicates once an hour. so there’s some amount of lag.