This project calls the Dark Sky Forecast API to retrieve weather forecast data for any location. Settings include the user's API key, geolocation, an optional forecast period (current conditions, by the minute, by the hour, and by the day), and a value used to set cache expiration to optionally reduce the number of API calls made.
The module provides the site administrator with a block for displaying a very light-weight weather forecast. This block uses a default forecast.tpl.php template file, which can be overridden by any theme.
git clone --branch 7.x-1.x https://git.drupal.org/sandbox/thatguyerik/2747363.git dark_sky_forecast
cd dark_sky_forecast
Project page (sandbox):
https://www.drupal.org/sandbox/thatguyerik/2747363
PAreview:
http://pareview.sh/pareview/httpsgitdrupalorgsandboxthatguyerik2747363git
Comments
Comment #2
eriktaylor commentedComment #3
gisleThe automated review of your project by PAReview has found some issues with your code. As coding standards make sure projects are coded in a consistent style we ask you to please have a look at the report and try to fix them.
Also:
.gitignorein the repo you push (make it ignore itself).The theme/module comes bundled with Weather Icons (http://erikflowers.github.io/weather-icons/), which appears to be third party asset authored by Erik Flowers. Third party code/assets is not generally allowed on Drupal.org and should be deleted. It is good that you acknowledge Erik Flowers in the README, but this is not enough to comply with our current policy.
This particular asset is made available under the MIT (CSS) and SIL Open Font License (Font) license. This also violates policy, since all assets hosted on Drupal.org must be licensed under the GPL V2+ license.
This policy is described in the 3rd party libraries and content on Drupal.org. It also appears in the Drupal Git Repository Usage policy you agreed to when you signed up for Git access, which you may want to re-read, to be sure you're not violating other terms.
In order to comply with our license policy, you need to remove these assets from your repo and provide instructions to users about how to download these assets from their source and combine them with your project.
In particular, you should add the sections "Similar projects and how they are different" (see previous point) and "Dependencies". This module depends on SaaS delivered by Forecast.io. This dependency, and its associated pricing plans must be disclosed on the project page.
Comment #4
gisleComment #5
eriktaylor commentedMy apologies. I'm completely new to this, so it's a bit of a learning experience for me.
I have made the recommended changes. Hopefully this time I've met your standards.
Comment #6
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #7
eriktaylor commentedRemoved 2 paragraphs.
The Forecast IO Integration module upon further review is not very similar at all. It only serves as a wrapper around a 3rd party API for use by other modules. It does not itself make any calls to the API or output any content.
The Weather Icons icon set is no longer bundled but the module will utilize it by default if it is included in a theme. This is only an optimization and not a requirement by any means. Theme designers may override the default template to incorporate other icons, or they may choose to not use icons at all.
Comment #8
chaitanya17 commentedHi eriktaylor,
Your module looks interesting. I have done code review can you please do below fixes.
1) In
ds_forecast_get_api_url()please use url() function and use$options = array('absolute' => TRUE);as its external url.2) In
ds_forecast.admin.inc, you have usedsystem_settings_form, in this case you are not required to explicitly set variables,System form handler will take care of this.
Thanks,
Comment #9
chaitanya17 commentedComment #10
gisleThank you for adding the link to Forecast IO integration on the project page. However, there is a typo in the URL. It is "https://www.drupal.org/project/forecastio" - you've written "https://www.drupal.org/projects/forecastio", which gives a 404).
Comment #11
eriktaylor commentedThank you for the feedback. I've made the proposed changes.
I don't know if this is an appropriate forum for questions, but I have a newbie question about one of the changes I just made.
What's the purpose of the url() function for external URLs? Maybe I'm missing it in the docs, but it looks like for external paths with no querystring and no fragments, this doesn't do much other than the call to
drupal_alter()to allow other modules to alter the path and path options. But in the case of this module, altering the path would break the module. I can understand if maybe there's a module that simply wants to catch the path for logging, debugging, etc. but I would think that leaving this path open to possible changes may not be the best idea. Can you explain the benefit of doing this?Thanks again. This is turning out to be an excellent learning experience.
Comment #12
smfsh commentedAutomated Review
Passed automated review on paraview.sh
Local testing with Coder found some issues identified below
Manual Review
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
This review uses the Project Application Review Template.
Your code is super clean and well documented. The README file is detailed and easy to understand without having to cross check items against code. This module will be a good addition to the community.
A couple other things to note:
The hook menu declared to create admin/config/ds_forcast shouldn't be titled "Weather" as it's way too generic. This could be resolved by changing the path to admin/config/weather or changing the title. If left as Weather, the name of your menu in the administration area (titled "Settings") could be too generic. Consider changing this to something like "Dark Sky Settings" in case other modules want to utilize the Weather section for configuration.
Lat/Long default values might have more documentation surrounding them in the form. The values provided by default could be the users current location based on a geo location library, or alternatively, move these default values into a description field if you're simply wanting the user to have an example of what value this field takes.
Forcast period contains the word Minutely. I love this and it makes sense to me, but might be confusing to non-english speakers and wouldn't be caught gracefully with generic translation lists. You might consider checking out a discussion about this exact word at this Stack article.
Comment #13
eriktaylor commentedThanks for the feedback.
I've implemented the required changes.
I ran the argument to
form_error()throughcheck_plain()to address the potential security issue.I added an .install file to clean up everything set by
variable_set()and all cached data used by the module.I also liked your suggestions and implemented most if not all of them. I also added
'#required' => TRUEon the API key and geolocation fields to improve validation.Comment #14
webdrips commentedCode looks clean overall.
Here is my feedback:
db_delete('variable')->condition('name', 'ds_forecast%', 'LIKE')Comment #15
warped commentedThank you for your contribution!
After 2017 March 7 everyone can promote a project to a full project. A full project has a short project name and a drupal.org/project URL. It can also have releases (like alpha1 or 1.0). Edit your sandbox project, and then choose the 'Promote' tab.
https://www.drupal.org/docs/8/understanding-drupal-version-numbers/drupa...
https://www.drupal.org/docs/8/choosing-a-drupal-version/what-do-version-...
https://www.drupal.org/docs/8/understanding-drupal-version-numbers/what-...
https://www.drupal.org/docs/8/choosing-a-drupal-version/release-stable-v...
If you'd like to opt into security coverage, please ensure your module is ready for a full release, and then set this issue back to 'needs review'
Immense apologies for how long it took to get to this review completed.
Comment #16
avpadernoI am closing this application for the lack for replies. I take the OP just needed to be able to promote the project.