Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
14 Mar 2011 at 14:14 UTC
Updated:
23 May 2011 at 15:02 UTC
Jump to comment: Most recent file
Comments
Comment #1
markwittens commentedThe link to the project is http://drupal.org/sandbox/markwittens/1089220 btw.
Comment #2
Snugug commentedI've taken a quick look at this module, and your module needs a bit of work before I can continue reviewing this.
First and foremost, your .info file needs some work. A lot of work. To begin with, what version of Drupal is this for? Check out Writing .info files (Drupal 6.x) or Writing .info files (Drupal 7.x)
Once you've got your .info sorted out, I'll install it on a local copy and take a look. When you've fixed the .info file issue, change the status from "needs work" to "needs review"
Also, just as a suggestion, it's always nice to see version history in the README.txt, although that's not a necessity.
Hopefully we can get you reviewed soon!
Comment #3
markwittens commentedI committed the wrong version of the .info file earlier, the right version is in git now.
Comment #4
Snugug commentedI went to set up a trial switch, from March 21 through March 25 (today is the 21st, wanted to see how it handled that use case), and I got the following error:
Fatal error: Call to undefined function date_make_date() in theme_autoswitch.admin.inc on line 237If this is a call to a function in the Date module, you need to make that a dependency in the .info file. That being said, it does appear to have switched my theme, but I am unable to check to see if the rule is set up properly as if I go to /admin/settings/theme_autoswitch I get that error above.
While I hated this in my code review, I understand why they did it, so I'm going to do it too. A few suggestions!
Once you get the error fixed, let us know and I'll take another look.
Comment #5
markwittens commentedI added a dependency to the Date API module, the suggestions (all good points by the way!) are for later concern.
Comment #6
Snugug commentedWhen I got to enable this module through Drush, I get a few warnings and errors that seem to all be coming from one repeated function, these should be fixed.
Comment #7
Snugug commentedFirst, now that I've gotten it working, the admin menu for it looks great, simple and clean. My only note is that in the menu it gives the time the theme will switch, but they are all set to midnight giving the user the idea that they should be able to pick the time when the theme switches, which is not the case. Adding in the ability to choose the time the theme will switch will moot my point (again, something that doesn't necessarily need to be added to get approval, but something to look into adding later; could be very cool for, say. switching between a daytime theme and a nighttime theme)
An actual error that needs to be solved is, if a theme's name is greater than 10 characters, your module will not let a user use it. I tried to use the Acquia themes, both have machine names longer than 10 characters, and I got an error saying that I couldn't use them. This needs to be solved as there is no way to know the name length of every theme beforehand so hard coding in the 10 character limit will preclude the use of some themes. (Screen Shot attached)
A general question about this module, is the switch based on the user's time or the server's time?
Comment #8
markwittens commentedThe warning mentioned in #6 seems to be a PHP 5.3 related issue with Drupal and not this module specific. See: http://drupal.org/node/615438
I fixed the problem with the maximum length of a theme name, I have no idea why I put it in there but it's gone now.
To answer your question: The switch is based on the server time.
Comment #9
Snugug commentedSounds good on both counts there, going to see if this works now that the bugs are sorted out.
One thing I notice, and this is because of the assumed time of the switching, is that if you have a rule that ends on the current day and you decide to add a rule to today (like I did for testing), it won't activate the new theme. The attached screen shot will give you a more clear view of exactly what I'm talking about. I set up the 3rd rule just now, but it assumed that I wanted it changed at midnight, which has already happened, and has not changed my theme. I've refreshed a few times and the theme still has not changed. It doesn't change if I run cron either. I believe this to be a logic bug caused by the fact that the end user cannot specify the time or year they want it to change.
Another logic bug exists if you try and add a timeframe that crosses over a year, probably due to the fact that I think you're assuming that the date range will fall within the current year. I put in a timeframe from 1 December to 1 February, and the rules admin page gives me a timeframe from Thu, 12/01/2011 to Tue, 02/01/2011. I think that you should either build in a year picker or account for this through logic (I personally believe a year picker would be more versatile) in order to correct this error.
Additionally, inside your README.txt, you should put some text about needing the themes enabled in order to switch to them, possibly with a reminder that if an admin lets users switch their own themes that any theme they want to use with this module those users would be able to switch to (that is, unless you are able to make the module work with disabled themes)
Comment #10
clemens.tolboomThe function
could best be renamed into
to prevent naming conflicts and CamelCasing :p
Comment #11
joachim commentedI saw a sandbox project that does this a few weeks ago, and suggested at the time to its creator that it a more extensible way of achieving this would be to write a plugin for Context module that reacts to the date, and then use Context module's theme switching.
Perhaps you can track down that issue and see how the other author is getting on?
Comment #12
markwittens commented- Renamed _getEditLinks() to _theme_autoswitch_get_edit_links()
- Added a bit of info to the readme about the themes being required to be enabled.
- I did not add support for time based switching yet, it would be a great feature but that's for later. I did however remove the year and time from the list to avoid confusion about this. If the selected end day is before the start day it will work, it just didn't show up right in the list because the year presented was always the current year.
- Switching back will happen at the end of the selected end day, so in the case of snugnug the second rule will never execute since it starts before the end of rule 1 and ends before the start of rule 3. This is by design and makes sense if you think about it.
- @joachim this module is meant to be lightweight and easy to use, adding it as a plugin to another module will result in (imho) unnecessary overhead.
Comment #13
markwittens commentedComment #14
ccardea commentedSecurity review:
No security issues noted. I just took a quick look at this because others seem to have put it through the ringer. The author seems to have a good understanding of Drupal, coding style is good, documentation is good. I see no reason why this project should not be approved.
Comment #15
ccardea commentedComment #16
joachim commentedSee my comment in #11.
Comment #17
ccardea commentedI don't think our job is to hold up applications because we think they should be implemented a different way, unless there is a problem with overall understanding of Drupal APIs. I don't see that in this case. Since we have a disagreement, we'll have to get an admin to take a look at this.
Comment #18
joachim commentedPart of the review process is how a new project fits in with Drupal's ecosystem as a whole, and how it contributes to that ecosystem. My suggestion would make this a much more powerful and reusable piece of code.
Comment #19
ccardea commentedOriginially posted by webchick. You can read the whole post here.
This is the best 'big picture' guidance we have on the project application review process. I think that what you have done here is part of the problem with the review process. You've substituted your own judgement as to how this should be implemented. That's not what code review is about. There are no real problems with this project. If you want a context plugin, then you should write it, and users will decide what they like better.
I'm changing the status to RTBC, because it needs the attention of an admin at this point. Please let the admin make the decision as to whether he/she will grant full project status or send it back to the drawing board. I've contacted zzolo on this. If you know other admins maybe you should contact them too.
Comment #20
zzolo commentedHi @ccardea and @joachim. Just wanted to throw my two cents in. IMO, you are both right. We should be allowing this application to go through (given security, coding, and best practices), but should be very helpful in telling them how they can improve it, by using other modules, like Context. The key is to provide links and more help so that the user would be more inclined to do it in the long term.
Indeed, this would be a much more extensible and more adoptable module if it was done in Context, but I don't think it's something to hold back this application.
This is just my opinion. Unfortunately this process is still very subjective. I would suggest checking out the Goals wiki page and commenting or adding to. Ideally this would be a resource I could say is definitive, but its not there yet.
Thanks to both @joachim and @ccardea for putting in time to review this, and to @markwittens for the patience.
Comment #21
zzolo commentedOh, sorry, here the link to the Process Goals: http://groups.drupal.org/node/142459
Comment #22
joachim commented> Indeed, this would be a much more extensible and more adoptable module if it was done in Context, but I don't think it's something to hold back this application.
Yeah, that's fair enough.
Comment #23
dave reidDoes this already duplicate http://drupal.org/project/themekey and its "a date/time-selected Christmas theme" condition?
Comment #24
sarah_p commentedComment #25
dave reidThis is not a theme :)
Comment #26
markwittens commentedOk, and now what? Do I need to do something since the status is set to "needs work" again?
Comment #27
dave reid@markwittens: Please see #23. Can you investigate if your code duplicates the Theme key module and its time/date condition? Or if it doesn't provide an accurate description as how your module differs from that feature?
Comment #28
markwittens commented@Dave Reid: I think it doesn't really matter if the Theme Key module provides a similar feature, my module is all about being a lightweight and easy to use module. Personally I don't like installing a large module just to use a small feature of it if there is a way simpler version out there that does the same thing (the more features the more code, and the more code the larger the chance of errors and possible even security problems). Also, I have searched for a module that could do this before I made it and if I couldn't find it back then others might miss it too. I heard there was a discussion about this thread, I'm not sure if you are aware of this so here is the link: http://groups.drupal.org/node/149419#comment-496094
Comment #29
ccardea commentedComment #30
dave reidFrom the Application review process for Full Projects; what to expect:
Comment #31
markwittens commentedI haven't written a simpler version, I made this version in the understanding there wasn't anything yet that could do this. Anyway, let me know when you guys are all on the same page since I'm getting really tired of seeing this thread moving from whatever status back to "needs review" or "needs work".
Comment #32
ccardea commented@markwittens
I think you need to know that Dave Reid is a git administrator, with the power to grant you vetted git user status. He asked you twice now, (#23 and #27) to investigate the duplication issue with Theme Key and provide an accurate description of how your module differs from that feature. Your answer in #28 was not sufficient. It is irrelevant that you think it doesn't matter, what is relevant is that Dave Reid thinks it does matter. So if you want your project approved, I suggest you rethink your previous answer.
Comment #33
markwittens commentedI have applied over a year ago and have been very patient in my humble opinion but I think I can use my time better to improve my modules just for myself and the company I work for instead of going through this endless procedure.
With a sincere apology to the community I'm closing this ticket and I give up. I hope modules from other developers get accepted easier because without module developers Drupal won't stay what it is today for long.