LocalGov Drupal Override Filters Same-Day Food Waste Entries
Residents viewing waste schedules in a Central Bedfordshire project saw separate food-waste entries alongside refuse or recycling collections scheduled for the same day. Developer Phil Norton documented the resulting LocalGov Drupal customisation in a tutorial published by #! code on 19 July 2026. Phil reported that the revised display reduced one schedule from eight entries to four.
The duplication came from collection data supplied through the Whitespace integration. The project removed standalone food-waste rows and changed the refuse and recycling labels to show that food waste would be collected on the same day. This adjusted the public schedule without requiring changes to the external waste-management system.
The LocalGov Drupal Waste Collection module supports multiple data providers, including the Whitespace service used in this project. Phil’s implementation uses hook_data_provider_info_alter() to replace the Whitespace provider class with a project-specific subclass, then overrides getCollections() to filter entries matching the food-waste service label. The tutorial includes separate setup details for Drupal 10 and Drupal 11 and notes that Drupal’s caches must be rebuilt after the plugin definition changes.


