Answers.Body: <p>I had this experience with a Drupal 8 site and fixed it by enabling the permission &quot;access custom fields&quot; for anonymous visitors.</p>
  <p>In our case, the issue was that anonymous visitors couldn't access the custom fields, so if the cache was cleared, it would get populated via the anonymous access rules and that same cache was used for everyone.</p>
  <p>Clearly there was also an underlying caching problem going on.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-16T07:28:12.577Z
Answers.Text: I had the same issue on a Drupal 7 site, and can confirm that enabling that permission solved the problem.
Answers.UserDisplayName: AlainB
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-15T19:15:09.903Z
Answers.LastActivityDate: 2020-09-15T19:15:09.903Z
Answers.UserDisplayName: Alan Dixon
Answers.Body: <p>I've also encountered this issue. In a profile, some of the custom fields are displayed, but some are not, all within the same single profile.</p>
  <p>civi 5.33.2
  Joomla: 3.9.24</p>
  <p>Clearing civi cache files resolves the issue for a little while, and then issue returns. Digging into user permissions, we found that some Joomla user groups had permission to &quot;CiviCRM: profile create&quot; and others did not. We changed this so all relevant user groups (including public &amp; registered) had this permission, and when we refreshed the page with the profile and missing fields, the fields then reappeared.</p>
  <p>I'm still monitoring this to see if in fact our permissions change has any permanent affect.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-02T21:24:34.280Z
Answers.LastActivityDate: 2021-02-02T21:24:34.280Z
Answers.UserDisplayName: A. Block
Answers.Body: <p>The only way we could solve this was turning off php opcache in fpm/apache/nginx and cli</p>
  <p>For other sites with opcache turned off we had to enable schedule job 'Clean-up Temporary Data and Files' with parameters</p>
  <p>dbCache=1</p>
  <p>tplCache=1</p>
  <p>Incase you have memcache enabled then
  memCache=1</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T20:43:51.233Z
Answers.Text: Pradeep, you're saying that by merely disabling php opcache, this problem went  away and never reappeared?
Answers.UserDisplayName: TwoMice
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T21:11:23.417Z
Answers.Text: Yes.... thats how we fixed it
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T21:12:52.970Z
Answers.Text: Its temporary but we need to fix the underlying issue in core
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-12T06:14:39.477Z
Answers.Text: I do not have opcache installed. But still experiencing this on php 7.3.x
Answers.UserDisplayName: Tapash
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T17:31:24.393Z
Answers.LastActivityDate: 2020-09-24T23:02:36.950Z
Answers.LastEditDate: 2020-09-24T23:02:36.950Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>On civicrm 5.20.1 under WordPress, we have added two custom fields to the Registration Info profile (gid=12). We've added that profile to the Online Registration config for one event.</p>
  <p>Now and then, for reasons unknown, those fields will stop displaying: on the online registration form, and in the profile preview. Flushing caches (with <code>cv flush</code> or with the &quot;Cleanup Caches&quot; button at <code>q=civicrm%2Fadmin%2Fsetting%2FupdateConfigBackend&amp;reset=1</code>) causes them to reappear.</p>
  <p>Then sometime later, they disappear again, until caches are again flushed.</p>
  <p>I've verified that neither the profile fields nor the custom fields are being disabled, nor are there any changes in user permissions, ACLs, profile config, custom field config, etc. The only corrective measure is to clear caches.</p>
  <p>Is this a known issue in any 5.x version of civicrm? Naturally we're working toward an upgrade to the latest security release, but it would be nice to have some reason to believe that such upgrade might also address this mysterious issue; or to have any other way to address it besides periodically flushing caches.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-09-11T16:46:48.000Z
Comments.Text: Maybe related: https://lab.civicrm.org/dev/core/-/issues/1984
Comments.UserDisplayName: Demerit
Tags: <custom-fields><profile><cache>
Title: Custom fields sometimes missing from profile, until flushing caches
ThreadText: # Custom fields sometimes missing from profile, until flushing caches
  
  (Asked by: username_0 on 2020-09-11)
  
  On civicrm 5.20.1 under WordPress, we have added two custom fields to the Registration Info profile (gid=12). We've added that profile to the Online Registration config for one event.
  
  Now and then, for reasons unknown, those fields will stop displaying: on the online registration form, and in the profile preview. Flushing caches (with `cv flush` or with the "Cleanup Caches" button at `q=civicrm%2Fadmin%2Fsetting%2FupdateConfigBackend&reset=1`) causes them to reappear.
  
  Then sometime later, they disappear again, until caches are again flushed.
  
  I've verified that neither the profile fields nor the custom fields are being disabled, nor are there any changes in user permissions, ACLs, profile config, custom field config, etc. The only corrective measure is to clear caches.
  
  Is this a known issue in any 5.x version of civicrm? Naturally we're working toward an upgrade to the latest security release, but it would be nice to have some reason to believe that such upgrade might also address this mysterious issue; or to have any other way to address it besides periodically flushing caches.
  
  **Tags:** custom-fields, profile, cache
  
  > **Comments:**
  > **username_1**: Maybe related: https://lab.civicrm.org/dev/core/-/issues/1984  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2020-09-15. Score: 2
  
  I had this experience with a Drupal 8 site and fixed it by enabling the permission "access custom fields" for anonymous visitors.
  
  In our case, the issue was that anonymous visitors couldn't access the custom fields, so if the cache was cleared, it would get populated via the anonymous access rules and that same cache was used for everyone.
  
  Clearly there was also an underlying caching problem going on.
  
  > **Comments:**
  > **username_3**: I had the same issue on a Drupal 7 site, and can confirm that enabling that permission solved the problem.  
  
  ---
  
  ### Answer by username_4 on 2021-02-02. Score: 1
  
  I've also encountered this issue. In a profile, some of the custom fields are displayed, but some are not, all within the same single profile.
  
  civi 5.33.2
  Joomla: 3.9.24
  
  Clearing civi cache files resolves the issue for a little while, and then issue returns. Digging into user permissions, we found that some Joomla user groups had permission to "CiviCRM: profile create" and others did not. We changed this so all relevant user groups (including public & registered) had this permission, and when we refreshed the page with the profile and missing fields, the fields then reappeared.
  
  I'm still monitoring this to see if in fact our permissions change has any permanent affect.
  
  
  ---
  
  ### Answer by username_5 on 2020-09-11. Score: 1
  
  The only way we could solve this was turning off php opcache in fpm/apache/nginx and cli
  
  For other sites with opcache turned off we had to enable schedule job 'Clean-up Temporary Data and Files' with parameters
  
  dbCache=1
  
  tplCache=1
  
  Incase you have memcache enabled then
  memCache=1
  
  > **Comments:**
  > **username_0**: username_5, you're saying that by merely disabling php opcache, this problem went  away and never reappeared?  
  > **username_5**: Yes.... thats how we fixed it  
  > **username_5**: Its temporary but we need to fix the underlying issue in core  
  > **username_6**: I do not have opcache installed. But still experiencing this on php 7.3.x  
  
  ---
  
  