Tiny Tiny RSS: Community

Refactor to cdmMoveToId commit causes unhandled exception

Since the commit https://git.tt-rss.org/fox/tt-rss/commit/a802649d5397da0bdeaceddf3a9a38093053bcba the function cdmMoveToId() uses a params object instead of multiple parameters.

However, the onclick listener doesn’t pass on a params parameter, which cause an unhandled exception (TypeError: params is undefined).

For the sake of backwards compatibility (using cdmMoveToId() with a single parameter id), I could fix it by changing the declaration to
cdmMoveToId: function (id, params = {}) {

Don’t know how pretty that would be considered.

yeah this should be fine, i think. please make a PR.

e: either that or params = params || {} in the function body

i was near PC anyway, thanks for reporting though. my bad. :slight_smile:

Np. Thx for the quick fix :slight_smile:

Started seeing this today. Currently at commit: 4a00d41 . Preference set to: ‘Combined mode’.

I’m getting the following ‘Unhandled exception’ popup error when clicking in a headline in a feed. Instead of the article opening in tt-rss as expected, the article opens to the website of origin in a new tab, i.e., as if I had right-clicked / ‘Open original article’ in tt-rss’ context menu which I had not.

 TypeError: Article.cdmScrollToId is not a function
     at Object.Headlines.click (https://xxxxxxxx/xxxxxxx/index.php:141:15)
     at HTMLSpanElement.onclick (https://xxxxxxxxxx/xxxxxxxx/index.php#f=195&c=0:1:18)

.

And this in admin’s system log:

E_USER_WARNING (512)	client-js:https://.../index.php:141	Uncaught TypeError: Article.cdmScrollToId
 is not a functionTypeError: Article.cdmScrollToId is not a function
at Object.Headlines.click (https://.../index.php:141:15)
at HTMLSpanElement.onclick (https://.../index.php#f=-1&c=0:1:18)
IP: ...
Request URI: /...rss/backend.php
User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.142 Safari/537.36
	martywd	14:25

.

200509_unhandled_exception
.
fwiw, if I do right-click on an article and choose ‘Open original article’, article opens in a new tab with no errors.

.

“Article.cdmScrollToId” doesn’t exist as of that commit (edit: actually, as of a802649), so you might want to look for plugins that are attempting to override that function (or clear your browser cache, etc.).

Now there’s thought! And you are correct. After disabling all enabled user plugins the ‘Unhandled exception’ was no longer an issue as I described above in my previous message.

Turns out that it’s the ‘hl_legacy: Revert back to legacy headline click behavior’ plugin that is causing this unhandled exception in ‘Combined Mode’ for me. Once ‘hl_legacy’ was disabled, and other plugins I use were re-enabled, no further errors.

Edited to add: … If the https://git.tt-rss.org/fox/ttrss-hl-legacy is installed. Edit line 18 of init.js to remove ‘Article.cdmScrollToId(id);’ and replace with ‘Article.cdmMoveToId(id);’ . This will make the optional ‘hl_legacy’ plugin usable again.

Another edit: Fixed hl_legacy plugin link, which btw, I belatedly realized had already been updated by fox to comply with these latest commits! lol.
.

Yeah that’s it. I immediately updated my plugin keyboard_cursor, too, after that commit.

yeah you had me confused there because i remembered updating it.

Disabling that plugin restored correct behavior for me, as well.

just because a plugin is out of main tree doesn’t mean it’s going to work perpetually without a need to ever update it.

Describe the problem you’re having:
A few updates ago, when clicking on an article to expand/read it within TT-RSS the error “TypeError: Article.cdmScrollToId is not a function” appears

If possible include steps to reproduce the problem:
If I disable the hl_legacy plugin, the problem goes away. Once I enable it, the problem reappears.

tt-rss version (including git commit id):
v20.05-a1ffc1161

Platform (i.e. Linux distro, PHP, PostgreSQL, etc) versions:
Ubuntu 20.04, official docker installation, PostgreSQL 12

Please provide any additional information below:
Tried it both Firefox and Chrome, also tried in private/incognito sessions without browser extensions enabled.

why is it so hard for some people to understand that plugins also need to be updated from time to time?

also, another thread about this very issue is right there on the frontpage.

e: seriously, when i was refactoring this, i’ve specifically checked if out of tree plugins used it, and made necessary changes to hl_legacy. and then nobody bothered to update it. really now.

Yeah, gotta take ppl by the hand sometimes…