Module Monday: Edit Limit

How to Set an Time Limit for Content and Comment Editing on a Social Site, Using Drupal 7

When you're building a social site, one basic question always comes up: are users allowed to edit content and comments after they're posted? If they aren't, typos and simple errors quickly turn into huge annoyances. But if they can edit their posts after they're seen by other users, hijinks are inevitable. Write an incendiary comment, wait until angry people respond, then alter the original content to something innocuous. Voila! Instant flame war.

Ideally, you'd be able to give them a window of time in which edits can be performed (to fix typos or correct errors), then lock the content once other people are likely to have read it. Fortunately, that's exactly what the Edit Limit module adds to Drupal.

Screenshot of administration screen

Setting up Edit Limit is straightforward: install it, turn it on, and hit its settings page to determine which content types it applies to. Then choose how long users have to make edits after posting a piece of content. That's it! You can also choose to limit them to a specific number of edits rather than a specific timeframe, useful to allowing a single edit to fix typos, rather than lots of small revisions. The same rules can also be applied to comments, although the setting is global: you can't set up rules for comments on Articles while leaving comments on Events unrestricted, for example.

Screenshot of Edit Limit in action

Edit Limit has a few rough edges, including odd verbiage in its messages to the user. The amount of time they have left before a node is locked? It gets displayed in seconds rather than hours or minutes. Many of its options would also make sense on the content type editing form, rather than a single central configuration screen. Even with those issues, Edit Limit is a simple, useful tool that gives site builders a bit more flexibility when planning a site's interaction model. If you're a developer with a bit of time on your hands, submitting a patch to fix the issues would take the module to the next level!

Get in touch with us

Tell us about your project or drop us a line. We'd love to hear from you!