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.
Perhaps this function should read:
function nodefamily_content_type_is_max($typename, $uid) {
$max = nodefamily_content_type_get_max($typename);
if (($max == 0 || $uid == 0) && $uid == 1) {
return FALSE;
}
$result = db_query("SELECT COUNT(*) FROM {node} n WHERE uid = %d AND type = '%s'", $uid, $typename);
$count = db_result($result);
return $count == $max;
}
so that user 1 can post as many of whichever content type they want.
Comments
Comment #1
rconstantine CreditAttribution: rconstantine commentedoops, I guess that should also have been ||, not && -- sorry.
Comment #2
fagono, I don't think that it makes sense, that the superuse should have more than one profile. Creating profiles for other users is possible by setting the author appropriate.
Comment #3
rconstantine CreditAttribution: rconstantine commentedI'm not talking about profiles. This field can be used to limit any kind of content! In my case, I don't want users to have more than 10 organic groups that they are in charge of. They can join as many groups as they want, but they can't start them. But as a site admin, I want to own and maintain a handful of groups myself. This number is more than I want users to create. So I think you can see the problem there. This isn't just usable by nodeprofile. In fact, I think your own docs state as much. Please reconsider. Thanks.
Comment #4
rconstantine CreditAttribution: rconstantine commentedComment #5
rconstantine CreditAttribution: rconstantine commented@fago, so what do you think? Can you see the usefulness of the feature beyond nodeprofiles? Thanks for considering this again. I think it could be generally useful. May even be useful to allow certain roles to be exempt from the limit as well.
Comment #6
fagoyou are right, I thought too much about the profiles.
So I agree that this might be useful, so best would be a permission for it, perhaps even per content type.
However, it's no bug, so I change this to feature request. So if you provide a (clean written) patch, I'm of course open to include it :)
Comment #7
fagoI think this is already fixed, but a bit different. Anonymous users can have unlimited nodes, so just set the author to anonymous.
Comment #8
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.