Answers.Body: <p>Ultimately, the answer was simply to enable &quot;CiviCRM: access all custom data&quot; for all users in Administer-&gt;Users &amp; Permissions-&gt;Permissions-&gt;WordPress Access Control.</p>
  <p>I am unclear whether this presents a data risk. The wording of the permission makes it feel a bit like this, but I guess if a user only has limited access by context then it isn't an issue. I am fervently hoping this is so.</p>
  <p>The reason it appeared to work at first was related to browser and server caching. As soon as the caches cleared it failed.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-12-23T20:19:47.893Z
Answers.LastActivityDate: 2020-12-23T20:19:47.893Z
Answers.UserDisplayName: kapn
Body: <p>I have created some custom fields to collect size data as part of an event registration form. When I first create the fields I am able to include them in a profile and use them on the form. At some point though the profile becomes unable to display them and nothing appears.
  A regular profile preview just shows an empty box, but if I try to preview a single field in the profile then I see the message &quot;This CiviCRM profile field is view only&quot;.
  <a href="https://i.sstatic.net/xRUWG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/xRUWG.png" alt="enter image description here" /></a></p>
  <p>However, the field is most definitely not view only:
  <a href="https://i.sstatic.net/IYe6Q.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/IYe6Q.png" alt="enter image description here" /></a>
  <a href="https://i.sstatic.net/h9sDI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/h9sDI.png" alt="enter image description here" /></a></p>
  <p>I have not found any way to make the fields display again. If I create new ones and use them, they will work for a while and then stop.</p>
  <p>The further mystery is how they could be broken after a time? A scheduled job? Most of the enabled tasks are &quot;always&quot; and so I would not expect the form to work very long at all (cron runs every 10 minutes on this site). I wonder about the &quot;clean-up&quot; task since it runs hourly, but I'm at a loss to imagine how that would affect custom fields.</p>
  <p>Any thoughts folks?</p>
  <p>Running 5.31.1 on Wordpress 5.5.3</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-30T15:30:44.223Z
Comments.Text: Is it similar to this? https://lab.civicrm.org/dev/core/-/issues/1984 or https://civicrm.stackexchange.com/questions/37652/custom-fields-sometimes-missing-from-profile-until-flushing-caches/37654#37654
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-30T16:20:40.307Z
Comments.Text: @Demerit, those certainly look related, but clearing the cache has not helped. Following those threads I did find a comment that suggested enabling "CiviCRM: access all custom data" for all users. I did that and it started working again. However, that leaves open the question of why it worked for a time. And also why they wouldn't work even for admin.
Comments.UserDisplayName: kapn
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-02T16:19:41.680Z
Comments.Text: The answer to "why it worked for a time" and then "wouldn't work even for admin" - if Demerit is right, then that issue was related to caching - i.e. it was delivering code cached for the wrong role. BTW - I'd post your solution as an answer so that others can try it.
Comments.UserDisplayName: Alan Dixon
Tags: <custom-fields>
Title: custom fields become unavailable after a period of time
ThreadText: # custom fields become unavailable after a period of time
  
  (Asked by: username_0 on 2020-11-30)
  
  I have created some custom fields to collect size data as part of an event registration form. When I first create the fields I am able to include them in a profile and use them on the form. At some point though the profile becomes unable to display them and nothing appears.
  A regular profile preview just shows an empty box, but if I try to preview a single field in the profile then I see the message "This CiviCRM profile field is view only".
  [![enter image description here](https://i.sstatic.net/xRUWG.png)](https://i.sstatic.net/xRUWG.png)
  
  However, the field is most definitely not view only:
  [![enter image description here](https://i.sstatic.net/IYe6Q.png)](https://i.sstatic.net/IYe6Q.png)
  [![enter image description here](https://i.sstatic.net/h9sDI.png)](https://i.sstatic.net/h9sDI.png)
  
  I have not found any way to make the fields display again. If I create new ones and use them, they will work for a while and then stop.
  
  The further mystery is how they could be broken after a time? A scheduled job? Most of the enabled tasks are "always" and so I would not expect the form to work very long at all (cron runs every 10 minutes on this site). I wonder about the "clean-up" task since it runs hourly, but I'm at a loss to imagine how that would affect custom fields.
  
  Any thoughts folks?
  
  Running 5.31.1 on Wordpress 5.5.3
  
  **Tags:** custom-fields
  
  > **Comments:**
  > **username_1**: Is it similar to this? https://lab.civicrm.org/dev/core/-/issues/1984 or https://civicrm.stackexchange.com/questions/37652/custom-fields-sometimes-missing-from-profile-until-flushing-caches/37654#37654  
  > **username_0**: @username_1, those certainly look related, but clearing the cache has not helped. Following those threads I did find a comment that suggested enabling "CiviCRM: access all custom data" for all users. I did that and it started working again. However, that leaves open the question of why it worked for a time. And also why they wouldn't work even for admin.  
  > **username_2**: The answer to "why it worked for a time" and then "wouldn't work even for admin" - if username_1 is right, then that issue was related to caching - i.e. it was delivering code cached for the wrong role. BTW - I'd post your solution as an answer so that others can try it.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-12-23. Score: 2 | Accepted answer
  
  Ultimately, the answer was simply to enable "CiviCRM: access all custom data" for all users in Administer->Users & Permissions->Permissions->WordPress Access Control.
  
  I am unclear whether this presents a data risk. The wording of the permission makes it feel a bit like this, but I guess if a user only has limited access by context then it isn't an issue. I am fervently hoping this is so.
  
  The reason it appeared to work at first was related to browser and server caching. As soon as the caches cleared it failed.
  
  
  ---
  
  