This module simply implements a rolling window for front-page content. An admin sets a time interval, e.g. "-1 month", that strtotime() can use. When cron runs, this is compared to a node's "changed" field. If the node hasn't been changed recently, it's "demoted" from the main page (its "promote to front page" parameter is set to zero).
I wanted this for my personal Drupal site, and I currently use it, to prune the articles on the Home page, and thought maybe others would like this functionality in a simple package. I couldn't find any simple modules or way to do what I wanted, so I wrote a module. I looked for demotion, expiration, and various time-based terms but anything remotely similar that I found was much more complex than I wanted or didn't do what I wanted (i.e. dealt with publishing or purging).
This is my first Drupal module, so I'm sure I messed something up.
http://drupal.org/sandbox/jce/1819064
I'm running this in Drupal 7. I haven't tested it in 8 or 6, and don't plan on testing it with 6. I plan to test it with 8 in the coming months, after my D7 site is up and running how I want.
Comments
Comment #1
bripatand commentedHello,
I would recommend you read about the project application checklist here http://drupal.org/node/1587704.
Here are a number of comments:
Comment #2
mathankumarc commentedI think we can achieve this functionality using Rules module itself. Any thoughts on this?
Comment #3
Josh Endries commentedI did look at the Rules module, but decided not to use it; my inclination is to say "no", IMHO, though technically you may be able to replicate the functionality. That's only half the story, though.
The point of this module is that it's simple and lightweight, has no dependencies, leaves no cruft behind, and "just works" if you're okay with the default setting. I prefer not to bloat my systems with stuff I don't need. I've noticed lots of modules leave stuff lying around, which is really frustrating, and would rather not insert additional stuff into the processing pipeline if I'll never really use it. It would be a shame if simple modules weren't allowed because they're simple. I can, however, understand not knowing if the person writing it is good enough. That's just my opinion, but it's a big part of why I wrote this module.
Lastly, I didn't want to figure out how to set up the Rules stuff to do what I want, when it took the same amount of time to write my own little module (which shows how nice Drupal is in that respect). I guess I'm lazy, sort of. :)
Comment #4
Josh Endries commentedOops! You comment about no README.txt tipped me off. My apologies, I'm new to Git, and I forgot to push my changes up. The code you saw probably had no comments at all, ugh.
I renamed the branch to 7.x-1.x, which as far as I can tell is correct (7.x for Drupal, 1.x for my module). However on the page that describes how to do this, http://drupal.org/node/1127732, I don't have a "Releases" page to do steps 2, 3 and 4...
I added the clone link, changed the default branch and deleted the master branch, and cleaned up the spacing; it passes pareview now. I wasn't aware of a coder module, I'll check that out, thanks.
Regarding the simplicity: so what? I view this as a good thing, and I know others that feel the same way (birds of a feather, I guess). There are lots and lots of people out there that can't code, or don't want to code, but may want certain functionality (and perhaps only that functionality). Denying modules because they do one thing, and hopefully do it well, is silly IMO.
The only valid part of section 2.3 is regarding trusting the developer to create full projects. If that's what you meant, I can understand that. I even agree and support that view. As far as a module itself, however, I disagree with this "too simple" logic. I could consider adding functions that aren't really necessary, or adding lines to bloat it up, but that seems like an artificial limitation. Personally, I don't want to "create full projects" on my own; I just want this project to be made available.
If the module is deemed too simple to be used by the community, I think that's a shame, but I'll accept the decision. I'll just make the module available on my site, dooming it into obscurity forever, and move on... ;)
Again my apologies for being a Git noob and wasting your time.
Comment #5
bripatand commentedRegarding the last point, don't take it wrongly. I don't make the rules.
And it is not a judgement of your module utility, nor of your contributor skills.
There are plenty of useful modules widely used with less lines of code than yours.
As you rightly wrote, it is about trusting the developer to create full projects.
Your first contribution is the one you are evaluated against.
I personally believe it is a good rule put in place by the community to ensure minimum quality control.
Finally you didn't waste my time. I did the same mistakes some time ago and some contributors corrected me
and I'm grateful they did. Now it is my turn to give back.
Comment #6
Josh Endries commentedNo worries, I'm not offended. I agree that trust is important and code review is a decent way to measure that without ancillary information. I just disagree with denying one based solely on simplicity or LOC. It's too bad I started with such a simple module. :) I've written production e-commerce code, a nice multi-threaded shipping rate cache, cloud scale gossip protocols, backpropagating ANNs, distributed key-value stores and lots of other stuff, but that doesn't really show my mastery of Drupal which, I admit, doesn't exist yet.
As I said, I'll accept whatever decision you guys make, and maybe re-apply later after I have another module or help with someone else's module, if I end up doing that. I await your questions, comments or decision!
Comment #7
aritra.ghosh commentedHii,
Firstly after going through the discussions above, I would like to express my views.
I don't think that a module always has to serve a very complex purpose to justify its existence. I think this module works and can be a very lightweight solution. So i support this module.
Manual review:
I installed the module and prom the functionality standpoint it works fine. Also the coding standard issues has been cleaned up.
For Simplicity issue i will leave this to a git admin to decide.
marking as RTBC.
Thanks,
Aritra.
Comment #8
stborchertI'm sorry to say this after such a long time but tis project is too short to approve you as git vetted user.
We are currently discussing how much code we need, but everything with less than 120 lines of code or less than 5 functions cannot be seriously reviewed.
However, I have promote this single project manually to a full project for you so you can work with it as if you have full project access.
I'm sure you will pass another application (with a more complex module) since the code you've written looks very clean and is excellently documented.
Don't be disappointed. If you apply with a more complex module next time,
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.