Create and configuring easily the hierarchy Subdirectory multi-site for your Drupal multi site from one installation and a single shared database . This module allows you to add new subdomains directories or management of subdomains directories without changing/adding any file configuration (.htaccess, sites.php, Alias in Apache config file, ...)
Ex: example.com/site-1, example.com/site-2
- Live Demo Site
http://demo.haveitem.com
Username : demo
Password: tester
- Key modules
Domain
-The link to the project page
https://drupal.org/project/subfolders_domain
- Code Review
http://ventral.org/pareview/httpgitdrupalorgsandboxbricegato1990310git
Reviews of other projects
- http://drupal.org/node/1986148#comment-7429304
- http://drupal.org/node/1998762#comment-7431516
- http://drupal.org/node/1997826#comment-7430916
Reviews of other projects (2)
| Comment | File | Size | Author |
|---|---|---|---|
| subdirectories_domains.png | 38.45 KB | brice_gato | |
| manage_hierarchy_subdirectories.png | 22.23 KB | brice_gato | |
| hierarchy_roles_per_site.png | 26.26 KB | brice_gato |
Comments
Comment #1
PA robot commentedProject 1: http://drupal.org/node/1993640
Project 2: http://drupal.org/node/1992940
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
I'm a robot and this is an automated message from Project Applications Scraper.
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
barthje commentedThis is something I was looking for awhile ago! Really interested in this one. I've seen something similar(also a sandbox project) by agentrickard(the maintainer of domain access): http://drupal.org/sandbox/agentrickard/1175752 have you checked it out? If you haven't you should!
Branch
It 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.
General
I miss a lot of commenting. You added only one line describing the function. In the function a lot of things happen without barely any comment about how and what. This makes it hard for other people to jump in and help. Might be handy to add more comments.
subfolders_domain.module
Line 417 - I think subfolders_domain_valid is a better name. As your comments suggests, it check if its valid.
Line 463 - The module file is quite big, maybe seperate the admin functions to a seperate admin include. e.g:
function subfolders_domain_admin($form, &$form_state, $domain = array()) {function subfolders_domain_admin_validate($form, &$form_state) {function subfolders_domain_admin_submit($form, &$form_state) {Line 568 - Shouldn't this happen in the install file?
Line 463 - Plus i think this check is not even needed because in the form function there is already a check. And i don't think this should be needed if its moved to the install file(in hook_update or hook_install)
Line 584 - Same with the dynamicly adding of fields to the table. Is this really needed because the fields don't seem dynamic. Can't this be also in the install file? It would clean up a whole lot of code.
If I'm missing something and there's a really good reason for this, please comment it.
I'm scanning through the rest of the file but I see too many db_table_exists and db_field_exists and even a sleep(1) in it incase the table is not created yet? It seems like the database logic might need an overhaul.
Line 707 - You are assuming role id 3 is an administrator role. This is an id that can be different for other websites. It might be better to check for a permission with user_access. Maybe an existing permission or one of your own.
Line 722 - You added your own domain roles functionality. There is a domain roles module for this. It is recently upgraded to a full project: http://drupal.org/project/domain_roles
function subfolders_domain_roles_form($form, &$form_state, $account) {Line 1108 - It might be better to use the function domain_get_domain() instead of global $_domain;
Line 1173 - Again you create a table in a function. Why not in the install file? It will make your module file so much easier to read without all these checks and db_create_tables
Line 1234 - Typo in comments
// ALIASIES.Comment #4
barthje commentedComment #5
brice_gato commentedThank you for checking Bart. I optimized the code by creating the separate admin include file and enrich the install file. About domain roles functionality, the module that you mentioned does not really satisfy certain needs because it combines the users on the same role per domain and more it has no notion of hierarchy between domains.
Comment #5.0
brice_gato commentedDemo site
Comment #5.1
brice_gato commentedModification of description.
Comment #6
brice_gato commentedComment #7
barthje commentedIt's a lot clearer now! But there are still some things that might be unnecessary. Plus I still miss a lot of commenting. There is sooo much code but soo little comments. It is much better though, just some functions.
subfolders_domain.module
Line 23 - Is this needed? Domain module is a dependency so I assume this function will always be there.
Line 88 - This function seems useless, the table is created on the install file so it will always be there.
Line 437 - Is the sleep function really needed? It looks so dirty.
Line 598 - This function does not seem to be called anywhere? But I guess it might be usefull for other modules. The only thing wrong with it is that it looks like it got the wrong comments for the function.
Line 912 - Seems like old code? Just remove it
// $user_domains = domain_gesubfolders_domain_domains($user);Comment #8
brice_gato commentedBart thank you again for your review, your time and effort. I just made another optimization of my code according to your advice. I think this time it is good, I hope to see my contribution promoted in one upper level! As you say the function "subfolders_domain_subdomains" renamed to "subfolders_domain_symbolic_links" to give it more sense can be useful for other modules in the future.
Comment #8.0
brice_gato commentedAdding of Code Review link
Comment #9
brice_gato commentedPAReview: review bonus
Comment #9.0
brice_gato commentedApplication review bonus
Comment #10
PA robot commentedProject 1: http://drupal.org/node/2002640
Project 2: http://drupal.org/node/1993640
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #11
brice_gato commentedComment #12
PA robot commentedProject 1: http://drupal.org/node/1993640
Project 2: http://drupal.org/node/2002640
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #13
klausiComment #14
klausimanual review:
So the exec() call is a blocker right now. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #14.0
klausiDemo site
Comment #15
brice_gato commentedThanks @klausi for the review. I have made the corrections as u suggested. About exec() function I removed this feature long ago I do not know if you have the right version. And about the cron the Readme.txt file (Point 5) has more infos about why hook_cron() in web mode can not able to create the alias, i have add comments as you wanted.
Comment #16
klausiexec call still present in subfolders_domain_disable().
Comment #17
brice_gato commented@klausi Pardon a little forgotten! now corrected.
Comment #18
brice_gato commentedNew Reviews of other projects (2)
PAReview: review bonus
Comment #19
Gaelan commentedVentral review is still green. Good job!
Manual Review, Part 1, (lines 1-238)
subfolders_domain.install
subfolders_domain.module
subfolders_domain_manage_domains_access()would be clearer.$_SERVER['HTTP_REFERER']is not standard, so it isn't guaranteed to exist.$temp.!empty()check seems redundant, because count will just return 0 and the code will not run.$_SERVER['REQUEST_URI']because latter is Apache-specific.$_SERVER['REDIRECT_URI']also is an Apache thing, but I don't know of a Drupal alternative. It would be wise to at least point out in a comment that this code is not portable, or better detect the server and do something reasonable if it is not Apache.arg()function? It will get segments of the URL for you.$domainis in scope here.$bootstrapis true?This is all that I have time for right now. Hope that helps, and let me know if you have any questions.
Comment #20
brice_gato commentedThanks Gaelan for your review.
I did some optimization changes according to your advice.
Line 188 now Line 207 : Yes i know arg() function, i didn't use it because of course in my boot i will test the real subdomain. the arg () function at this stageis does not match my expectations.
Lines 200-206, 220-224 now Lines 210-216, 229-234 :
This code is well used because otherwise I will not have my domain object.
$ domain done well here and if this is not the case no problem in the end it will be the main site to be active.
I only returning a value if $bootstrap is true because otherwise the subforders domain boot does not need to change anything.
Thank you again for your time and effort.
Comment #21
klausimanual review:
But otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to patrickd as he might have time to take a final look at this.
Comment #22
klausiTrying to remove tag again.
Comment #23
patrickd commentedBreaking the line within a string, within the t() function is not so cool for translation.
Disabling a module should just "deactivate" it's functionality - not delete any configuration. That's what hook_uninstall() is for.
Try to use more "self describing" variable names, even when it annoys you.
$rsis just stupid to read for other developers ;)'#attributes' => array('style' => array('width:280px'))Always avoid using CSS directly on elements - rather conditionally include a css file on the settings page.
array(0 => t('No'), 1 => t('Yes')),If you handle boolean values - use TRUE/FALSE instead of 0/1 - if you need integer - cast them before they are needed - (int) TRUE is still much more readable.
(isset($defaults[$account->uid][$domain_id][$rid])) ? 1 : 0looks better this way:
(isset($defaults[$account->uid][$domain_id][$rid])) ? TRUE : FALSEbut wait the result of isset() is a boolean anyway:
(isset($defaults[$account->uid][$domain_id][$rid]))Some parts of your code look very compact. To increase readability make more use of empty lines. Structure your code in blocks and use inline comments to describe what it does (in the more general perspective) and if appropriate why the code is the way it is (eg. on workarounds). (In some places in the .module file your doing this very well)
I couldn't really review your code in detail, it's just too much code and too many parts of it are not very well documented what makes it really hard for me to understand what's going on (without spending hours reviewing).
But in general you code looks fine and API's seem to be used properly, so thumbs up from me.
Thanks for your contribution!
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 #24
brice_gato commentedHi patrickd ,
Thank you for promoting this project.
Thanks to @barthje and klausi
Comment #24.0
brice_gato commentedPAReview: review bonus
Comment #25.0
(not verified) commentedNew address to the full project page.
Comment #26
avpaderno