The Commerce Availability module is a booking system for rental products. It provides an easy way of using a datetime picker field on a line item to show and change states automatically of an availability calendar field in a type of a Drupal Commerce's product variation.
This version is based on 7.x-4.1 version of availability_calendar module and tested with Drupal Commerce Kickstart 2 distribution.
Project page:
https://drupal.org/sandbox/inakilz/2163399
Link to repository:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/inakilz/2163399.git
Pareview results:
http://pareview.sh/pareview/httpgitdrupalorgsandboxinakilz2163399git
Manual reviews of other projects:
https://drupal.org/comment/8352081#comment-8352081
Comments
Comment #1
xqus commentedHello,
Thank you for your contribution. Here are some quick issues to get us tarted:
* The git clone is your personal git URL. This is your public Git clone command:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/inakilz/2163399.git* You should delete your master branch, according to https://drupal.org/empty-git-master
* In your .module file: module_load_include('inc', 'availability_calendar', 'availability_calendar');
Is it necessary to always include this? Or can you move it to the functions that needs it to save memory?
Also, please take a look at the automated code review results here:
http://pareview.sh/pareview/httpgitdrupalorgsandboxinakilz2163399git
Comment #2
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 #3
ram4nd commentedComment #4
inakilz commentedComment #5
inakilz commentedComment #6
inakilz commentedComment #7
inakilz commentedThanks for the remarks. I fixed all warnings reported by PAReview project and I made all changes you suggested.
Comment #8
inakilz commentedComment #9
inakilz commentedComment #10
inakilz commentedComment #11
amreana commentedManual review:
When i try to enable the module with drush i get this error:
And i see in your info file you have "dependencies[] = availability_calendar" but i see this isn't a module on drupal.org so you cannot include it here like that.
Comment #12
inakilz commentedHi amreana,
The project name is Availability Calendars but the module name is like in my dependences definition: availability_calendar
You can find it here:
https://drupal.org/project/availability_calendars
Regards.
Comment #13
inakilz commentedComment #14
inakilz commentedComment #15
inakilz commentedComment #16
inakilz commentedComment #17
inakilz commentedComment #18
inakilz commentedComment #19
inakilz commentedComment #20
inakilz commentedComment #21
inakilz commentedComment #22
inakilz commentedComment #23
inakilz commentedComment #24
klausiRemoving review bonus tag, you have not done all manual reviews, you just posted the output of an automated review tool. Make sure to read through the source code of the other projects, as requested on the review bonus page.
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 major flaws).
Comment #25
inakilz commentedComment #26
inakilz commentedComment #27
garethhallnz commentedA very small change in commerce_availability_fill_gaps function
You set $availability = array_merge($availability, $gaps); but then the variable is only used one time.
I suggest you just return the result
#143 - $availability = array_merge($availability, $gaps);
#144 - return $availability;
#143 + return array_merge($availability, $gaps);
Comment #28
inakilz commentedThanks garethhallnz.
Updated and fixed some bugs when line items are deleted from the admin page order.
Comment #29
inakilz commentedComment #30
ram4nd commentedComment #31
inakilz commentedThanks ram4nd.
Fixed file permissions.
About use define, I think the code is clearer this way.
Comment #32
ram4nd commentedBut then it reads the variables in from database on every page load, not when the functions are called.
Comment #33
pfrenssenDon't use abbreviations in variable names. Use $entity_name instead of $ename.
I see these same problems coming back throughout the rest of the admin file. Try to document all return parameters and never use abbreviations in variables or function names. To someone else reading the code it is not obvious what a variable called "$default_ca_f_name_p" is supposed to contain.
Comment #34
kaareNo automatic review issues found. Moving on to:
Manual review
hook_form_BASE_FORM_ID_alter()instead ofhook_form_alter()for node forms.@links forhook_HOOK()documentation in docblocks isn't necessary, and is rather distractive. IDEs know where to find this documentation in various .api.php files.commerce_availability.admin.incyou use a lot ofvariable_get()to variables you alreadydefine()d at the top ofcommerce_availability.module. This kind of makes the whole point of all defines mute? I get that having a central place to lookup variables without specifying its default value is handy, but usingdefine()s for this is… code smell. How about having a single function, saycommerce_availability_var($var_name)who's sole purpose is to return either the default or the saved value of it?commerce_availability.js:This should have a ; at the end.
commerce_availability_check_availability()at line 126. Too many closing '}' beforeelse if.General comments
This review is based on viewing the code only as I haven't tested this and got any confirmation that it does what it is supposed to, but based on the screenshot and description of the project this seems rather complex for site admins to set up. My gut feel is that this project needs a better description/presentation about what its purpose is. It does a rather specific task in a narrow field of drupal, and therefore requires more detailed explanation.
Comment #35
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.