Answers.Body: <p>I believe this query will help identify those orphaned saved searches that no longer have a group</p>
  <pre><code>select * from civicrm_saved_search where id not in (select saved_search_id from civicrm_group where saved_search_id is not null)
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-05T09:39:05.823Z
Answers.Text: This shows also some system-created saved searches for me, such as one with the name "CiviRule"
Answers.UserDisplayName: emma
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-05T18:36:24.207Z
Answers.Text: yes i see. perhaps the query needs to also filter out civicrm_saved_search where created_id IS NULL
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-19T14:20:56.060Z
Answers.Text: See this issue for more details: https://lab.civicrm.org/dev/core/-/issues/1845
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-02T19:00:21.423Z
Answers.LastActivityDate: 2021-02-02T19:00:21.423Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>To clear them click the left of the 2 small icons, then click the smart group criteria to go into search, hit the search button and create the smart group &amp; then delete the smart group. Then it should disappear the warning message</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-30T09:11:04.093Z
Answers.Text: Pradeep Nayak, I did as you recommended, but the warning is still there in CiviCRM System Status.
Answers.UserDisplayName: Aivars
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-23T22:03:52.793Z
Answers.Text: @Aivars You may have to repeat the create & deleting process many times until the message vanishes  I had to do it at least 7 times and every time the search criteria was different because more than one smart group cache may be causing this.
Answers.UserDisplayName: Tapash
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-01T12:57:11.820Z
Answers.Text: Thanks, @Tapash! Did it for 13 times, nothing seems to change. Actually, in my case the SEARCH CRITERIA are EMPTY, i.e. all contacts are included in this search.
Answers.UserDisplayName: Aivars
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-24T14:52:10.293Z
Answers.LastActivityDate: 2020-08-24T14:52:10.293Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>After upgrading to CiviCRM 5.27 (and now, to 5.28) on Drupal 7, I see this warning message.</p>
  <p>As you can see, GROUP is listed as &quot;-&quot; (minus).</p>
  <p><a href="https://i.sstatic.net/mP5p3.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/mP5p3.png" alt="enter image description here" /></a></p>
  <p>When I try to click on settings (Gear icon), it shows me Group Settings empty fields:</p>
  <p><a href="https://i.sstatic.net/zwpon.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/zwpon.png" alt="enter image description here" /></a></p>
  <p>When I click on <em>Contacts in this Group</em> (in Group Settings), it shows me all contacts in my CiviCRM database along with some notice warning (a lot of lines exactly like these - Undefined property and Undefined Index):</p>
  <p><a href="https://i.sstatic.net/SGbx8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/SGbx8.png" alt="enter image description here" /></a></p>
  <h1></h1>
  <h1></h1>
  <h1>UPDATE</h1>
  <p>(January, 2021)
  The problem is still there after update to 5.33.2. What can I do about that?</p>
  <p><a href="https://i.sstatic.net/DZuYc.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/DZuYc.png" alt="enter image description here" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-09-03T16:51:55.110Z
Comments.Text: I have the same problem with a couple ancient 'hidden smart groups.'  I'd be happy to delete them (and a boatload of other hidden smart groups associated with long-ago mailings that have been deleted), but I can't find any good way to do so.  I wonder if it possible to view and delete old hidden smart groups from within CiviCRM?
Comments.UserDisplayName: Don Alejandro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-09-03T20:26:13.830Z
Comments.Text: On a development server I deleted all hidden smart groups from the civicrm_group table, and all associated entries from civicrm_group_contact. I still see the error message, except the error message no longer lists two hidden smart groups. Instead there is just one line in the list - a dash where the  hidden field name should be, with edit and settings links for a the second of the two hidden groups originally flagged with errors (which no longer exist).  
  
  Seems like CiviCRM has cached the original error - is there someway to clear that or will it eventually clear itself?
Comments.UserDisplayName: Don Alejandro
Tags: <error><groups><errorhandling>
Title: Warning: Disabled/Deleted fields on Smart Groups
ThreadText: # Warning: Disabled/Deleted fields on Smart Groups
  
  (Asked by: username_0 on 2020-08-24)
  
  After upgrading to CiviCRM 5.27 (and now, to 5.28) on Drupal 7, I see this warning message.
  
  As you can see, GROUP is listed as "-" (minus).
  
  [![enter image description here](https://i.sstatic.net/mP5p3.png)](https://i.sstatic.net/mP5p3.png)
  
  When I try to click on settings (Gear icon), it shows me Group Settings empty fields:
  
  [![enter image description here](https://i.sstatic.net/zwpon.png)](https://i.sstatic.net/zwpon.png)
  
  When I click on *Contacts in this Group* (in Group Settings), it shows me all contacts in my CiviCRM database along with some notice warning (a lot of lines exactly like these - Undefined property and Undefined Index):
  
  [![enter image description here](https://i.sstatic.net/SGbx8.png)](https://i.sstatic.net/SGbx8.png)
  
  # 
  
  # 
  
  # UPDATE
  
  (January, 2021)
  The problem is still there after update to 5.33.2. What can I do about that?
  
  [![enter image description here](https://i.sstatic.net/DZuYc.png)](https://i.sstatic.net/DZuYc.png)
  
  **Tags:** error, groups, errorhandling
  
  > **Comments:**
  > **username_1**: I have the same problem with a couple ancient 'hidden smart groups.'  I'd be happy to delete them (and a boatload of other hidden smart groups associated with long-ago mailings that have been deleted), but I can't find any good way to do so.  I wonder if it possible to view and delete old hidden smart groups from within CiviCRM?  
  > **username_1**: On a development server I deleted all hidden smart groups from the civicrm_group table, and all associated entries from civicrm_group_contact. I still see the error message, except the error message no longer lists two hidden smart groups. Instead there is just one line in the list - a dash where the  hidden field name should be, with edit and settings links for a the second of the two hidden groups originally flagged with errors (which no longer exist).    Seems like CiviCRM has cached the original error - is there someway to clear that or will it eventually clear itself?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2021-02-02. Score: 1
  
  I believe this query will help identify those orphaned saved searches that no longer have a group
  select * from civicrm_saved_search where id not in (select saved_search_id from civicrm_group where saved_search_id is not null)
  
  > **Comments:**
  > **username_3**: This shows also some system-created saved searches for me, such as one with the name "CiviRule"  
  > **username_2**: yes i see. perhaps the query needs to also filter out civicrm_saved_search where created_id IS NULL  
  > **username_4**: See this issue for more details: https://lab.civicrm.org/dev/core/-/issues/1845  
  
  ---
  
  ### Answer by username_5 on 2020-08-24. Score: 1
  
  To clear them click the left of the 2 small icons, then click the smart group criteria to go into search, hit the search button and create the smart group & then delete the smart group. Then it should disappear the warning message
  
  > **Comments:**
  > **username_0**: username_5, I did as you recommended, but the warning is still there in CiviCRM System Status.  
  > **username_6**: @username_0 You may have to repeat the create & deleting process many times until the message vanishes  I had to do it at least 7 times and every time the search criteria was different because more than one smart group cache may be causing this.  
  > **username_0**: Thanks, @username_6! Did it for 13 times, nothing seems to change. Actually, in my case the SEARCH CRITERIA are EMPTY, i.e. all contacts are included in this search.  
  
  ---
  
  