This module is a set of a base component and products to integrate with drupal core. The Blizzard Community Platform API enables communication with the RESTful APIs exposed through the World of Warcraft community site.
This module is only available for Drupal 7 and the first release only support Character, Guilds and Rank management. The code is tested and more work is needed to cover all the features. The module is used in production on the live demo website provided on the project page.
Here is the project page: http://drupal.org/sandbox/SylvainLecoy/1256604
Here is the git repository: http://drupalcode.org/sandbox/SylvainLecoy/1256604.git
Here is the production website: http://shinsen.fr/
Please feel free to ask any questions or make remark about the code, copy or architecture.
Regards,
Reviewed projects:
http://drupal.org/node/1510636#comment-6095886
http://drupal.org/node/1424990#comment-6095960
http://drupal.org/node/1352698#comment-6095992
Reviewed projects:
http://drupal.org/node/1364772#comment-6139226
http://drupal.org/node/1578310#comment-6142588
http://drupal.org/node/1570606#comment-6142598
Reviewed projects:
http://drupal.org/node/1637314#comment-6147710
http://drupal.org/node/1432692#comment-6147778
http://drupal.org/node/1579858#comment-6147808
Sylvain Lecoy
| Comment | File | Size | Author |
|---|---|---|---|
| #53 | drupalcs-result.txt | 14.64 KB | klausi |
| #48 | drupalcs-result.txt | 21.33 KB | klausi |
| #43 | drupalcs-result.txt | 13.75 KB | klausi |
Comments
Comment #1
sylvain lecoy commentedHere is actually the project page: http://drupal.org/sandbox/SylvainLecoy/1256604
Comment #2
patrickd commentedIt appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.
Source: http://ventral.org/pareview - PAReview.sh online service
Comment #3
sylvain lecoy commentedThanks for the review,
I fixed the master branch and deleted it. Now working on 7.x-1.x branch.
I added a README.txt text file for the module.
I removed the version field in info files.
I corrected the line ending to be UNIX friendly.
However, for namespace, I'm afraid that I used the right namespace for each of my submodules. Maybe because my project contains submodules it creates a bug saying submodules namespaces are not correct. For the submodule 'guild_rank'; functions are prefixed with 'guild_rank', same for character and guild. If I miss something really obvious please help because I don't know how to fix this.
Sylvain Lecoy
Comment #4
patrickd commentedYep your' right, seems like false positives.
IMHO your submodules sound a little unspecific, maybe something like blizzard_guild would be better ? just a suggestion.. ;)
Comment #5
sylvain lecoy commentedIn the first version I prefixed all submodules by wow_ :
But I started to stop this because of the length of hooks, for instance I have a hook in characters, called
character_presave. This is hooked up in the guild_rank module to update guild ranks:guild_rank_character_presave. Also the file is simply:guild_rank.character.inc.If I had to prefix all submodules by wow_, this would give:
wow_guild_rank_wow_character_presavewhich looks a bit silly, in a file calledwow_guild_rank.wow_character.inc. If this is a namespace problem I will consider prefixing submodules, if its not, I'd like to keep the name I given them.Sylvain Lecoy
Edit: Actually I don't know, you're right 'wow_guild' sounds more specific, however, if you install this module, its likely to integrate World of Warcraft so I think guild and character entities do not need more specificity.
Comment #6
patrickd commentedSee http://ventral.org/pareview/httpgitdrupalorgsandboxsylvainlecoy1256604git
Comment #7
patrickd commentedSwitched back to needs review, so in-depth reviews won't be blocked by coding standart issues.
Comment #8
sylvain lecoy commentedOk thanks !
Any reviewers ? :)
Comment #9
sylvain lecoy commentedAny news please ?
Comment #10
jthorson commentedRegarding comment #5, I'd suggest adding the wow_ prefix to your submodule functions, even if it starts to look a bit silly.
The reason behind this suggestion is so that users who are attempting any customization or extension of your module's functionality can look at the main module file to determine your function naming pattern; rather than needing to look at every submodule in order to avoid declaring any duplicate php function names.
As an example, if I were to attempt to build some additional enhancements or functionality in a custom module after installing this one, I would initially assume that you are following common Drupal naming patterns, and using the 'wow_' prefix consistently throughout your module and submodules. Based on this assumption, I may decide to name my custom module 'guild', thus creating the possibility of namespace collisions with the php functions in your guild_rank submodule.
Comment #11
sylvain lecoy commentedHello jthorson and thank you for your time,
I have been thinking a long time to prefix or not submodules,
Eventually, I have been looking at drupal namespaces:
Thank you for having reading me, I hope this is not a blocker for the review process as it has not blocked other contributed modules nor core by the past.
Sylvain Lecoy
Comment #12
jthorson commentedThe difference between your examples is that (in contrib) the field types are packaged as seperate modules ... address, name, etc can all be downloaded individually. These are 'field modules', but they are not 'submodules included in the field module package'.
The pattern I'm strongly suggesting is "one download, one namespace". The fact that there are other projects that don't follow this pattern is irrelevant to the application and/or recommendation ... we can go back and forth all day finding exceptions to best practices; but one of the goals of this process is to educate and enforce best practices in a new contributor's initial module.
Once approved by this process, contributors are granted free reign to produce new modules without review or restriction; and plenty of non-best practices are introduced into contrib due to this freedom. Since this application process is the only touch point where we can actively educate applicants and encourage best practices to be used once the applicant is released into contrib, reviewers will tend to stick to their guns and enforce these practices to their full extent. Arguments that 'Contrib module X did it this way' don't really carry much weight from this perspective.
That said, we also recognize that interpretations can differ from person to person, and what one might take as a strong opinion might be consider trivial to the next ... so we do offer a forum for discussion the best practices themselves (and/or a place to request a second opinion if a debate arises with a reviewer) ... please feel free to raise this debate at http://groups.drupal.org/code-review, so that it can be discussed and tracked outside of this individual application (and so the discussion can be easily found the next time the same issue is raised).
Your 'these namespaces aren't taken' comment reinforces the point ... the guild namespace isn't taken at drupal.org/project/guild ... but how can you easily confirm or prove that it hasn't already been taken as the name of a 'sub-module' in another project?
Comment #13
sylvain lecoy commentedWell I didn't know that ctools wasn't respecting best practises. Don't get me wrong, it is not to compare with another contribs, I have taken this example because I thougt it was the proper way to do things. When you don't know, you look at how other people did, that is something I had in mind by looking at core and other contribs, and when I looked at other people code, I learned from them. Now that you say me that i'm probably wrong, I will listen to you and correct my mistakes but do you have any link where I can find some written rules about submodules naming ?
Thank you for your explaination, do you suggest that I need to refactor submodules ? And in this case, what about entity naming ? Should it be a 'wow_character' entity instead of a 'character' entity ? Or do you suggest to separate wow base module and provide a suit of modules called 'character', 'guild', with their own namespace.
About the question that you asked me, I can't confirm or prove that it hasn't already been taken in another project. However, I understood that the review process should not allow this.
Edit: I have found something here http://groups.drupal.org/node/21725 and it seems that its only a recommandation,
Comment #14
jthorson commentedMy concern would be primarily with php function names, as a duplicate function name can take down the entire site. I'd also recommend that at least 'character' be namespaced, as 'character' is a pretty generic term that can mean any number of things outside of the scope of WoW or RPGs, and thus the possibility of collisions is higher. Based on this, and from the perspective of consistency, the rest should thus probably be prefixed as well.
Your correct that this is only a recommendation, which is why I've used the term 'suggest' and not bumped your application down to 'needs work' because of it. But I would say it is at least enough of a convention that whether the resulting function name looks silly should not be part of the decision process. :)
Comment #15
sylvain lecoy commentedYes you are right, character is pretty generic, as well as guild. A WoW Character is really different that any other characters and this is the same for guild.
I am about to modify the following things:
- rename guild module to wow_guild.
- rename character module to wow_character.
But now, to keep it consistent, I will need as well to refactor entity name 'character' to 'wow_character' and SQL table from 'characters' to 'wow_characters', same for 'guild' entity to 'wow_guild' and 'guild' table to 'wow_guild'.
What about the rest of the module, did you actually looked at the code ? Security issues and so on ?
I'll let you know when the refactored module will be uploaded.
Thank you for your time,
Sylvain Lecoy
Comment #16
sylvain lecoy commentedSeems it will be longer than expected, is the review process blocked until I commit the refactored version ?
Comment #17
jthorson commentedWe'll leave it in 'needs review', since it hasn't yet received a true in-depth review yet ... most reviewers will read the history as well, so should see the above conversation. (That said, be patient with them if they don't!)
Comment #18
sylvain lecoy commentedI corrected the following:
- Changed sub-modules name to be prefixed by wow_.
- Corrected a timestamp bug preventing manually refreshing a guild info.
- Added dynamic translation for service related strings.
- Added 'HIDDEN = true' in the info file so old modules cannot be installed by mistake.
Tested upgrade path.
Tested on new install (locale).
Tested on live server (http://shinsen.fr).
Comment #19
sylvain lecoy commentedHi again, I would really like to know if I can find help somewhere to review my module.
I have nearly no code issue (scanned with the coder module), changed the function submodule namespace. Also I created a detailled project page, a demo website, the code is clean and documented, I have also written some test.
Is this not sufficient to review my module ? Nearly two months without any serious reviewer... Is there anyone here to review my module, then I review back his module. Is this how it works or the reviewer needs to be approved by a certain authority ?
Let's help us together, I pledge I will be a focused, in-depth reviewer :)
Comment #20
jthorson commentedThe way it works is that anyone can review and mark RTBC, and then a 'Git Admin' will visit and approve the application (or bounce it back to needs review if any issues have been overlooked). If you'd like to solicit another member of the Drupal community to review your application, they can find review guidelines and other information at http://groups.drupal.org/code-review
Unfortunately, there are around 150 projects awaiting reviews at any given time, and only a small handful (3-10 volunteers) of active 'deep-dive' reviewers ... so the wait in the queue can be somewhat frustrating.
While the longest wait between responses currently being experienced is in the neighborhood of 3-4 weeks, the good news is that this is a vast improvement over 6 months ago, when the wait for some applications could grow to three times that. :( Rest assured that the delay is simply a function of an overload of applications and too few reviewers ... and should not be interpreted as a lack of interest in your particular project.
Thanks again for your patience!
Comment #21
sylvain lecoy commentedIf I create a second account I can trick the system and review myself ? :p
Its not that I want to cheat but this module open possibilities, and I have already a suit of modules depending on this one to help people build guild website. It was ready in september, I submitted it in november 2011 and we are approaching march 2012 :(
I have already developped two modules depending on this one:
- EPGP: EPGP is an Effort/Gear reward system and addon for World of Warcraft.
- WoW Forum: This module adds guild forum capabilities. (such as avatar for your character, fetched from battle.net)
Comment #22
patrickd commentedHave a look at #1410826: [META] Review bonus to get a review quicker
Comment #23
sylvain lecoy commentedI think the code I written is drupal compliant.
I put it as RTBC after a deep review of myself.
Comment #24
jthorson commentedLarge suite of modules, leveraging multiple Drupal Apis, active repository, and waiting way to long ... Only did a partial review, but what I saw looks good. I'm willing to suggest we make this happen.
Comment #25
jthorson commentedOn second thought, I don't see a single sanitization function in the theme character code ... And since I can't really do a proper deep dive review on a tablet, I can't confirm whether this lack of check_plain or filter_xss calls in the theme components is covered elsewhere - and thus can not second you're RTBC claim at this time. (And I don't think I need to point out that, despite the wait and understandable frustration, marking your own issues as RTBC without review is heavily frowned upon in the Drupal community.)
Comment #26
jpontani commentedOn page admin/config/wow/guild, I chose "Lightning's Blade" and set my guild to "Section Eight". This brings up an error of "The guild name Section Eight does not exist on Lightning's Blade. You should first check that your guild exists at: http://us.battle.net/wow/guild/Lightning's Blade/Section Eight/."
You are not URL encoding spaces, so it is causing an error when trying to wow_http_request anything with a space (realm name or guild name would cause this).
Comment #27
sylvain lecoy commentedThanks jthorson for your partial review, I will check the theme flow and provide answer for the lack of check_plain.
Thanks jpontani for the bug report, I will fix this asap.
Comment #28
sylvain lecoy commentedJpontani things has been fixed. However, its because it was written in the doc of drupal_encode_path that the url function was taking care of properly encoding path. I checked this and in fact it seems not.
Its now using drupal_encode_path before any API calls. Thanks for the feedback !
Comment #29
sylvain lecoy commentedHi again, the check_plain or filter_xss is not needed in the theme layer for character and guild, let me explain why. But please correct me if you feel its wrong..!
The only place where I use check_plain is against database call with the input as key (name for instance). Otherwize, each time a character, a guilde or an item is updated, it get checked by the API call to battle.net. If the call return an error, it will be not updated.
That means that if a player name is erroneous (e.g. not valid for the API), it will never get created on local database. Here is a good example:
However, I found out that it needed some work for guild ranks, and effectively I didn't covered the check_plain in the theme layer. If there is no need for characters or guilds (I believe), you are right that it need some input check for guild rank name and other input that I didn't thougt about.
Comment #30
sylvain lecoy commentedI think It's ok after double checking of my theming functions.
Comment #31
sylvain lecoy commentedHi I got a
Validation error, please try again. If this error persists, please contact the site administrator.
This content has been modified by another user, changes cannot be saved.
when I try to modify the description to update with the recent work I did. Who should I contact ?
Thanks.
Comment #32
sylvain lecoy commentedOk I eventually updated the doc and added the wow_item module as a working Proof of Concept. It need more work of course but this module ensures the basics such as entity representation and integration with Drupal. Items supports localizations and I updated the project page to reflect the new changes.
Also, I am very sad that this project is locked since 5 months; I am regularly fixing bug, testing it live and adding features. I will maintain it and keep working hard on it. But as you know, like at work, if there are no users to test the application, I can't make it a really solid foundation.
Quality API takes a long time to be made, but it starts with a good pool of users, that I can't have for now :(
Please consider my request and if you manifest any interest in my work, please do review :)
Comment #33
exlin commentedHi,
I found following
1. In wow.install file you delete same variable on hook_uninstall as you do in wow_update_7000 witch seems unnessessary since if module is updated there is no longer variable to delete and if module is not updated that hook_update_ won't be executed.
2. param $host is not existing
3. Please consider using drupal_json_decode instead of json_decode. It's basically the same, but you will get array.
4. If you set your own variables, please delete them in hook_uninstall, check all forms and make sure you delete variables saved by them
5. Please document your custom hooks in *.api.php, see http://drupal.org/node/161085#api_php
Other than that, it looks nice (and big) module and hopefully we get lot of guild-pages to Drupal ;)
Comment #34
exlin commentedYou should also check http://ventral.org/pareview/httpgitdrupalorgsandboxsylvainlecoy1256604git witch an help you to see Drupal coding style issues.
Many of those propably can be skipped, but following coding style helps readability.
Thanks for your patience.
Comment #35
sylvain lecoy commentedHi and thank you exlin for your review.
I will work on 1, 2, 4, and 5.
However, I am not sure about using:
Instead of:
Comment #36
sylvain lecoy commentedFixed: point 1 to 5 (excepted 3).
Fixed a lot of coding style issues, including bad line endings to UNIX style. (see the commit log for details).
Comment #37
sylvain lecoy commentedAny update ? :(
Comment #38
sylvain lecoy commentedHi there,
I followed all your recommandation, scanned multiple times the git repo to ventral for coding style issue. Refactored namespace to avoid potential collisions with other modules. Even in the development version I provided upgrade path to show you that I understand drupal core and best practises. I started development on June 2011. Comitted to drupal in November 2011. User test would help me to know if this module is heading the good direction, as well as community feedback. I know some of you completely doesn't care about gaming, but I need a serious review to publish my work and improve this module API.
Please I have waited enough time now, nearly 7 months waiting in the project application list.
Sylvain Lecoy
Comment #39
jthorson commentedRe: #29: Because the API call is not within the scope of your module's control (i.e. it is a 3rd party API call), it should not be inherently trusted as you have suggested. I would still stand by the suggestion that you need to sanitize on output. (EDIT: Or at least on the DB Select as in your posted example .. but for all items.)
Please consider that there are about 450 other projects in the queue sitting either in 'needs work' or 'needs review' in the queue, and about 70 of those have been in there longer than your project. We realize that the wait is unacceptable, but do the best with the volunteer manpower that we have.
This delay is a bit part of the reason why initiatives such as http://drupal.org/node/1410826 have been introduced ... many applicants have jumped on board with the attempts to help improve the situation; if you are frustrated with the delay, I can only recommend you pursue the 'PAReview Bonus' as well (which will result in certain reviewers granting your project increased priority when reviewing).
Comment #40
sylvain lecoy commentedAdding PAReview bonus as suggested !
Comment #41
klausiRemoving review bonus tag, you have not listed any reviews in the issue summary as specified in #1410826: [META] Review bonus.
Comment #41.0
klausiUpdated issue summary.
Comment #41.1
sylvain lecoy commentedAdding review projects
Comment #41.2
sylvain lecoy commentedAnother review
Comment #42
sylvain lecoy commentedAdded three manual reviews..!
Comment #43
klausiThank you for your reviews. When finishing your review comment also set the issue status either to "needs work" (you found some problems with the project) or "reviewed & tested by the community" (you found no flaws).
Review of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
require_once dirname(__FILE__) . '/mymodule.inc';. Applies to all module_load_include() calls in your project.The security issues are blockers, so I have to set this back to "needs work". Overall the code looks good so I think we are nearly there. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #44
sylvain lecoy commentedThank you for the review:
1) Considering that drupal_json_decode make call to drupal_json but asking to return explicitely an array, which is not what the service is returning (object) and not the type that the module is expecting (object). I see absolutely no reasons of using this function.
2) Fixed.
3) Fixed. Also elsewhere.
4) Fixed.
5) Fixed.
6) Fixed: Added check_plain for $name. However Form API take already care of $realm value since it comes from a dropdown.
7) Fixed: Replaced some of ! with @, added check_plain for remaining !.
8) I will actually implement this module.
9) Fixed. Need support however: What if I'm on a submodule calling parent module ? e.g. wow_character module including wow.inc file ?
Comment #44.0
sylvain lecoy commentedAdded a third review.
Comment #45
sylvain lecoy commentedPush back to need review.
Comment #46
klausiPlease don't remove the security tag, we keep that for statistics.
Comment #46.0
klausiAdded one project.
Comment #46.1
sylvain lecoy commentedAnother reviewed project.
Comment #47
sylvain lecoy commentedWhat do you mean by statistic ? What is this tag semantic ? I thought it was because my project contained security issues, but now that I have fixed, I should remove it no ?
Did 3 manuals reviews, so pushing back the "magic" tag. All the fixed issues since #43 has been fixed in the last commit (http://drupalcode.org/sandbox/SylvainLecoy/1256604.git/commit/f98823c66e...).
Comment #48
klausiThe "PAReview: security" tag is used to get an estimation how many project applications contained security issues and to show examples of security problems.
Review of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
Although you should definitively fix those issues I think my points are no blockers, so I say RTBC. The user name security issue is minor as most special characters are forbidden anyway in standard Drupal installations. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #49
sylvain lecoy commentedFixed in: http://drupalcode.org/sandbox/SylvainLecoy/1256604.git/commit/fcf09668f3...
Comment #49.0
sylvain lecoy commentedThe third review;
Comment #49.1
sylvain lecoy commentedAdded pagerer.
Comment #49.2
sylvain lecoy commentedAnother review
Comment #50
sylvain lecoy commentedI did another 3 reviews.
Please consider that this project is waiting since almost 10 months. I can't really improve on features if I have no real users;
Regards,
Sylvain Lecoy
Comment #51
MattA commentedAfter installing this module on a fresh install here are some things I've come across after giving the module/code a quick glance (using commit aec336bf):
Miscellaneous bugs:
Project issues:
In wow_item.install your hook_uninstall() implementation does not cooperate with other modules. You're technically using the Drupal 7 equivalent of the code fragment shown on that page.
While the sub-modules in this project seem to be fairly unique, could you explain how the main module is different from this project: Blizzard API?
Comment #52
sylvain lecoy commentedHi MattA,
Thank you for this detailled review.
The bugs was due to missing file in the git index. I fixed that and cleaned-up the test functions in the middle of nowhere.
About the Item Resource declaring a field, this is a more general bug fixed in D8 (see this issue: http://drupal.org/node/943772), and which is being worked on D7 (http://drupal.org/node/1284332). This is sadly a bug coming from drupal itself and not the module. I have however added a warning on the project page and in the README file.
About the project issue: It does cooperate with other modules, the wildcard matches all declared variables in the namespace of the module, 'wow_item_classes:%'.
The main module is a framework, not a product. Blizzard API is a wrapper to the API, it does not integrate to drupal system, letting developper some freedom. His module contains some interresting feature such as tabard creation, and seems really well-coded, with a lot of feature that we should maybe merge, depending on the wishes of the author and the direction he wants to take. Also he got lucky that his project got accepted before me, comparing the date of sandboxed projects (Posted by Sylvain Lecoy on August 22, 2011 at 5:19pm, and Posted by MattA on August 27, 2011 at 2:20am) it seems its a cross posting so the same question can echo on his side ;)
Sadly work has started on both side since almost 10 months yet and we cannot throw away one of the two module. Anyway the separation is clear to me: Blizzard API is a service wrapper. Blizzard Community Platform API is a framework which integrate with drupal. Two different goal, one with a lot of freedom for developer, the second offers persistence, user roles integration, etc. Although we have two different visions, and I have to admint that I am a bit frustrated after waiting for 10 month (still not accepted) where his module got accepted in only 2 weeks, I am open for joining forces in a future version.
Comment #53
klausiReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
Still some code style errors, but no blockers. RTBC again.
Comment #54
sylvain lecoy commentedActually MattA I just realized you was the current maintainer.
I had a thought this night and I am really exciting into collaborating with you. What do you think if you handle the service side, while I handle the drupal integration and persistence side ?
I am thinking about having a set of high quality interfaces that your services class implements. Then the modules uses these interfaces in all functions. It also allows us to work on a focused part. I am thinking about using drupal entity module (included in D8) to support class on entities (e.g. a user is no more a generic object, but a User. Here its basically the same for a Character, Guild, etc.).
This would go in a future release, such as 2.0, or for D8.
I also have an echo-system of modules to use with the API, for instance EPGP module (http://www.epgpweb.com/help/system) is already developped.
There is a lot to improve, tell me what do you think ?
Regards,
Sylvain Lecoy
Comment #55
misc commentedThanks for your contribution, Sylvain Lecoy! Welcome to the community of project contributors on drupal.org.
I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.
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.
As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.
Thanks to the dedicated reviewer(s) as well.
Comment #56
misc commentedComment #57
MattA commentedOverall, any unresolved bugs may or may not become issues for your project later on. However, they aren't a priority for this review.
As for the module comparison, the goal was to check your awareness of Drupal's collaboration over competition ethos. Throwing away one of the modules would be a bit drastic!
Also, this guy beat everyone, but sandbox projects aren't "existing solutions" to compare against, especially since there are a lot like his with no code in them. Still, waiting around for 7 months (this issue and your first commit were on Nov 23) really sucks. As Blizzard API became a full project on Oct 17, I guess the early bird really does get the worm. =/
That said, it looks like your wait is over. Congratulations!
Comment #58.0
(not verified) commented3rd review.
Comment #59
avpadernoComment #60
avpaderno