Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Event Module: removeStartFields and removeEndFields not working correctly


Reply


3473 Views

Avatar
dfondente

Community Member, 15 Posts

9 August 2009 at 10:23am

I want to remove the start and end date selectors on the calendar widget. In my subclass of Calendar, I have put the following in getFilterFields():

      $fields = parent::getFilterFields(); // returns a CalendarFilterFieldSet
      // remove the date filters
      $fields->removeStartFields();
      $fields->removeEndFields();

This removes most of the date selectors, but leaves the end date month in the widget. I looked in the source of event_calendar/code/CalendarFilterFieldSet.php and discovered a typo on line 61 in the function definition for removeEndFields(). I fixed this, and the date selectors are now gone from the widget. However, the form still submits empty dates for start and end date, which results in the filters not returning the correct values. When I submit the widget's form, the URL contains '/--/--', so no events show up at all.

Any suggestions about the best way to resolve this? I could filter '/--/--' out of the URL, but this seems like a bug to me and better to fix in the event calendar module.