Body: <p>Civi 5.16/Sandbox/WP - if no entry is made to select a number at a price level for pricesets using text/numeric entry, the form allows for $0 registration. If the text/numeric entry counts participants, the user doesn't 'count', a price should be selected. I think the problem is that in CRM/Event/Form/Registration getParticipantCount is checking for !$count which could be '0', and not empty, ~line 994, should that be isset() or empty();same for line1000 $totalCount</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-04T19:16:54.010Z
Comments.Text: Can you restate the problem with a more use-case type description? It sounds like you're trying to create a priceset that allows free participation? Or what is your goal and how are you trying to solve it?
Comments.UserDisplayName: Alan Dixon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-06T22:33:38.727Z
Comments.Text: Yes - it seems like there are 2 ways of counting participants;one is to set the participant_count in a price (to 1), the other is to leave that field null, and then count the number either as the logged-in user (1) or additional named participants.  In  the getParticipantCount function, the count is taken from the current price-set, so if the user has picked NONE of the choices in the set, the count will be zero, which should be flagged as an error ( think). If the code is left as is, the $count being zero is treated the same as if it was empty/not set, and then $count is set to 1,  s/b zero.
Comments.UserDisplayName: Lesley Evensen
Tags: <civievent>
Title: Price sets using text/numeric entry allow 0 participants
ThreadText: # Price sets using text/numeric entry allow 0 participants
  
  (Asked by: username_0 on 2019-12-04)
  
  Civi 5.16/Sandbox/WP - if no entry is made to select a number at a price level for pricesets using text/numeric entry, the form allows for $0 registration. If the text/numeric entry counts participants, the user doesn't 'count', a price should be selected. I think the problem is that in CRM/Event/Form/Registration getParticipantCount is checking for !$count which could be '0', and not empty, ~line 994, should that be isset() or empty();same for line1000 $totalCount
  
  **Tags:** civievent
  
  > **Comments:**
  > **username_1**: Can you restate the problem with a more use-case type description? It sounds like you're trying to create a priceset that allows free participation? Or what is your goal and how are you trying to solve it?  
  > **username_0**: Yes - it seems like there are 2 ways of counting participants;one is to set the participant_count in a price (to 1), the other is to leave that field null, and then count the number either as the logged-in user (1) or additional named participants.  In  the getParticipantCount function, the count is taken from the current price-set, so if the user has picked NONE of the choices in the set, the count will be zero, which should be flagged as an error ( think). If the code is left as is, the $count being zero is treated the same as if it was empty/not set, and then $count is set to 1,  s/b zero.  
  
  ---
  
  ## 0 answers
  
  