An active plugin not shown in plugin list (Elgg 1.8.3)

This issue only happens with one specific plugin I'm currently working on, so I suspect that maybe something in the plugin code is causing it, but I have no idea what it could possibly be.

The plugin already vanished from the plugin list of two different test installations: first one was started with Elgg 1.8.1 (later upgraded to Elgg 1.8.2 hoping this would fix the issue... NOT). Then I read this ticket:

http://trac.elgg.org/ticket/4213

and thought that maybe upgrading to 1.8.3 would solve it, but it did not. In the meantime I had set up a second test installation to continue working on the plugin starting with Elgg 1.8.2 (now 1.8.3). Only today I noticed the plugin has again vanished.

Activating the plugin worked without problems. It also still works fine. The only problem is that it isn't shown in the plugin list, so I can't disable this single plugin alone. The interesting thing is that using "Disable all plugins" does indeed disable all plugins including the one with the issue. Enabling all plugins again does also enable it again but still it doesn't show in the list. Removing the plugin's folder and then refreshing the cache and/or executing upgrade.php doesn't help to disable the plugin either. While it seemed disabled when the files are removed it is again enabled when I copy the folder into the mod directory again.

How could I best find out where exactly the problem lies? As I said I don't see any bug in the plugin code but maybe I missed something nonetheless. If the problem is not within the plugin code where to look in the database? Is there any data that controls which plugins are shown in the list? Not all data of this plugin in the database could be corrupted though as it still works and also can still be enabled/disabled via the "all plugins" switch.

  • Try var dumping the plugin list, see what's on there and if your plugin is there. If it's on the list, I would assume it's a bug in list rendering and views.

  • you could try checking your manifest.xml to see if there's any 'funny' special chars inside there.. such as the '&' sign - if so delete it. 

     

     

  • I've plotted the list of plugins:

    <?php

    require 'engine/start.php';

    $plugins = elgg_get_plugins('any');

    if ($plugins) {
        foreach ($plugins as $plugin) {
          echo $plugin->getID() . '<br>';
        }
    }
    and it's included.

    I already had checked for funny characters in the manifest file. I re-checked and even created the file from scratch. Still no success.

    I renamed the manifest file and disabled / re-enabled all plugins. Elgg gave me an error due to the missing manifest file for the plugin in question. After I restored the correct file name I could enable it again via enable all but it still is not shown on the list.

    I can even change the plugin order. You see that there is something in the list not showing as you need to push a plugin up/down twice to go past the invisible plugin. But the current order is shown correctly when I list all plugins via the code shown above.

    Still a mystery...

  • I've did some further bug-hunting and checked what's done in Elgg core views/default/admin/plugins.php. It seems the problem is in the final call

    echo elgg_view_entity_list($plugin_list, $options);

    When I test listing the plugins by adding a elgg_view_entity_list call in my above example code the plugins is not included either. So I guess I need to investigate elgg_view_entity_list() next...

  • @II Post the contents of Manifest here.

  • I've followed the chain starting from elgg_view_entity_list() until I finally reached elgg_view_entity(). Here there are these lines:

    // if this entity has a view defined, use it
    $view = $entity->view;
    if (is_string($view)) {
      return elgg_view($view, $vars, $bypass, $debug);
    }

    Now I checked all plugins, if any of them has a view and it seems the only plugin that has a view defined is indeed the plugin that is not shown... Maybe because I'm not aware that there is a view defined for the plugin object in the plugins code. How could that happen?

    On the other hand the plugin (okay... it's the fivestar voting plugin in an Elgg 1.8 version) does some manipulation in views to include the voting widget at the appropriate pages. But it's surely not intended to interfere in the plugin objects view. Also, disabling the voting widget addition and the views definition does not stop the plugin object having a view.

  • It seems the problem is/was indeed the implementation of allowing the plugin manipulating views. I think the problem was that the search strings defining the locations where to insert the voting widget was saved in an array named view[]. So, this created the pluginobject->view for this plugin. I found this out when I echoed the content of pluginobject->view.

    I've renamed the corresponding variable(s) throughout the plugin code. It seems to work in a new test installation at least up to now, but I need to keep an eye on it. Unfortunately, I've not yet managed to repair the database entries in the other two test installations (php 5.3.9 seemed to have damaged my mysql admin tool...). I've managed to empty pluginobject->view via php. But as it still exists for the entity the plugin is still not shown in the list. How could I remove the variable "view" for the plugin object via php?

  • Reading the reference sometimes does help:

    ElggEntity::__unset ( name  ) 

    "If you use this to unset an attribute, you must save the object!"

    $plugin->unset('view');
    $plugin->save();

    It seems to have worked. Finally!!! :)

Feedback and Planning

Feedback and Planning

Discussions about the past, present, and future of Elgg and this community site.