This module provides total number of content in a particular content type, It will also shows how much content are published and unpublished and there name.
1. This module will provide a form at admin/config/get-total page.
a. Use this form to select the content type and the published status.
b. It will render all content of selected content type and and there count.
2. This module also provides nodes count at /admin/content page.
3. It will also provide an option for block. So that you can provide a form in front end.
This module will helps if some one need only count and name of content type.
Link to the project page: https://drupal.org/sandbox/pranavpathak/2121169
git url for master
git clone --branch master pranavpathak@git.drupal.org:project/get_total.git
git url for version 7.x-1.x
git clone --branch 7.x-1.x pranavpathak@git.drupal.org:project/get_total.git
Comment | File | Size | Author |
---|---|---|---|
#21 | Get_Total.png | 17.13 KB | pranavpathak |
#30 | Content.png | 26.08 KB | pranavpathak |
#33 | block.png | 14.89 KB | pranavpathak |
Comments
Comment #1
pranavpathak CreditAttribution: pranavpathak commentedDrupal code sandbox link
http://drupalcode.org/sandbox/pranavpathak/2121169.git
Comment #2
Michael Hodge Jr CreditAttribution: Michael Hodge Jr commentedManual Review
You can find the results of the automated report at http://pareview.sh/pareview/httpgitdrupalorgsandboxpranavpathak2121169git.
Overall, I can see the benefit of this module. Thank you for your submission! There does not appear to be another module that achieves the same sort of functionality. One thing you may want to consider is to override the "Find Content" form and show the total there as well. You may also want to change the admin content type drop down to checkboxes so that users can see totals for multiple content types.
Comment #3
pranavpathak CreditAttribution: pranavpathak commentedThis module provides total number of content in a particular content type, It will also shows how much content are published and unpublished and there name.
This module will provide a form at admin/config/get_total
1.Use this form to select the content type and the published status.
2. It will render all content of selected content type and and there count.
This module will helps if some one need only count and name of content type.
Comment #4
pranavpathak CreditAttribution: pranavpathak commentedHi Michael Hodge Jr,
Thanks for your valuable inputs. I made some changes as per guided.
Please review branch 7.x-1.0. If somewhere I am wrong then let me know.
Comment #5
PA robot CreditAttribution: 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 #6
pranavpathak CreditAttribution: pranavpathak commentedPlease review branch 7.x-1.0.
link http://drupalcode.org/sandbox/pranavpathak/2121169.git/commit/08660e3598...
Comment #7
centas CreditAttribution: centas commentedFirstly have a look here for code review in regards to Coding Standards:
http://pareview.sh/pareview/httpgitdrupalorgsandboxpranavpathak2121169git
Use of "drupal_get_total_form" seems unnecessary, just use "drupal_get_form" as page callback and page arguments.
A lot of stuff is misspelled which makes it harder to read the code.
Tried to find similar module seems like one exists for version 6:
https://drupal.org/project/count
Maybe its better to try and get in touch and create a 7 branch?
Comment #8
pranavpathak CreditAttribution: pranavpathak commentedHi,
Codes are updated as instructed. Please review it.
link of project
https://drupal.org/sandbox/pranavpathak/2121169
Git repository link
git clone http://git.drupal.org/sandbox/pranavpathak/2121169.git get_total
Comment #9
pranavpathak CreditAttribution: pranavpathak commentedThis module will show total number and name of content in your Drupal web site.
The configure link in your drupal site
yourdomain.com/admin/config/content/get-total
link of project
https://drupal.org/sandbox/pranavpathak/2121169
Git repository link
git clone http://drupalcode.org/sandbox/pranavpathak/2121169.git
Comment #10
joshi.rohit100Hi Pranav,
Here is the review :-
1. Its for Drupal 7 and I think there is no hook_perm() in Drupal 7. Please change it to hook_permission().
2. Instead of defining your own method get_total_get_all_content_type(), you should use drupal provided method node_type_get_names() to get all content types.
3. You have defined your hook_menu form in the module file. You should define it in separate file by using file attribute of hook_menu().
(please use drupal apis / methods instead of defining yours if available.)
Also change your git url to :-
git clone --branch 7.x-1.0 http://git.drupal.org/sandbox/pranavpathak/2121169.git get_total
thanks.
Comment #11
pranavpathak CreditAttribution: pranavpathak commentedThanks for your valuable comment.
I had added hook_permission() and also replaced function get_total_get_all_content_type() from node_type_get_names().
For #10.3
Is it necessary to add another file to define hook_menu(), because I think for this module size (in terms of files) become high and also I haven't seen this. Let me know if somewhere I am wrong.
Comment #12
pranavpathak CreditAttribution: pranavpathak commentedComment #13
lolandese CreditAttribution: lolandese commentedAs for https://drupal.org/node/1011698 in the 'Issue summary' please add:
For application priority stick to https://drupal.org/node/894256#app-priority.
Thanks.
Comment #14
lolandese CreditAttribution: lolandese commentedAs for https://drupal.org/node/1011698 in the 'Issue summary' please add:
For application priority stick to https://drupal.org/node/894256#app-priority.
Thanks.
Comment #15
pranavpathak CreditAttribution: pranavpathak commentedComment #16
joshi.rohit100Hi Pranav,
First - you haven't updated your git url.
Second - It is not necessary to use file attribute for hook_menu but should be used as module file is parsed on every page request and if we define methods in module file, then they will also parse on each request which cause performance blow.
So for performance, it is required to add file attribute in hook menu.
thanks
Comment #17
joshi.rohit100Comment #18
pranavpathak CreditAttribution: pranavpathak commentedComment #19
pranavpathak CreditAttribution: pranavpathak commentedComment #20
pranavpathak CreditAttribution: pranavpathak commentedThanks joshi.rohit100,
I made many changes.
One more function is added in this module to render count of node in /admin/content page.
Comment #21
pranavpathak CreditAttribution: pranavpathak commentedComment #22
Bogdan1988 CreditAttribution: Bogdan1988 commentedHi pranavpathak, here is suggestions after manual review:
1) hook_menu doc
Implements hook_menu().
2) hook_permission doc
Implements hook_permission().
3) Please, don't document $form and $form_state in forms constructors. Please look here https://drupal.org/node/1354#forms.
4) Inside get_total_form you call $_GET['type'] directly, it is vulnerable for xss, you should use
check_plain($_GET['type') instead.
5) Please use 7.x-1.x branch now. Only after your module will become Rewieved and tested by community RTBC you will be able to create version branch.
That's all thank you!
Comment #23
idebr CreditAttribution: idebr commentedUpdated to 'Needs work' per #22
Comment #24
pranavpathak CreditAttribution: pranavpathak commentedHi Bogdan1988,
Thanks for review Get total.
I did changes as you suggested. In some point I am confused, Can you please explain it for me...
#22.1 and #22.2 for Doc as you wrote, I already added comment. Do you need any more into this?
#22.3 and #22.4 I changed. Thanks for check_plain().
for #22.5
From where I can change 7.x-1.x instead of 7.x-1.0.
Once again thanks.
Comment #25
pranavpathak CreditAttribution: pranavpathak commentedComment #26
Bogdan1988 CreditAttribution: Bogdan1988 commentedHi pranavpathak. Please look here about moving to another git branch https://drupal.org/empty-git-master.
Comment #27
asghar CreditAttribution: asghar commentedHi pranavpathak
Right now your default branch is master but it should something like this *7.x-1.x *. Please change your project settings by following
1. Edit your project page.
2. Click on "Default Branch" tab.
3. Select your branch *7.x-1.x * rather than master.
Comment #28
pranavpathak CreditAttribution: pranavpathak commentedHi asghar,
Thanks I did as you suggested.
Comment #29
pranavpathak CreditAttribution: pranavpathak commentedComment #30
pranavpathak CreditAttribution: pranavpathak commentedComment #31
pranavpathak CreditAttribution: pranavpathak commentedComment #32
pranavpathak CreditAttribution: pranavpathak commentedComment #33
pranavpathak CreditAttribution: pranavpathak commentedComment #34
joshi.rohit100Hi Pranav,
You still haven't updated you git url as it is asking for password. Please update it.
In your module file, comment is saying hook_perm() instead or hook_permission(). Correct this.
Method get_total_form_node_admin_content_alter() in your module file is implementation of hook_form_FORM_ID_alter(), so please mention it in the comment so that anyone who review this can get idea what this is.
In method _get_total_get_content() in your get_total.admin.inc file, try to use the static caching as it will help in performance.
Comment #35
pranavpathak CreditAttribution: pranavpathak commentedI am not understanding the mean of " You still haven't updated your git url as it is asking for password."
Can you please describe it. From where I can public this URL.
Is it necessary to use static caching?
Remaining task are done.
Comment #36
pranavpathak CreditAttribution: pranavpathak commentedComment #37
joshi.rohit100Hi,
You still haven't updated your git url as it is asking for password :-
In description, you have given this :-
If someone tries to clone your code from branch 7, it will ask for password.
Just try to clone with above url and you can see.
Now replace this with the url as I have mentioned in the earlier comment.
Is it necessary to use static caching?
Not really but if you do, it will help for performance and it is a good idea for code level caching.
thanks
Comment #38
pranavpathak CreditAttribution: pranavpathak commentedComment #39
atul.bhosale CreditAttribution: atul.bhosale commented#37
You used the incorrect command that's why system is asking the password.
In above command you used the "pranavpathak@git.drupal.org" as user name.
Use following command to clone the git repository
git clone --branch 7.x-1.0 http://git.drupal.org/sandbox/pranavpathak/2121169.git get_total
Above command works perfectly for me.
Regarding static cache
Can you please explain your thoughts about what is the use of static cache in this module.
Comment #40
pranavpathak CreditAttribution: pranavpathak commented#37
Hi Joshi.rohit100,
I updated my Git URL
git clone --branch 7.x-1.0 http://git.drupal.org/sandbox/pranavpathak/2121169.git
For Static caching, If it is not necessary then in this case I don't think to implement Static caching...
thanks.
Comment #41
kscheirert('Total number of node is: @total', array('@total' => count($nodes));
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #42
joshi.rohit100#39
I haven't used the wrong command. Wrong command was in the issue description. If you see the #10, you will see that I mentioned the correct git url.
Comment #43
pranavpathak CreditAttribution: pranavpathak commentedComment #44
pranavpathak CreditAttribution: pranavpathak commentedHi,
For #41
I am not working in master. I have created 7.x-1.x version branch and "Version to work from" is pointing to 7.x-1.x.
Non non-utf8 characters are removed.
It is necessary to use node_load_multiple in my alter_hook (get_total_form_node_admin_content_alter()) because it is working with admin/content page, it have to provide value once parameter will change.
concatenate t() strings is now changed.
Comment #45
pranavpathak CreditAttribution: pranavpathak commentedComment #46
drupaldev@assyst CreditAttribution: drupaldev@assyst commentedConfigure link in module listing page is not correct. Correct the path in .info file.
Comment #47
pranavpathak CreditAttribution: pranavpathak commented#46 path is changed in .info file.
Comment #48
pranavpathak CreditAttribution: pranavpathak commentedComment #49
perennial.sky CreditAttribution: perennial.sky commentedPlease Implement hook_help and some line exceeds 80 character
Comment #50
perennial.sky CreditAttribution: perennial.sky commentedComment #51
klausiThat are surely not application blockers, any other major issues your found during your review?
Comment #52
pranavpathak CreditAttribution: pranavpathak commentedComment #53
gaurav.goyal CreditAttribution: gaurav.goyal commentedHey pranavpathak,
The admin config form and block functionality this module is providing can be easily obtained using views which is more simple and manageable. So i will highly vote for using views instead of using this module.
Comment #54
pranavpathak CreditAttribution: pranavpathak commentedHi gaurav.goyal,
Thanks for your comment, Ya admin config from and block functionality can achieve from views, but you can't achieve total number of count in /admin/content page with the help of views. For this please refer this https://drupal.org/files/issues/Content.png #30 attached image.
This module is useful for users who don't know how to achieve above functionality via views.
As I can understand the definition of module is that, a script which reduce the effort of development, without destroying/ blocking other functionality, can be a module.
This module is providing 3 features at a same time.
1. This module will provide a form at admin/config/get_total page.
a. Use this form to select the content type and the published status.
b. It will render all content of selected content type and and there count.
2. This module also provides nodes count at /admin/content page.
3. It will also provide an option for block. So that you can provide a form in front end.
Please let me know if I am wrong somewhere because I am new in drupal, I am working from last 3 years only.
Comment #55
gaurav.goyal CreditAttribution: gaurav.goyal commentedHi pranavpathak,
#1, #3 Views solution is a more generic one and can often be altered though the Views UI and you are sure that the config is exportable with features and so on. If it works with Views then a lot of other modules also can hook in and change functionality if you need to change the out of the box func.
Comment #56
amreana CreditAttribution: amreana commentedManual Review:
The module is simple and in my opinion is really interesting.
My recommendations, because the module is so simple and probably people are not sure on what to expect:
1. use hook_install() to send user to the admin/config/content/get-total after module installation
2. and on the admin page put a note and say what exactly the module will do, eg.
"1. This module will provide a form at admin/config/get_total page.
2. This module also provides nodes count at /admin/content page."
Comment #57
pranavpathak CreditAttribution: pranavpathak commentedComment #58
pranavpathak CreditAttribution: pranavpathak commentedHi amreana,
Thanks for your valuable inputs.
Please check following points...
1. Instead of hook_install I provided setting option in front of module in module list page. This will redirect user to form page.
2. It's very difficult to give more information in form page because I am using this form function in block also. So instead of this I simply provided entire information in short words on configuration page and module listing page.
Comment #59
kscheirerNone of those are blocking issues though.
Thanks for your contribution, pranavpathak!
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.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #60
pranavpathak CreditAttribution: pranavpathak commentedHi kscheirer,
Thanks.
Bellow are my points..
a. I am going to work in next branch 7.x-1.0. so let it as it is else I will remove it.
b. I removed windows character in README.txt.
c. 2 warring removed which is detected by pareview.sh
d. For node_load_multiple function I am considering "Nodes are loaded into memory and will not require database access if loaded again during the same page request." from https://api.drupal.org/api/drupal/modules!node!node.module/function/node...
So I don't think to use db_select. If somewhere I am wrong, then please let me know.
Comment #61
ram4nd CreditAttribution: ram4nd commentedDelete the master branch https://drupal.org/empty-git-master
Comment #62
pranavpathak CreditAttribution: pranavpathak commentedHi ram4nd,
Did you mean to empty master branch like http://drupalcode.org/project/get_total.git/tree/refs/heads/master or completely remove by git branch -d master commend?
Please specify this. I updated README.txt file in master as it contain only "See major version branches.".
Comment #63
ram4nd CreditAttribution: ram4nd commentedI thought the guide was pretty self explanatory. But since you create your Drupal related branches the master branch is redundant.
Comment #64
devd CreditAttribution: devd commentedHi pranavpathak,
I am unable to get clone using.
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/pranavpathak/2121169.git get_total
It is returning the following error.
fatal: http://git.drupal.org/sandbox/pranavpathak/2121169.git/info/refs not found: did you run git update-server-info on the server?.
Comment #65
pranavpathak CreditAttribution: pranavpathak commentedComment #66
pranavpathak CreditAttribution: pranavpathak commentedHi dev.firoza,
Sorry.
Now I have changed my git clone command in issue page. It will be like
git clone --branch 7.x-1.x pranavpathak@git.drupal.org:project/get_total.git.
Earlier command were for sendbox projects only. That's why you got error.
Else you can download get total from project page " https://drupal.org/project/get_total ".
Comment #67
ram4nd CreditAttribution: ram4nd commentedThat is your personal maintenance git clone command.