• The plugin otherwise seems to work, I can add events and display them on pages and posts using the shortcodes. I can change settings in the main widget settings page.

    However I cannot save the settings on the widget instance configuration page, such as the title, and the text of the “all events” link. It also does not display any events I’ve created.

    Server is a WIMP using IIS 6, PHP 5.2.4, and MySQL 5.0.45

    Other widgets can save to the database, so the core objects seem to work.

    No error is displayed by the widget on clicking Save.

    To troubleshoot, I have disabled all other plugins and reverted to the default theme, with no difference in behavior. I am also using ISAPI_Rewrite, and I tried disabling that as well.

    Any help or information about running windows installations where it works would be appreciated.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    what version of the plugin are you using?

    Thread Starter rich_c

    (@rich_c)

    Hi, Thanks for responding. I’m using 3.0.9.

    Also it seems that the calendar widget does work; it’s only the events list widget that doesn’t.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    You could check to see if there’s any php errors in your logs to spot the error and maybe patch it for the meantime, but otherwise it should be fixed in the next release which will be out very soon (hopefully this week).

    Thread Starter rich_c

    (@rich_c)

    I’m not getting any errors. However it looks like the form data is not getting saved to the database. The defaults are being written, and if I change the default that’s what I get back in the form after saving. The new default is also what goes into the database for that instance.

    So it seems like there’s something hinky in the $new_instance array when update() is called.

    Thread Starter rich_c

    (@rich_c)

    The problem is that you apparently can’t use empty() on an array element. For array elements with a value of ” empty() will return false. Not sure if this is a bug in PHP or not, but converting the tests to good old (instance[‘element’] == ”) works fine.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    empty does work with arrays (it’s used everywhere else, even in the wp core). In fact, the php docs are wrong, it returns TRUE if “empty”. The above should produce the same result but you might get php warnings if the index is undefined.

    I’ve adjusted the code for the next release, if you want, replace the update function in widgets/em_events.php with this:

    function update($new_instance, $old_instance) {
        	//filter the new instance and replace blanks with defaults
        	$defaults = array(
        		'title' => __('Events','dbem'),
        		'scope' => 'future',
        		'order' => 'ASC',
        		'limit' => 5,
        		'format' => '#_LINKEDNAME<ul><li>#j #M #y</li><li>#_TOWN</li></ul>',
        		'nolistwrap' => false,
        		'orderby' => 'start_date,start_time,name',
    			'all_events' => 0,
    			'all_events_text' => __('all events', 'dbem')
        	);
    		return array_merge($defaults, $new_instance);
        }
    Thread Starter rich_c

    (@rich_c)

    I don’t know why it didn’t work on my 5.2.4 version of PHP, but it didn’t. Eliminating empty() also solved other problems I was having in getting the widget to display the correct data on the page.

    If you search through the PHP changelog for empty() you will see that there have been enough issues with it that I think it’s worth avoiding.

    Anyway your new solution is very elegant. ??

    Did you also fix the errors on line 35 where it should be

    $events_link = ( $instance['all_events_text'] != '' ) ? em_get_link($instance['all_events_text']) : em_get_link(__('all events','dbem'));

    instead of

    $events_link = ( $instance['all_events_link'] != '' ) ? em_get_link($instance['all_events_link']) : em_get_link(__('all events','dbem'));

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    what’s on the dev version is different, this has been fixed, check that out if you want.

    fyi, the event ownership feature is not complete yet

    Hi

    I opened my em-events.php, but not sure what code i need to replace?

    I am using version 3.0.9

    Regards

    Apologies — I try to edit the wrong em-events.php file

    it worked!
    thanx

    I also had this problem after upgrading, but this fix worked perfectly. Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: Events Manager] Widget does not work on IIS’ is closed to new replies.