0

I am using civi 4.7.29 on Wordpress 4.9.4

I am having a problem searching the CiviVolunteer Positions. When I fill out the criteria and click search I get a DB Error with no information and it turns up no results when I know there are several positions available, as they are listed prior to attempting the search feature.
I am hoping this is a common issue and that someone knows where to start with resolving it.
enter image description here Thank you

(UPDATED WITH ERROR LOG)

Mar 15 22:15:51  [info] $backTrace = #0 /home/oursite/public_html

/test/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(948): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(DB_Error))
#3 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
#4 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
#5 [internal function](): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, NULL, NULL, "SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...", "DB_Error", TRUE)
#6 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(224): call_user_func_array((Array:2), (Array:8))
#7 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7))
#8 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...", "DB_Error", TRUE)
#9 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, NULL, "1052 ** Column 'id' in where clause is ambiguous")
#10 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#11 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
#12 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2446): DB_common->query("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
#13 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1635): DB_DataObject->_query("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
#14 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(392): DB_DataObject->query("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
#15 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1348): CRM_Core_DAO->query("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...", TRUE)
#16 /home/oursite/public_html/test/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/CRM/Volunteer/BAO/Project.php(470): CRM_Core_DAO::executeQuery("SELECT DISTINCT vp.*\nFROM `civicrm_volunteer_project` vp\nINNER JOIN `civicr...")
#17 /home/oursite/public_html/test/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/CRM/Volunteer/BAO/NeedSearch.php(69): CRM_Volunteer_BAO_Project::retrieve((Array:4))
#18 /home/oursite/public_html/test/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/CRM/Volunteer/BAO/NeedSearch.php(43): CRM_Volunteer_BAO_NeedSearch->search()
#19 /home/oursite/public_html/test/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/api/v3/VolunteerNeed.php(167): CRM_Volunteer_BAO_NeedSearch::doSearch((Array:10))
#20 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_volunteer_need_getsearchresult((Array:10))
#21 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(169): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#22 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(100): Civi\API\Kernel->runRequest((Array:7))
#23 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/api/api.php(23): Civi\API\Kernel->runSafe("VolunteerNeed", "getsearchresult", (Array:10), NULL)
#24 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php(311): civicrm_api("VolunteerNeed", "getsearchresult", (Array:10))
#25 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php(548): CRM_Utils_REST::process((Array:3), (Array:8))
#26 [internal function](): CRM_Utils_REST::ajax()
#27 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(275): call_user_func((Array:2))
#28 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:12))
#29 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#30 /home/oursite/public_html/test/wp-content/plugins/civicrm/civicrm.php(1246): CRM_Core_Invoke::invoke((Array:3))
#31 [internal function](): CiviCRM_For_WordPress->invoke(Object(WP))
#32 /home/oursite/public_html/test/wp-includes/class-wp-hook.php(286): call_user_func_array((Array:2), (Array:1))
#33 /home/oursite/public_html/test/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters("", (Array:1))
#34 /home/oursite/public_html/test/wp-includes/plugin.php(515): WP_Hook->do_action((Array:1))
#35 /home/oursite/public_html/test/wp-includes/class-wp.php(726): do_action_ref_array("wp", (Array:1))
#36 /home/oursite/public_html/test/wp-includes/functions.php(960): WP->main("")
#37 /home/oursite/public_html/test/wp-blog-header.php(16): wp()
#38 /home/oursite/public_html/test/index.php(17): require("/home/oursite/public_html/test/wp-blog-header.php")
  • Have you turned on error logging and looked at the logs to see if there is more info there? – Laryn - CEDC.org Mar 15 '18 at 16:32
  • Hello @Laryn-CEDC.org , I just updated my post with all the error messages received immediately after attempting to search the volunteer positions. – fdarn Mar 16 '18 at 2:23
1
+50

Is this a newer instance of mysql, or did you upgrade recently? Was this ever working in your instance?

What is your civivolunteer version? What is your mysql version?

It's a bit hard to tell given that the sql is truncated in the stack trace but I have an idea for you to investigate.

We can see that mysql is complaining, "Column 'id' in where clause is ambiguous". This is orginating in the retrieve() function of the Project in ext/org.civicrm.volunteer/CRM/Volunteer/BAO/Project.php on line 470.

You should add some logging to that function to get the full SQL statement in the php error log.

Find the line (#470):

$dao = self::executeQuery($query->toSQL());

and BEFORE it add,

trigger_error($query->toSQL());

Depending on your error_reporting php setting, you may need to provide a second argument for the error level such as, E_USER_ERROR. https://secure.php.net/manual/en/function.trigger-error.php

Does this only happen when you supply the "with" organization?

A lot of people are having problems with MySQL's changes to strict_mode, but I've verified this error is not associated with strict_mode. I'm not sure if there is a similar change between mysql versions that impacts the handling of '*' in select statements that is triggering this.

Cheers

  • This is our first attempt at using CiviVolunteer. We are using it on a subdomain, could it be a paths issue? Our CiviVolunteer version is 4.7.21-2.2.3 Our MySql version is 5.6.39 We get that DB Error only when we supply the "With organization". However if leave that field out, it still turns up 0 results when there are positions available. I actually can't test it anymore, because all of sudden it won't load on the front page in our live site or our test site. I did not change anything that could had caused this new occurence. – fdarn Mar 20 '18 at 17:25
  • Now when I attempt to view it on the frontend I get this message Do not delete this page. Page content is generated by CiviCRM. – fdarn Mar 20 '18 at 17:25
1

Bug has been filed here: https://issues.civicrm.org/jira/browse/VOL-319

But additional steps to reproduce are still needed.

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.