Body: <p>I need to customize civicrm/participant/add, but I'm finding it's not as simple as customizing my extension's copy of CRM/Event/Form/Participant.php. All I've done so far is make the copy, and I'm getting errors I don't understand.</p>
  
  <p>The form actually loads and processes correctly, except for a 'Could not find valid value for cid' error. I've traced the error to the cid retrieval in civicrm/CRM/Event/Page/Tab.php :</p>
  
  <p>if ($context == 'standalone') {
        $this->_action = CRM_Core_Action::ADD;
      }
      else {
        $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);</p>
  
  <p>I've verified that context='standalone' in the URL, so I don't understand why that line is even executed.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-13T21:59:34.923Z
Comments.Text: Could you say a bit more about what the customization you want to do is?  There are many ways to customize CiviCRM - hooks/extensions, overrides, .extra.tpl files, etc - and if you tell us what you're trying to do we can help figure out the most appropriate solution.
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-14T23:33:52.760Z
Comments.Text: Thanks for asking. In general, I'm 'deriving' a tournament extension from the event class. I want my version of the participant add form to (so far):
  
  1) Hide Event Source & 
  2) Default record_contribution to 0.
  
  I've got my 'derived' version doing that, but I'm baffled by the Could not find valid value for cid' errors.
Comments.UserDisplayName: Mike Steigerwald
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-15T10:01:33.263Z
Comments.Text: do you have the code of your extension already published on github or somewhere we can have a look?
Comments.UserDisplayName: Xavier
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-16T00:44:50.083Z
Comments.Text: It would useful to know what guide have you followed to create your extensions, the recommended steps to create an extension or modify built-in core features can be found here: https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension?desktop=true and here: https://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in%2C+Profile%2C+Contribution+and+Event+Registration+Screens?desktop=true . As you are motioning a **copy** and **customization** of a Civi's php core files, I don't believe that's the best approach to move further.
Comments.UserDisplayName: Andrei
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-16T12:42:39.273Z
Comments.Text: Xavier: Thanks for asking. Yes, I have published my 'alpha' version to https://github.com/agloa/tournament . My first 'clone' of Event/Form/Participant.php is under wordpress/wp-content/plugins/files/civicrm/custom_ext/org.agloa.tournament/CRM/Tournament/Form/ and tournament/wordpress/wp-content/plugins/files/civicrm/custom_ext/org.agloa.tournament/templates/CRM/Tournament/Form/.
Comments.UserDisplayName: Mike Steigerwald
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-16T12:45:15.380Z
Comments.Text: Andrei: Yes, I have been following the guide of https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension?desktop=true, but I was unaware of https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension?desktop=true, so I'll start studying that. Many thanks!
Comments.UserDisplayName: Mike Steigerwald
Tags: <civievent>
Title: How to customize civicrm/participant/add?
ThreadText: # How to customize civicrm/participant/add?
  
  (Asked by: username_0 on 2016-02-13)
  
  I need to customize civicrm/participant/add, but I'm finding it's not as simple as customizing my extension's copy of CRM/Event/Form/Participant.php. All I've done so far is make the copy, and I'm getting errors I don't understand.
  
  The form actually loads and processes correctly, except for a 'Could not find valid value for cid' error. I've traced the error to the cid retrieval in civicrm/CRM/Event/Page/Tab.php :
  
  if ($context == 'standalone') {
  $this->\_action = CRM\_Core\_Action::ADD;
  }
  else {
  $this->\_contactId = CRM\_Utils\_Request::retrieve('cid', 'Positive', $this, TRUE);
  
  I've verified that context='standalone' in the URL, so I don't understand why that line is even executed.
  
  **Tags:** civievent
  
  > **Comments:**
  > **username_1**: Could you say a bit more about what the customization you want to do is?  There are many ways to customize CiviCRM - hooks/extensions, overrides, .extra.tpl files, etc - and if you tell us what you're trying to do we can help figure out the most appropriate solution.  
  > **username_0**: Thanks for asking. In general, I'm 'deriving' a tournament extension from the event class. I want my version of the participant add form to (so far):  1) Hide Event Source &  2) Default record_contribution to 0.  I've got my 'derived' version doing that, but I'm baffled by the Could not find valid value for cid' errors.  
  > **username_2**: do you have the code of your extension already published on github or somewhere we can have a look?  
  > **username_3**: It would useful to know what guide have you followed to create your extensions, the recommended steps to create an extension or modify built-in core features can be found here: https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension?desktop=true and here: https://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in%2C+Profile%2C+Contribution+and+Event+Registration+Screens?desktop=true . As you are motioning a **copy** and **customization** of a Civi's php core files, I don't believe that's the best approach to move further.  
  > **username_0**: username_2: Thanks for asking. Yes, I have published my 'alpha' version to https://github.com/agloa/tournament . My first 'clone' of Event/Form/Participant.php is under wordpress/wp-content/plugins/files/civicrm/custom_ext/org.agloa.tournament/CRM/Tournament/Form/ and tournament/wordpress/wp-content/plugins/files/civicrm/custom_ext/org.agloa.tournament/templates/CRM/Tournament/Form/.  
  > **username_0**: username_3: Yes, I have been following the guide of https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension?desktop=true, but I was unaware of https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension?desktop=true, so I'll start studying that. Many thanks!  
  
  ---
  
  ## 0 answers
  
  