Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP notice Undefined index: module in feeds_system_info_alter() #13

Closed
jenlampton opened this issue Aug 28, 2018 · 10 comments · May be fixed by #88
Closed

PHP notice Undefined index: module in feeds_system_info_alter() #13

jenlampton opened this issue Aug 28, 2018 · 10 comments · May be fixed by #88
Labels

Comments

@jenlampton
Copy link
Member

jenlampton commented Aug 28, 2018

I'm seeing my dblog flodded with the following PHP notices:

Notice: Undefined index: module in feeds_system_info_alter() (line 819 of backdrop/modules/contrib/feeds/feeds.module).

The following code...

    if ($file->name === $plugin['module']) {
      $module_plugins[$plugin_id] = TRUE;
    }

...should be replaced as follows:

    if (array_key_exists('module', $plugin) && $file->name === $plugin['module']) {
      $module_plugins[$plugin_id] = TRUE;
    }

PR: #13

@jenlampton
Copy link
Member Author

jenlampton commented Aug 28, 2018

Hm, I'm unable to reproduce this on the 1.x branch... but pushing my PR anyway. Perhaps it will help someone else.

@ghost
Copy link

ghost commented Apr 5, 2019

I haven't tested it, but I believe @jenlampton's PR would prevent the notices appearing. However, it doesn't fix the root problem, which is that feeds_get_plugins() (which is where $plugin['module'] comes from) doesn't actually have a module key at all...

Here's one of the array keys returned by feeds_get_plugins():

FeedsNodeProcessor (Array, 4 elements)
  name (String, 14 characters ) Node processor
  description (String, 24 characters ) Create and update nodes.
  help (String, 44 characters ) Create and update nodes from parsed content.
  handler (Array, 4 elements)
    parent (String, 14 characters ) FeedsProcessor
    class (String, 18 characters ) FeedsNodeProcessor
    file (String, 22 characters ) FeedsNodeProcessor.inc
    path (String, 37 characters ) ./modules/feeds/plugins

No module key...

So I think this issue needs some more work (by someone who knows more about how Feeds should work than I do).

@herbdool herbdool added the bug label Nov 17, 2019
@VasasA
Copy link
Member

VasasA commented Feb 26, 2020

@BWPanda Drupal 7 uses ctools_get_plugins() function instead of feeds_get_plugins() here, and that function provides module keys, but that function is not implemented in Backdrop.
(I encountered this bug when converting the ldap_feeds module.)

@jenlampton
Copy link
Member Author

jenlampton commented Feb 26, 2020

Here's some docs on converting feeds plugins for Backdrop:
https://github.com/backdrop-contrib/ctools/wiki/Converting-CTools-plugins

It looks like maybe all that is needed is adding a module key to the plugins? I bet ctools did that automatically, but we can do it explicitly.

@jenlampton
Copy link
Member Author

I just ran into this again. It happened immediately when I first installed feeds module.

@jenlampton
Copy link
Member Author

I've filed a new PR that adds the missing module key to all feeds plugins in this module: #13

@stpaultim
Copy link
Member

I'm getting flooded with these errors, which I assume is the same problem - just different line number.

Notice: Undefined index: module in feeds_system_info_alter() (line 896 of backdrop/modules/contrib/feeds/feeds.module)

@jenlampton
Copy link
Member Author

@stpaultim have you tested the PR? I just applied that to a new site and it resolved the issue for me.

@stpaultim
Copy link
Member

stpaultim commented Mar 20, 2022

@jenlampton I just replaced the feeds module with your branch and I'm no longer flooded with errors, but I am getting a single error.

Notice: Undefined index: module in feeds_system_info_alter() (line 896 of /var/www/triplo/all-modules/simplo/src/modules/contrib/feeds/feeds.module).

I will try to do a little more testing later tonight.

@jenlampton
Copy link
Member Author

jenlampton commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants