Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Cool module. The basic functionality with node limits is working great in Drupal 7 version, but not seeing the "error" message: You can't create more content of type !type"
Comment | File | Size | Author |
---|---|---|---|
#12 | node_limit-error_message-1482498-12.patch | 1.3 KB | Alex Bukach |
Comments
Comment #1
dougsap CreditAttribution: dougsap commentedHi Markwk,
When the limit is reached for a particular condition, does the user see that content type as available for creation?
I BELIEVE that the error message was made obsolete by
#1286544: Hide node/add links for users who have reached their limit or display a message to users who have reached their limit
Caveats: I have not been following activity on this project for its whole life. I am not a maintainer. Etc... Dougsap
Comment #2
DuaelFrdougsap is absolutely right.
However, you may see this message when trying to access a node/add/X page by direct URL or with an unprotected link.
Comment #3
markwk CreditAttribution: markwk commentedThanks for the help guys...
The users are indeed blocked from accessing the add/X when they reach the limit on X. I looked at bit at the code some. It seemed like some of those lines about warning messages weren't being triggered. I agree with this approach entirely and avoiding access entirely to the add/X/ path.
It's the feedback after. What about setting up a custom redirect to some other url? The "access denied" seems a bit off in terms of feedback when the reality is "you've reached your limit.
Comment #4
Santhosh Kalla CreditAttribution: Santhosh Kalla commentedIt seems a bit off in terms of feedback of the users when they see "access denied" page when they are in active. So can we write our custom error for this ? Can anyone help me with this ?
Comment #5
Santhosh Kalla CreditAttribution: Santhosh Kalla commentedIt seems a bit off in terms of feedback of the users when they see "access denied" page when they are in active. So can we write our custom error for this ? Can anyone help me with this ?
Comment #6
DuaelFrI am sorry but I have no time to handle this for the moment.
I you can provide a patch to have a custom error message or a custom redirection, you will be welcome.
Comment #7
Tsubo CreditAttribution: Tsubo commentedI'm in agreement here. Either a standard message or the ability to redirect to specific URL would seem appropriate. Just getting an access denied doesn't really explain the situation, and nor does removing the create node links.
Either that or rules integration so we have an event we can act on.
Comment #8
kopeboy CreditAttribution: kopeboy commentedThis module looks abandoned. Come on, this is basic and very important functionality for this module!
I don't have the expertise to patch the module, but a simple rule integration event could make this very flexible and easy to use..
Comment #9
kicr CreditAttribution: kicr commentedI second to everyone's sentiments. This is also beyond my expertise. I wish I had the time to level up enough to get the skills to fix this myself but I don't. I hope someone can add rules integration or at least an error page per node limit type.
Comment #11
neerajskydiver CreditAttribution: neerajskydiver as a volunteer and commentedI have added an error in 7.x-1.x version. Please check.
Currently there is no option to change the error but you will get a message like
You can't create more content of type Article. Please contact Site Administrator for more information.
Comment #12
Alex Bukach CreditAttribution: Alex Bukach at This Little Duck commentedThe implementation added at #10 displays the message each time the access to the
node/add/[type]
page is checked, that it at other pages as well (e.g. if there's a menu link tonode/add/[type]
). The correct approach would be to display message on respective pages only. Here's a patch that does it.Comment #13
Alex Bukach CreditAttribution: Alex Bukach at This Little Duck commentedComment #14
JohnnyW CreditAttribution: JohnnyW commentedAlex= brilliant! #12 worked perfectly! THANK YOU!
Comment #15
abarpetia CreditAttribution: abarpetia commentedPerfect! attached patch #13 worked for me.
Comment #18
adriancidThanks to @all, I just edit a little because we have change dome lines in #1364410: Configurable message and redirection page