Needs work
Project:
Node Limit
Version:
7.x-1.0-alpha4
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Sep 2011 at 13:09 UTC
Updated:
15 Oct 2014 at 09:51 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ricovandevin commentedI have made some changes to node_limit_role.module and for now this is working how I'd expect it to work. I changed the function
node_limit_role_node_limit_sql()to this:Can someone please let me know whether I changed expected behavior by this? In that case additional functionality would should be added to the module.
Comment #2
duaelfrHi Rico,
This was the expected behavior. The one you need is planned for a future release. If you want to provide a sub module I will be pleased to integrate it.
Regards
Comment #3
NathanM commentedSubscribing, as this is exactly what I need.
Comment #4
Sinan Erdem commentedHow can I achieve the same for content type instead of role?
Comment #5
duaelfrI do not understand your need etcetera9, could you be more precise ?
Comment #6
Sinan Erdem commentedOf course.
I want to limit the number of contents per user for a specific content type.
For example; I want each user to create only 1 from Article content.
Comment #7
duaelfrYou just have to use node_limit_type submodule to do that.
This issue is about limiting each user of a given role instead of all users of this role.
Comment #8
Sinan Erdem commentedNode limit type puts a limit for all users combined. For example if you set up a limit of 5, the number of content in the system cannot exceet 5. I want to give each user a right to create 5 contents of that type...
Comment #9
duaelfrOh ! I missed this point ;)
With this patch you could do what you want. You can use more than one node_limit submodule at a time.
In your case you may combine node_limit_type and node_limit_role (modified as seen above)
Comment #10
Sinan Erdem commentedHehe thanks. I will try it...
Comment #11
grasmash commentedThat's also the functionality that I was expecting. Has this been implemented in dev?
Comment #12
duaelfrNot yet sorry :/
Comment #13
jdrichmond commentedThis isn't a pretty solution, but it worked for me. I used "blog" as the node type here. Feel free to use your own node type.
Comment #14
duaelfrA new submodule has been pushed to dev branch
http://drupalcode.org/project/node_limit.git/commit/dc3c193
Comment #15
dougsap commentedSuccessfully tested the new module node_limit_userofrole.
The Coder module gave 12 minor warnings - mostly:
Thanks.
Comment #16
duaelfrThank you for your review.
I just pushed a new commit correcting coding standards.
Comment #17
dougsap commentedThe Coder module now reports no warnings for 'Node Limit User of Role'.
However, the functionality has changed. With various settings, but specifically for Limit=1, Content Type Specified, Users of Role = Authenticated, errors:
Notice: Undefined index: node_limit_role in node_limit_userofrole_node_limit_applies_in_context() (line 16 of/home/foo/sites/all/modules/node_limit/node_limit_userofrole/node_limit_userofrole.module).
Notice: Undefined index: node_limit_role in node_limit_userofrole_node_limit_applies_in_context() (line 17 of/home/foo/sites/all/modules/node_limit/node_limit_userofrole/node_limit_userofrole.module).
Notice: Undefined index: node_limit_role in node_limit_userofrole_node_limit_applies_in_context() (line 18 of/home/foo/sites/all/modules/node_limit/node_limit_userofrole/node_limit_userofrole.module).
It SEEMs to work, at least with some use cases, if I replace index 'node_limit_role' with 'node_limit_userofrole' in lines 16 through 19. Thanks!
Comment #18
dougsap commentedChanging status from 'Needs Review' to 'Needs Work'. My mistake.
Comment #19
duaelfrOh dear ! This was a copy&paste mistake.
I just pushed a patch on git. http://drupalcode.org/project/node_limit.git/commit/8a09341
Comment #20
dougsap commentedThe 'Node Limit User of Role' module works great when used to restrict node creation by either Authenticated OR Anonymous users.
If separate restrictions (using different limits) are defined for both Authenticated OR Anonymous users, users of both roles will be limited to creating the same number of nodes (of the specified Content Type). See the attached image for a detailed example.
This is not something which I am personally concerned about. It probably is not a frequent use case. I am not sure if there are any easy workarounds. I am only highlighting it for evaluation.
I am very happy with the 'Node Limit User of Role' functionality provided in in 7.x-1.0-alpha3. It seems to be complete and stable enough that this particular issue could be closed.
Thanks again Edouard!
Comment #21
duaelfrAlpha4 contains some improvements to avoid some limits to apply when they would not.
Comment #22
dougsap commentedBehavior on the compound 'Users of Role' issue (#20 above) is the same in Alpha04 as Alpha03. Thanks.
Comment #23
dougsap commentedI just realized that I should have changed status to 'needs work' with my previous post. Thanks!
Comment #24
chefnelone commentedI'm in the same situation @finlet in #1, the function posted in #2 is working for me. Is this commited to dev?
Comment #25
duaelfrYou might use node_limit_userofrole submodule chefnelone but be aware of what doug said in #22 if you need to restrict authenticated and anonymous users.
Comment #26
chefnelone commentedthanks I'll take a look a the submodule.