Tiny Tiny RSS: Community

Scriptaliculous/controls.js failing to load after recent updates: breaking plugins?


#1

Recent updates seem to have broken my plugin, ttrss-to-wallabag_v2

After updating to v18.12 (fca78f7), refreshing ttrss gives the following errors in console:

Loading failed for the <script> with source “https://ttrss.example.com/lib/scriptaculous/controls.js”.
this is followed by:
failed to initialize plugin JS: wallabag_v2
ReferenceError: "hotkey_actions is not defined"

Removing the hotkey_actions bit from the plugin, the plugin loads but still fails to execute with an error complaining that notify_progress is not defined. Removing notify_progress results in an error complaining that param_escape is not being defined, and so on.

Running this on Ubuntu 18.04, latest updates at the time of posting, with nginx and php7.2-fpm.


#2

due to many recent changes in base tt-rss code, pretty much all plugins with javascript code will have to be updated


#3

Is there a reference that you can point me to so that I can quickly make these changes? Also, would these changes explain why scriptaculous/controls.js is failing to load?


#4

lol reference
im afraid the reference is the source code

re controls.js: the file was not removed, as to why it doesn’t load for you, i have no idea
checking httpd logs would be a good start


#5

Reading through the source. :slight_smile:
Reading through the logs.
Thanks


#6

well i hope you will enjoy reading it as much as i enjoyed writing it


#7

Indeed.

It was brainlessly simple to alter notify_progress to Notify.progress, and the rest of the notify issues, and likewise switching param_escape to encodeURIComponent. I am still looking for the hotkey_actions switch?

Regardless, httpd logs show nothing regarding control.js. Not sure what is happening there. Things are still working, but it isn’t loading, nor is there anything meaningful being produced to let me know why.


#8

hotkey actions live in the App object, you will have to write a tiny pluginhost hook to get to it
theres a yesterday’s thread about it


#9

I had the same “issue” with hotkey_actions.

You can see my little plugin which now uses PluginHost here:

Thank you @fox for all your hard work and your help !


#10

Thanks! I was reading through your code already.

I have everything set up but for one last issue, my plugin used getActiveArticleId when sharing. I’m getting the error complaining that this, too is not defined!


#11

Also, thank you @fox for your quick replies and for ttrss. I appreciate the hard work you put into this!


#12

all these methods have been renamed, it’s getActive now AFAIK.


#13

Indeed! Article.getActive did the trick!

Thank you @ggrandou


#14

Here is the resultant js for berevity.