Answers.Body: <p>This is a known issue with a fix in the works - see <a href="https://github.com/civicrm/civicrm-core/pull/13551" rel="nofollow noreferrer">Github PR#13551</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-14T18:58:55.313Z
Answers.LastActivityDate: 2019-02-14T18:58:55.313Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>I have not experienced this yet @twomice. I tend to use <code>Civi::settings()-&gt;set</code> as well in my upgrader and/or config file in my extension too, perhaps that might help?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-14T16:10:16.073Z
Answers.Text: Thanks, ErikH. By chance could you share a link to an example of such code?
Answers.UserDisplayName: TwoMice
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-18T10:02:33.403Z
Answers.Text: Ofcourse @twomice: here you can see the initial settings in the Upgrader class https://github.com/CiviCooP/be.mediwe.basis/blob/master/CRM/Basis/Upgrader.php
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-14T09:11:33.627Z
Answers.LastActivityDate: 2019-02-14T09:11:33.627Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>On a couple of my own extensions and some that are not my own, I've seen that the extension settings go missing immediately upon upgrading the extension. These extensions all define settings metadata in a php file <em>a la</em> hook_civicrm_alterSettingsFolders() (e.g. <a href="https://github.com/twomice/com.joineryhq.activityical/issues/27" rel="nofollow noreferrer">https://github.com/twomice/com.joineryhq.activityical/issues/27</a>)</p>
  
  <p>It's not just that the setting values are cleared; rather, the settings themselves are uknown to CiviCRM. This is evident when viewing the Settings page for the extension; if that extension settings page is built dynamically using the Settings API to build the list of settings fields for that form, the form will contain no fields at all, because the Settings API finds no settings.</p>
  
  <p>The workaround for this situation is to clear CiviCRM caches (e.g., run <code>cv flush</code> or use Administer > System Settings > Cleanup Caches and Update Paths). After doing that, the settings are once again available, although unfortunately their values have been cleared and must be reset.</p>
  
  <p>Extensions where I've seen this recently:</p>
  
  <ul>
  <li><a href="https://github.com/twomice/com.joineryhq.activityical" rel="nofollow noreferrer">https://github.com/twomice/com.joineryhq.activityical</a> (see issue: <a href="https://github.com/twomice/com.joineryhq.activityical/issues/27" rel="nofollow noreferrer">https://github.com/twomice/com.joineryhq.activityical/issues/27</a>)</li>
  <li><a href="https://github.com/osseed/com.osseed.eventcalendar" rel="nofollow noreferrer">https://github.com/osseed/com.osseed.eventcalendar</a></li>
  </ul>
  
  <p>Is anyone else seeing similar behavior, and are you aware of a cause, a fix, or something extension devs can do to avoid this issue?</p>
  
Tags: <extension><settings><cache>
Title: Extension settings lost on upgrade - known issue?
ThreadText: # Extension settings lost on upgrade - known issue?
  
  (Asked by: username_0 on 2019-02-13)
  
  On a couple of my own extensions and some that are not my own, I've seen that the extension settings go missing immediately upon upgrading the extension. These extensions all define settings metadata in a php file *a la* hook\_civicrm\_alterSettingsFolders() (e.g. <https://github.com/twomice/com.joineryhq.activityical/issues/27>)
  
  It's not just that the setting values are cleared; rather, the settings themselves are uknown to CiviCRM. This is evident when viewing the Settings page for the extension; if that extension settings page is built dynamically using the Settings API to build the list of settings fields for that form, the form will contain no fields at all, because the Settings API finds no settings.
  
  The workaround for this situation is to clear CiviCRM caches (e.g., run `cv flush` or use Administer > System Settings > Cleanup Caches and Update Paths). After doing that, the settings are once again available, although unfortunately their values have been cleared and must be reset.
  
  Extensions where I've seen this recently:
  
  * <https://github.com/twomice/com.joineryhq.activityical> (see issue: <https://github.com/twomice/com.joineryhq.activityical/issues/27>)
  * <https://github.com/osseed/com.osseed.eventcalendar>
  
  Is anyone else seeing similar behavior, and are you aware of a cause, a fix, or something extension devs can do to avoid this issue?
  
  **Tags:** extension, settings, cache
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-02-14. Score: 0 | Accepted answer
  
  This is a known issue with a fix in the works - see [Github PR#13551](https://github.com/civicrm/civicrm-core/pull/13551).
  
  
  ---
  
  ### Answer by username_2 on 2019-02-14. Score: 0
  
  I have not experienced this yet @twomice. I tend to use `Civi::settings()->set` as well in my upgrader and/or config file in my extension too, perhaps that might help?
  
  > **Comments:**
  > **username_0**: Thanks, ErikH. By chance could you share a link to an example of such code?  
  > **username_2**: Ofcourse @twomice: here you can see the initial settings in the Upgrader class https://github.com/CiviCooP/be.mediwe.basis/blob/master/CRM/Basis/Upgrader.php  
  
  ---
  
  