Introduce yourself here! In order to avoid spam, new users must first comment on the discussion in the 'Introductions' before they become 'full members'
Widgets and the widgets page
  • I've tested this with a couple of themes and it's verifiable.  When you're in the control panel on the "Widgets" tab and on the "Manage Widgets" submenu tab, none of the widgets show up on the "Right bar".  I've tried to figure out what's causing it but am stumped so far.  I can't imagine what would be different from the left bar and the right bar in the code that could cause this but since it's not my code, I'm not even sure where to start.
  • Hi, this is a known (by me) and reported bug (I can't find the discussion however).
    Since it has never been fixed I wrote a small plugin to fix the behaviour: http://www.pierovdfn.it/redirect/plugin_widgetfixer.html

    The array iterator is never reset, so you can't parse twice a position.

    The plugin works only on widget administration.
  • Good job!  Maybe I can work out how to fit this into the core code and submit a pull request.  This is my last issue that I'm aware of to complete the overall package in my porting efforts.
  • Integration of this was relatively simple.  In /admin/panels/widgets/admin.widgets.default.php edit "function main()" like so:


    		function main() {


    lang_load('admin.widgets');
    # $this->smarty->assign('warnings', admin_widgets_checkall());
    global $fp_widgets;

    $positions = array_keys($fp_widgets->_list); //Piero

    $registered_w = get_registered_widgets();
    $registered_ws = get_registered_widgetsets(null);
    $this->smarty->assign('fp_registered_widgets', $registered_w);


    $wlist = $fp_widgets->getList();
    $widget_list = array();

    foreach($registered_ws as $wpos) {

    $widget_list[$wpos] = array();

    $this->get_widget_lists($wlist, $wpos, $widget_list, $registered_w, true);

    unset($wlist[$wpos]);

    }

    $oldwidget_list = array();
    foreach($wlist as $wpos => $c){
    $this->get_widget_lists($wlist, $wpos, $oldwidget_list, $registered_w, false);
    }

    foreach($positions as $key) { //Piero
    @reset($fp_widgets->_list[$key]);
    }

    $this->smarty->assign('widgetlist', $widget_list);
    $this->smarty->assign('oldwidgetlist', $oldwidget_list);


    $conf = io_load_file(CONFIG_DIR . 'widgets.conf.php');

    $this->smarty->assign('pluginconf', $conf);

    return 0;


    }


    Thanks for this, it was really bugging me.
  • Hi, I wouldn't put this on the administration panel, but somewhere on the widget system.
    I would create a method on the widget_indexer class (core.widgets.php), maybe called reset.

    It's strange, because I remembered it was possible to fix this bug without changing the system very much, but I don't think so now.
  • It works where it is without being a plugin but I'll keep working on a way to integrate into core.widgets.php if it's possible.
  • Yes, of course you can put it where you want :-)
    I wrote it as a plugin not to modify each time the original file ;-) 
  • I was just thinking it could be merged with the release, eliminating the need for a plugin.  I can verify that it works where I put it and works well.  I'd call this a patch that needs merged into the main branch and seeing that it only affects the widgets page, /admin/panels/widgets is where it should go unless the reason for the bug can be found.  I'll keep doing a comparison of files to see if I can track down the code or omission that causes this.
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion