Drupal Core Version: 7
Sandbox Project link: http://drupal.org/sandbox/jared_sprague/1866090
git repo: git clone http://git.drupal.org/sandbox/jared_sprague/1866090.git services_content_lock
Original Services Issue: http://drupal.org/node/1866136
Overview
This module exposes the main operations of content_lock through Services as a resource, so that content locking can be done over a web service API such as REST for mobile applications or thrid party integrations. The main operations it currently implements are retrieve, create, and delete.
Installation and Testing Video
Step-by-Step Instaillation and Testing Video (Best viewed in HD 720p)
Documentation
Services Content Lock Documentation
Reviews I've done
http://drupal.org/node/1846814#comment-7166712
http://drupal.org/node/1940684#comment-7170018
http://drupal.org/node/1191490#comment-7170236
Comments
Comment #0.0
jared_sprague commentedAdding section for review bounus reviews
Comment #1
theodorosploumisHi jared_sprague.
1. Pareview
pareview gives almost no errors.
WARNING | Line exceeds 80 characters; contains 81 charactersis pretty minor issue. So there are no errors from here.2. Documentation
Move the documentation from the pdf file into Drupal Documentation pages. Write the documentation on the proper category for example at "Connecting to other Sites, System and Data" with a book node structure. This will make the documentation more useful and accessible for users as also as will leave space for comments, tips and proposals. See more at 5. of "Best practices for creating and maintaining projects".
3. Project page
Please move the "Dependencies" section after "Description", then show "Install" and finally show "Use Case Example".
You may, also, do the same on the README.txt
Generally, it is better if you can follow the D.O. "Tips for a great project page". According to this guide "Description" should be "Overview", ""Dependancies" should be "Requirements" etc.
4. services_content_lock.module
Please add translation support for strings. Lines 15, 25, 32, 42, 49, 59 of services_content_lock.module. You already did that for other functions of the module.
Example WITHOUT translation support:
'help' => 'Retrieves info about a lock',Example WITH translation support:
'help' => t('Retrieves info about a lock'),5. Coding Standards
Your code seems clean and well written.
Furthermore, try using a common coding style for quotes all over the module files. For example try using single quotes (') instead of double quotes (") except if necessary. See more at Coding Standards.
6. Drupal API
Function on line 35 of services_content_lock.inc can be written with a shorthand according to Drupal API db_select () documentation. Is there any reason you chose to split the functions?
Comment #2
jared_sprague commentedHi TheodorosPloumis!
Thank you so much for the review! I've completed the work on all the items you suggested, here they are listed:
Pareview
Fixed the few lines that were over 80 characters
Documentation
Moved the documentation here: http://drupal.org/node/1933330
Project page
Fixed up the project page and README.txt files per this suggestion.
services_content_lock.module
Adding missing t() functions.
Coding Standards
Now all quotes are consistent and only single quotes. Nowhere is double quotes required.
Drupal API
This was the only item I left unchanged. I was under the impression that this is the correct and secure way to use the database API.
Testing
Testing is actually very simple. All you need is a basic understanding of REST and CURL, access to a Bash Shell, and follow the installation steps above and use the example testing Bash scripts provided in the documentation here: http://drupal.org/node/1933330
Please let me know if you have any questions about testing!
Thanks!
Comment #2.0
jared_sprague commentedAdded some install steps
Comment #2.1
jared_sprague commentedupdated based on the review
Comment #3
theodorosploumisI am back. I studied a little the Services API just to check the codes. Here are some minor issues and a propose.
1) Project page
- Remove the "Documentation Services Content Lock Documentation" section or make the link open on the same window (Drupal.org rules)
- Try to make all the links relative (Content style guide)
2) services_content_lock.module
- line 5 should probably go out. You only need @file and a description for the starting comment (the same for line 4 of .inc)
- lines 26, 60. Since
path => 0refers to an index its value needs no quotes. Althought it works right now the correct code should be:'source' => array('path' => 0),There is an issue for that actually, #1917432: Relationships' source arg (path) only accepts numeric values.
3) services_content_lock.inc
- There are some inline comments inside function (lines 43, 65, 106). This is probably a not good commenting method. You can move these comments out of the functions.
- You can shortcode the function on line 114 without problem. Drupal core blog for example does it already.
4) Local testing
- I tried to test it but had no luck. I do not know much about xml-rpc and REST and I always got errors like "Parse error. Request not well formed..." (with XML-RPC server) as also as Access denied for Anonymous user (with REST)...
Cookie is the sid on the {session} table of drupal installation? I think I am making the mistake with Cookie value on the example script.
Comment #3.0
theodorosploumisadded testing section
Comment #4
jared_sprague commentedHi TheodorosPloumis!
Thanks again for looking at my module! I've implemented all the suggestions so please do a
git pull.You had some great suggestions, my responses below:1) Project page
- Documentation link, no longer opens in a new window
- All links changed to relative links
2) services_content_lock.module
- removed the unnecessary lines from the top comment block of both files
- removed quotes from so it's now: 'source' => array('path' => 0),
Great catch!
3) services_content_lock.inc
- moved inline comments out of function arg list
- changed the db method to shorthand like suggested thanks!
4) Local testing
- I thought a lot about this. Setting up for testing REST services can be complicated and if you miss one step even slightly the whole thing won't work. So I decided to record a step-by-step video that walks through installing and testing this module from scratch.
Installation and Testing Video!
Step-by-Step Instaillation and Testing Video (Best viewed in HD 720p)
I also Added this video to the Project page.
Thank you for the tip about exporting the endpoint that was a great suggestion!
Let me know how the testing goes!
Comment #5
theodorosploumisEverything works great now! The video is great!
My only concern is any security issues the examples folder may have but I do not know much about .sh files and REST. Probably there will be no issues but this can be tested by a Review admin.
Comment #5.0
theodorosploumischanged link
Comment #5.1
jared_sprague commentedtriming down
Comment #6
jared_sprague commentedExcellent!
Good point about the examples/ directory. I added a .htaccess file to that directory to prevent, indexes, file access, script execution of .sh files in that directory.
I also added a note to the Project page and README.txt that it's a good idea to delete that directory on production environments since it's not used.
Comment #6.0
jared_sprague commentedtrimming down
Comment #6.1
jared_sprague commentedfix
Comment #7
jared_sprague commentedI completed 3 reviews yay! So added the review bonus tag, hopefully since this is already RTBC it can get assigned to an admin now.
Thanks! :)
Comment #8
klausimanual review:
But that are not application blockers, so ...
Thanks for your contribution, jared_sprague!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
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.
Comment #9.0
(not verified) commentedadded reviews