Answers.Body: <p>I had a very similar issue and it was caused by CiviRules. I disabled CiviRules and it worked fine. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-13T14:41:19.737Z
Answers.LastActivityDate: 2016-02-13T14:41:19.737Z
Answers.UserDisplayName: frTommy
Answers.Body: <p>This is a bug in CiviCRM.  A client of ours had this exact situation, and I opened issue <a href="https://issues.civicrm.org/jira/browse/CRM-20419" rel="nofollow noreferrer">CRM-20419</a>.</p>
  
  <p>TLDR: <a href="https://github.com/civicrm/civicrm-core/pull/10152" rel="nofollow noreferrer">I wrote a fix here</a>.  More technical discussion is below.</p>
  
  <p>The problem is that the profile selector is populated by a <a href="https://github.com/civicrm/civicrm-core/blob/4.7.18/js/jquery/jquery.crmProfileSelector.js" rel="nofollow noreferrer">jQuery plugin</a> that <a href="https://github.com/civicrm/civicrm-core/blob/4.7.18/js/jquery/jquery.crmProfileSelector.js#L48" rel="nofollow noreferrer">checks</a> <a href="https://github.com/civicrm/civicrm-core/blob/4.7.18/js/jquery/jquery.crmProfileSelector.js#L58" rel="nofollow noreferrer">arrays</a> and <a href="https://github.com/civicrm/civicrm-core/blob/4.7.18/js/jquery/jquery.crmProfileSelector.js#L37" rel="nofollow noreferrer">strings</a> to see if they're empty by using a method designed for checking whether objects are empty. The <a href="https://api.jquery.com/jQuery.isEmptyObject/" rel="nofollow noreferrer">documentation</a> for <code>jQuery.isEmptyObject()</code> explains that it may act inconsistently when used with arguments that aren't plain objects.</p>
  
  <p>In this case, it appears that most of time, it returns <code>true</code> when evaluating an empty string or array, but in our client's case, it was returning <code>false</code>.</p>
  
  <p>There's really no reason to be using a fancy jQuery method to see if an array or string is empty: the <code>length</code> property will be <code>0</code> if so.  The fix linked above just replaces <code>$.isEmptyArray()</code> with checking the variable's length whenever the variable isn't a plain object.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-12T15:44:23.533Z
Answers.LastActivityDate: 2017-04-12T15:44:23.533Z
Answers.UserDisplayName: Andie Hunt
Answers.Body: <p>I'm running CiviCRM 4.7.15 on Joomla 3.6.5
  Not running CiviRules.
  I have the same problem. I can create profiles that I can use in contribution pages for memberships but, if I enable online registration for an event or for an event template, only the pre-existing, default profiles show up. This means that I cannot collect custom data from event registrants.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-16T01:33:50.127Z
Answers.Text: This is not exactly an answer :-( And to make it useful as a question, either explain exactly what you have in the Profile that is not showing or even better clarify if you have replicated on a Demo site.
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-17T17:42:32.773Z
Answers.Text: As I indicated it isn't part of a profile, its the entire profile. I want to collect custom data fields from my members when the register for events that I create. To that end I have created a profile containing those fields. When I enable online registration for the event, the profiles drop-down list does not include the profile that I created.
  Finally, I do not have a demo site, I have a site that I am developing in a sub-domain. It will be transferred to my production site when I get it working.
Answers.UserDisplayName: Paul Andreassen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-17T19:06:19.693Z
Answers.Text: Paul - sorry for not being clearer. By Demo site i meant eg dmaster.demo.civicrm.org as it can be useful to others to know if this can be replicated on a clean standard set up.
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-18T23:13:37.250Z
Answers.Text: I think I have figured out what the problem is. I have created some custom fields to contain data that we keep about our members. One of these is our unique 'Club Member Number'. This is simply a 9 digit number with 4 digits for year, 2 digits for month and 3 digits for a sequence number. It tells us the year and month the member joined and the sequence portion simply serves to ensure they are always unique. We have been using this sytem for 14 years. In order to be able to associate this with our members, I created the custom data field and indicated it was to be used for memberships. All fin
Answers.UserDisplayName: Paul Andreassen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-18T23:25:50.457Z
Answers.Text: All fine except that if I want to draw on that information to validate the membership of someone who wishes to register for one of our 'member only' events, I can't use it because it isn't designated for use by events, and apparently can't be. Its either one or the other. This really reduces the usefulness of custom data fields, in my opinion, unless there is a way of capturing this information so that it can be used anywhere in the system. I believe I can work around this by using the Joomla ACL to make registration availble only to designated groups and using CiviRules to manage the ACL.
Answers.UserDisplayName: Paul Andreassen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-18T23:28:49.793Z
Answers.Text: If I am incorrect in this, I would like to know how the custom datafields can be made more useful. Please accept my apologies for running this explanation over three comments, I was not aware of the 600 character limit. I will look into the dmaster.demo.civicrm.org.
Answers.UserDisplayName: Paul Andreassen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-19T19:32:11.910Z
Answers.Text: Profiles are generally usable on the following basis
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-15T23:30:16.050Z
Answers.LastActivityDate: 2017-03-15T23:30:16.050Z
Answers.UserDisplayName: Paul Andreassen
Body: <p>Possibly since the last versions of 4.6 but certainly in 4.7 we're unable to select any profiles for the online registration screen for events. Even for a new event we get the "The selected profile is using a custom field which is not assigned to the "Event" being configured" warning, and we can see only two profiles (Discount Codes and End Dates) - we get this warning even though at this stage we haven't picked any profile.</p>
  
  <p>This is Joomla 3.4.8 and Civi 4.7.1. It's a default Joomla template and I've removed all Civi extensions for the moment. I'm accessing as a SuperUser so it isn't a permissions thing.</p>
  
  <p>Unfortunately the demo server is running Civi 4.6 so I can't try to replicate the issue there.</p>
  
  <p>Any suggestions where I should look?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-13T00:18:11.397Z
Comments.Text: Looking at firebug reporting there is a GET request for the relevant data about the profiles which appears to be returned successfully, but for some reason it is not then displayed to the user.
Comments.UserDisplayName: Ed P
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-15T16:52:40.887Z
Comments.Text: I have a related problem "The selected profile is using a custom field which is not assigned to the "Event" being configured."  The profile is for event participants and includes individual, contact and participant fields.  It will display but edit button not working, and dedupe rules do not seem to work.  I do not have civirules installed.
Comments.UserDisplayName: Sonicthoughts
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-18T18:52:16.043Z
Comments.Text: I have had the same problem with 4.6 and hoped that upgrading to 4.7 would solve it. No such luck.
Comments.UserDisplayName: Phil Morice Brubaker
Tags: <civievent>
Title: CiviEvent - Unable to select profiles - get 'custom field is not assigned to the event' warning even though no profile selected
ThreadText: # CiviEvent - Unable to select profiles - get 'custom field is not assigned to the event' warning even though no profile selected
  
  (Asked by: username_0 on 2016-02-12)
  
  Possibly since the last versions of 4.6 but certainly in 4.7 we're unable to select any profiles for the online registration screen for events. Even for a new event we get the "The selected profile is using a custom field which is not assigned to the "Event" being configured" warning, and we can see only two profiles (Discount Codes and End Dates) - we get this warning even though at this stage we haven't picked any profile.
  
  This is Joomla 3.4.8 and Civi 4.7.1. It's a default Joomla template and I've removed all Civi extensions for the moment. I'm accessing as a SuperUser so it isn't a permissions thing.
  
  Unfortunately the demo server is running Civi 4.6 so I can't try to replicate the issue there.
  
  Any suggestions where I should look?
  
  **Tags:** civievent
  
  > **Comments:**
  > **username_0**: Looking at firebug reporting there is a GET request for the relevant data about the profiles which appears to be returned successfully, but for some reason it is not then displayed to the user.  
  > **username_1**: I have a related problem "The selected profile is using a custom field which is not assigned to the "Event" being configured."  The profile is for event participants and includes individual, contact and participant fields.  It will display but edit button not working, and dedupe rules do not seem to work.  I do not have civirules installed.  
  > **username_2**: I have had the same problem with 4.6 and hoped that upgrading to 4.7 would solve it. No such luck.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_3 on 2016-02-13. Score: 2
  
  I had a very similar issue and it was caused by CiviRules. I disabled CiviRules and it worked fine.
  
  
  ---
  
  ### Answer by username_4 on 2017-04-12. Score: 0
  
  This is a bug in CiviCRM. A client of ours had this exact situation, and I opened issue [CRM-20419](https://issues.civicrm.org/jira/browse/CRM-20419).
  
  TLDR: [I wrote a fix here](https://github.com/civicrm/civicrm-core/pull/10152). More technical discussion is below.
  
  The problem is that the profile selector is populated by a [jQuery plugin](https://github.com/civicrm/civicrm-core/blob/4.7.18/js/jquery/jquery.crmProfileSelector.js) that [checks](https://github.com/civicrm/civicrm-core/blob/4.7.18/js/jquery/jquery.crmProfileSelector.js#L48) [arrays](https://github.com/civicrm/civicrm-core/blob/4.7.18/js/jquery/jquery.crmProfileSelector.js#L58) and [strings](https://github.com/civicrm/civicrm-core/blob/4.7.18/js/jquery/jquery.crmProfileSelector.js#L37) to see if they're empty by using a method designed for checking whether objects are empty. The [documentation](https://api.jquery.com/jQuery.isEmptyObject/) for `jQuery.isEmptyObject()` explains that it may act inconsistently when used with arguments that aren't plain objects.
  
  In this case, it appears that most of time, it returns `true` when evaluating an empty string or array, but in our client's case, it was returning `false`.
  
  There's really no reason to be using a fancy jQuery method to see if an array or string is empty: the `length` property will be `0` if so. The fix linked above just replaces `$.isEmptyArray()` with checking the variable's length whenever the variable isn't a plain object.
  
  
  ---
  
  ### Answer by username_5 on 2017-03-15. Score: -1
  
  I'm running CiviCRM 4.7.15 on Joomla 3.6.5
  Not running CiviRules.
  I have the same problem. I can create profiles that I can use in contribution pages for memberships but, if I enable online registration for an event or for an event template, only the pre-existing, default profiles show up. This means that I cannot collect custom data from event registrants.
  
  > **Comments:**
  > **username_6**: This is not exactly an answer :-( And to make it useful as a question, either explain exactly what you have in the Profile that is not showing or even better clarify if you have replicated on a Demo site.  
  > **username_5**: As I indicated it isn't part of a profile, its the entire profile. I want to collect custom data fields from my members when the register for events that I create. To that end I have created a profile containing those fields. When I enable online registration for the event, the profiles drop-down list does not include the profile that I created. Finally, I do not have a demo site, I have a site that I am developing in a sub-domain. It will be transferred to my production site when I get it working.  
  > **username_6**: username_5 - sorry for not being clearer. By Demo site i meant eg dmaster.demo.civicrm.org as it can be useful to others to know if this can be replicated on a clean standard set up.  
  > **username_5**: I think I have figured out what the problem is. I have created some custom fields to contain data that we keep about our members. One of these is our unique 'Club Member Number'. This is simply a 9 digit number with 4 digits for year, 2 digits for month and 3 digits for a sequence number. It tells us the year and month the member joined and the sequence portion simply serves to ensure they are always unique. We have been using this sytem for 14 years. In order to be able to associate this with our members, I created the custom data field and indicated it was to be used for memberships. All fin  
  > **username_5**: All fine except that if I want to draw on that information to validate the membership of someone who wishes to register for one of our 'member only' events, I can't use it because it isn't designated for use by events, and apparently can't be. Its either one or the other. This really reduces the usefulness of custom data fields, in my opinion, unless there is a way of capturing this information so that it can be used anywhere in the system. I believe I can work around this by using the Joomla ACL to make registration availble only to designated groups and using CiviRules to manage the ACL.  
  > **username_5**: If I am incorrect in this, I would like to know how the custom datafields can be made more useful. Please accept my apologies for running this explanation over three comments, I was not aware of the 600 character limit. I will look into the dmaster.demo.civicrm.org.  
  > **username_6**: Profiles are generally usable on the following basis  
  
  ---
  
  