feediron / ttrss_plugin-feediron

Evolution of ttrss_plugin-af_feedmod
https://discourse.tt-rss.org/t/plugin-update-feediron-v1-2-0/2018
MIT License
212 stars 34 forks source link

Multiple PHP "undefined" warnings #189

Closed benfishbus closed 1 year ago

benfishbus commented 1 year ago

Expected Behavior

Please describe the behavior you are expecting

No/minimal warning messages logged by tt-rss about FeedIron.

Current Behavior

What is the current behavior?

Logs contain various "undefined array key" and "undefined variable" warnings stemming from FeedIron.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

Refresh any feed

Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

Failure Logs ``` Undefined variable $tags 1. plugins. Local/feediron/filters/fi_mod_tags_xpath/init.php(27): ttrss_error_handler(Undefined variable $tags, plugins.local/feediron/filters/fi_mod_tags_xpath/init.php) Undefined array key "debug" 1. plugins. Local/feediron/filters/fi_mod_all_xpath/init.php(8): ttrss_error_handler(Undefined array key "debug", plugins.local/feediron/filters/fi_mod_all_xpath/init.php) Undefined array key "replace-tags" 1. plugins. Local/feediron/init.php(105): ttrss_error_handler(Undefined array key "replace-tags", plugins.local/feediron/init.php) Undefined array key 0 1. plugins. Local/feediron/filters/fi_mod_tags_xpath/init.php(23): ttrss_error_handler(Undefined array key 0, plugins.local/feediron/filters/fi_mod_tags_xpath/init.php) ```

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Paste Configuration here
dugite-code commented 1 year ago

I think there is a few separate things happening here.

  1. Undefined variable $tags
    • The tags are clearly not being found so the variable isn't being set here
  2. Undefined array key "debug"
    • The debug setting being set by default to false, I'll have to double check this code, but I'm not seeing this in my setup. Do you have the config option debug set in your config?
    • This is the fi_mod_all_xpath filter which I still treat as a bit of an alpha filter.
  3. Undefined array key "replace-tags"
    • Looks like the $NewContent['replace-tags'] should be explicitly set false init.php#L213
  4. Undefined array key 0
    • Looks like this is related to point 1
dugite-code commented 1 year ago

Are you able to try the fixes on https://github.com/feediron/ttrss_plugin-feediron/commit/8a5093dc48117b5320f553f3c487791313a9b26f in the dev branch. This should address 1,3 and 4

dugite-code commented 1 year ago

I've merged the changes I've done into the master branch. I'm still not sure about the Undefined array key "debug" issue