{"id":49057247,"url":"https://github.com/lmonk72/flag-retention","last_synced_at":"2026-04-19T23:36:47.204Z","repository":{"id":316397204,"uuid":"1062464182","full_name":"lmonk72/flag-retention","owner":"lmonk72","description":"A Drupal module to define 'Flag' retention policies and extra functionality to support the Flag module.","archived":false,"fork":false,"pushed_at":"2025-12-24T22:38:28.000Z","size":137,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-26T05:50:28.684Z","etag":null,"topics":["drupal","drupal-module"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lmonk72.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-23T09:39:33.000Z","updated_at":"2025-12-24T22:38:31.000Z","dependencies_parsed_at":"2025-09-24T11:48:46.295Z","dependency_job_id":null,"html_url":"https://github.com/lmonk72/flag-retention","commit_stats":null,"previous_names":["lmonk72/flag-retention"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lmonk72/flag-retention","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmonk72%2Fflag-retention","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmonk72%2Fflag-retention/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmonk72%2Fflag-retention/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmonk72%2Fflag-retention/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmonk72","download_url":"https://codeload.github.com/lmonk72/flag-retention/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmonk72%2Fflag-retention/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32027008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drupal","drupal-module"],"created_at":"2026-04-19T23:36:46.521Z","updated_at":"2026-04-19T23:36:47.189Z","avatar_url":"https://github.com/lmonk72.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flag Retention Module\n\nThis Drupal module provides retention policies and clearing functionality for the Flag module.\n\n## Features\n\n### Retention Management\n- **Global retention settings**: Set default retention periods for all flags\n- **Per-flag retention settings**: Override global settings for specific flag types\n- **Automatic cleanup**: Cron-based cleanup of old flags based on retention policies\n\n### Flag Clearing\n- **User flag clearing**: Allow users to clear their own flags\n- **Admin flag clearing**: Administrators can clear all flags of a specific type\n- **Bulk clearing**: Administrative interface for bulk flag operations\n- **Age-based clearing**: Clear flags older than a specified number of days\n\n### Permissions\n- `administer flag retention`: Configure retention settings and policies\n- `clear own flags`: Allow users to clear their own flags\n- `clear all flags`: Allow clearing of all flags (admin permission)\n\n## Installation\n\n1. Place the module in your `modules/custom` directory\n2. Enable the module: `drush en flag_retention`\n3. Configure permissions at `/admin/people/permissions`\n4. Configure global settings at `/admin/config/system/flag-retention`\n5. Set per-flag retention settings at `/admin/structure/flags/retention`\n\n## Configuration\n\n### Global Settings\n- **Default retention period**: Number of days to keep flags (0 = keep forever)\n- **Enable user clearing**: Allow users to clear their own flags\n- **Log clearing activity**: Log flag clearing for audit purposes\n- **Cron batch size**: Number of flags to process per cron run\n\n### Per-Flag Settings\n- **Retention days**: Override global setting for specific flag types\n- **Auto-clear**: Enable automatic cleanup via cron for this flag type\n\n## Usage\n\n### For Users\n- **User profiles**: Visit your user profile and click \"Clear flags\" (if enabled)\n- **Views integration**: Add the \"Flag Retention Clear Link\" field to user listing views\n- **Views area**: Add the \"Flag Retention Clear Area\" to any view for a clear button\n- **Block**: Place the \"Clear My Flags\" block anywhere on your site\n- **Direct link**: Visit `/user/{your-id}/flag-clear` to access the clearing form\n\n### For Administrators\n- Manage retention settings at `/admin/structure/flags/retention`\n- Perform bulk operations at `/admin/structure/flags/bulk-clear`\n- Clear all flags of a specific type from the flag management page\n\n### Automated Cleanup\n- Configure retention settings for flag types\n- Enable \"Auto-clear\" for automatic cleanup\n- Old flags will be removed during cron runs based on retention periods\n\n## Database Schema\n\nThe module creates a `flag_retention_settings` table to store per-flag retention policies:\n- `flag_id`: The flag identifier\n- `retention_days`: Number of days to retain flags (0 = never delete)\n- `auto_clear`: Whether to automatically clear old flags via cron\n- Timestamps for created/changed tracking\n\n## Logging\n\nWhen logging is enabled, the module logs:\n- Automatic cleanup activities (via cron)\n- Flag clearing operations\n- Errors during cleanup operations\n\nCheck the Drupal logs at `/admin/reports/dblog` for flag retention activities.\n\n## Requirements\n\n- Drupal 10.x\n- Flag module\n- Core modules: user, system, datetime\n\n## Views Integration\n\nThe module provides several ways to integrate with Drupal Views:\n\n### Views Field: Flag Retention Clear Link\n- **Purpose**: Add a \"Clear Flags\" link to user listing views\n- **Configuration**: Choose between user clear or admin clear modes\n- **Features**: Shows flag count, permission-aware display\n- **Usage**: Add to any view that displays user entities\n\n### Views Area: Flag Retention Clear Area\n- **Purpose**: Add a \"Clear My Flags\" button to any view\n- **Configuration**: Customizable button text and styling\n- **Features**: Shows current user's flag count\n- **Usage**: Add to header, footer, or empty area of any view\n\n### Block: Clear My Flags\n- **Purpose**: Standalone block for clearing flags\n- **Configuration**: Show/hide counts and summaries\n- **Features**: Complete flag breakdown by type\n- **Usage**: Place in sidebars, content areas, or any block region\n\n## Support\n\nThis module integrates with the Flag module's existing infrastructure and uses proper Drupal APIs for entity management, ensuring compatibility with other modules and proper event triggering.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmonk72%2Fflag-retention","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmonk72%2Fflag-retention","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmonk72%2Fflag-retention/lists"}