2

We're unable to access to the Manage groups page - it brings up a fatal error with the message:

Sorry but we are not able to provide this at the moment.
United Kingdom is not of the type Positive

I'm not sure if this is since we upgraded to 4.6.9, or if it was triggered by the creation of a group from a custom search (Contacts by date added).

We seem to be able to access individual groups by going through the groups tab in contact records, and we're able to add new groups.

The error log has the following:

Nov 05 16:00:29  [info] $Fatal Error Details = Array
(
    [message] => United Kingdom is not of the type Positive
    [code] => 
)


Nov 05 16:00:29  [info] $backTrace = #0 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Core\Error.php(364):    CRM_Core_Error::backtrace("backTrace", TRUE)
#1 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Utils\Type.php(259): CRM_Core_Error::fatal("United Kingdom is not of the type Positive")
#2 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\Query.php(5171): CRM_Utils_Type::escape("United Kingdom", "Positive")
#3 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\Query.php(3575): CRM_Contact_BAO_Query::buildClause("civicrm_address.country_id", "=", "United Kingdom", "Positive")
#4 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\Query.php(1741): CRM_Contact_BAO_Query->country((Array:5), FALSE)
#5 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\Query.php(1873): CRM_Contact_BAO_Query->whereClauseSingle((Array:5))
#6 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\Query.php(499): CRM_Contact_BAO_Query->whereClause()
#7 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\Query.php(461): CRM_Contact_BAO_Query->initialize()
#8 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\GroupContactCache.php(501): CRM_Contact_BAO_Query->__construct((Array:6), (Array:4), NULL, FALSE, FALSE, 1, TRUE, TRUE, FALSE, NULL, (Array:3))
#9 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\Query.php(2924): CRM_Contact_BAO_GroupContactCache::load(Object(CRM_Core_DAO))
#10 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\Query.php(2834): CRM_Contact_BAO_Query->addGroupContactCache((Array:1), NULL, "contact_a", "IN")
#11 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\Query.php(1657): CRM_Contact_BAO_Query->group((Array:5))
#12 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\Query.php(1873): CRM_Contact_BAO_Query->whereClauseSingle((Array:5))
#13 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\Query.php(499): CRM_Contact_BAO_Query->whereClause()
#14 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\Query.php(461): CRM_Contact_BAO_Query->initialize()
#15 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\Query.php(4314): CRM_Contact_BAO_Query->__construct((Array:1), (Array:1), NULL, TRUE, FALSE, 1, TRUE, TRUE, FALSE)
#16 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\GroupContactCache.php(220): CRM_Contact_BAO_Query::apiQuery((Array:1), (Array:1), NULL, NULL, 0, 0, FALSE)
#17 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\GroupContactCache.php(192): CRM_Contact_BAO_GroupContactCache::add((Array:36))
#18 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Contact\BAO\GroupContactCache.php(202): CRM_Contact_BAO_GroupContactCache::loadAll()
#19 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Group\Page\Group.php(147): CRM_Contact_BAO_GroupContactCache::fillIfEmpty()
#20 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Core\Page\Basic.php(178): CRM_Group_Page_Group->browse(NULL, NULL)
#21 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Core\Invoke.php(312): CRM_Core_Page_Basic->run((Array:2), NULL)
#22 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Core\Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
#23 C:\xampp\htdocs\switch\sites\all\modules\civicrm\CRM\Core\Invoke.php(54): CRM_Core_Invoke::_invoke((Array:2))
#24 C:\xampp\htdocs\switch\sites\all\modules\civicrm\drupal\civicrm.module(489): CRM_Core_Invoke::invoke((Array:2))
#25 [internal function](): civicrm_invoke("group")
#26 C:\xampp\htdocs\switch\includes\menu.inc(527): call_user_func_array("civicrm_invoke", (Array:1))
#27 C:\xampp\htdocs\switch\index.php(21): menu_execute_active_handler()
#28 {main}

Any ideas as to what might be causing this? It doesn't happen in the demo version.

0

I've seen something similar. After the failure, have you tried to go back to the manage groups page. In our case you can. The first time it goes and gets all the counts of how many contacts are in each group. The next time it doesn't. If it errors in the group count, it gives that message. You can manually trigger a count by clicking on the Update Smart Group counts link (under and to the right of the Find Groups box).

Assuming you can get to the groups the second time, try disabling the group and trigger the count. If that works, then try creating a new smart group that does the same thing the old one did. In our case that worked.

The logic that creates the sql to do the smart group is always being tweaked (it can be quite complicated). Sometimes what was created in one version doesn't work quite right in a later version.

  • No, we can't get to the manage groups page, however often we try. The group that was being created was just a regular non-smart group - we hadn't got as far as noticing the issue with the smart groups! – liblogger Nov 9 '15 at 15:53
0

There were some known issues regarding Smart Groups in 4.6.9

I would suggest you upgrade since the 4.6.10 is a security release and try rebuilding them.

  • Hi Pete - the upgrade to 4.6.10 doesn't seem to have made a difference. The link to the manage groups page is still broken. I hadn't noticed that the smart groups weren't displaying in the contact record - both before and after the upgrade it's displaying "Sorry but we are not able to provide this at the moment." and "Sorry an Error Occured / United Kingdom is not of the type Positive" – liblogger Nov 9 '15 at 16:04
  • I am able to create a Smart Group from the same search - but unlike the non-smart group, I can't then go into the group contact list page. – liblogger Nov 9 '15 at 16:07
  • Oh, and trying to rebuild the smart group cache also results in a 'United Kingdom is not of the type Positive' fatal error. My colleagues think this is stereotyping :) – liblogger Nov 9 '15 at 16:39
  • (Not sure if my previous comments reached you - still getting my head round SE) – liblogger Nov 16 '15 at 15:47
0

Similar issue has been recently resolved in master(https://issues.civicrm.org/jira/browse/CRM-17361).

Can you patch up your site with https://github.com/civicrm/civicrm-core/pull/6985 and see if it works for you ?

  • I'm afraid it doesn't seem to have made a difference. I noticed the line numbers were different, so I don't know if there are other file differences between 4.6.10 and the patched version that would affect this issue? – liblogger Nov 9 '15 at 16:18
  • yes, you need to make sure that the patch has been applied correctly. Line number may not be matching as improvements w.r.t file gets added very often. In that case, manually apply the patch pasting the added code b/w the correct starting and ending point. – jitendra - fuzion Nov 10 '15 at 7:08
  • Sorry, should have clarified - I added the patch manually because of the line number discrepancy, but we're still seeing the error. – liblogger Nov 10 '15 at 10:51
  • (Not sure if my previous comment reached you - still getting my head round SE) – liblogger Nov 16 '15 at 15:46
  • Looking at the backtrace, the country_id should be retrieved as 'id' and not the name of the country, which seems to be failing in your case due to some reason which you need to figure out. For the time being, I think, your case will work if you revert CRM/Contact/BAO/Query.php changes from this commit. Please let us know if it worked. – jitendra - fuzion Nov 17 '15 at 4:48
0

This problem recurred for us in 4.7, and the workaround suggested in the comments by jitendrapurohit didn't work when I tried to re-edit CRM/Contact/BAO/Query.php. As it seemed likely the problem was actually related to the database, I had a dig around in the db, and found that there was an old smart group linked to a saved search that was looking for contacts in the UK - that seemed to be referencing the country in a way that didn't match the current country references in CRM/Contact/BAO/Query.php, so I deleted the smart group from the db and ran the 'Rebuild Smart Group Cache' job. The fatal error is no longer being triggered, so I'm fairly sure that's what was causing the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.