Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-15457

Recurring event logic bombs during setup of demo site [CiviVolunteer]

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6
    • Fix Version/s: 4.6
    • Component/s: None
    • Labels:
      None
    • Documentation Required?:
      None

      Description

      Currently, the sandbox site running Drupal & CiviCRM [master] fails to build:

      https://test.civicrm.org/view/Sites/job/demo.civicrm.org/BLDNAME=dmaster,label=www-demo/35/console

      The problem occurs during installation of CiviVolunteer. I obtained a backtrace and then added some debug code to CRM_Core_BAO_RecurringEntity::triggerInsert() (circa line 616 – var_dump($linkedDAO). The combined output with the debug code and backtrace is here:

      ------------------
      totten@thneed:~/buildkit/build/dmaster$ civibuild restore dmaster ; drush -y cvapi extension.install key=org.civicrm.volunteer debug=1
      [[Load saved options from /Users/totten/buildkit/build/dmaster.sh]]
      [[Setup MySQL and HTTP for CMS]]
      [[Restore "CMS" DB (dmastercms_vc6m1) from file (/Users/totten/buildkit/app/snapshot/dmaster/cms.sql.gz)]]
      [[Setup MySQL for Civi]]
      [[Restore "CIVI" DB (dmasterciv_ojunt) from file (/Users/totten/buildkit/app/snapshot/dmaster/civi.sql.gz)]]
      [[Setup MySQL for Test]]
      [[Restore "TEST" DB (dmastertes_iomjr) from file (/Users/totten/buildkit/app/snapshot/dmaster/civi.sql.gz)]]
      array(1) {
      ["triggerInsert"]=>
      array(1) {
      ["$linkedDAO"]=>
      object(CRM_Core_DAO_UFJoin)#138 (20) {
      ["id"]=>
      string(2) "12"
      ["is_active"]=>
      string(1) "1"
      ["module"]=>
      string(13) "CiviVolunteer"
      ["entity_table"]=>
      NULL
      ["entity_id"]=>
      NULL
      ["weight"]=>
      string(2) "10"
      ["uf_group_id"]=>
      string(2) "14"
      ["module_data"]=>
      NULL
      ["_DB_DataObject_version"]=>
      string(6) "1.8.12"
      ["__table"]=>
      string(15) "civicrm_uf_join"
      ["N"]=>
      int(1)
      ["_database_dsn"]=>
      string(0) ""
      ["_database_dsn_md5"]=>
      string(32) "3ec7ae8f080d4945955e5e8155244884"
      ["_database"]=>
      string(16) "dmasterciv_ojunt"
      ["_query"]=>
      array(7)

      { ["condition"]=> string(0) "" ["group_by"]=> string(0) "" ["order_by"]=> string(0) "" ["having"]=> string(0) "" ["limit_start"]=> string(0) "" ["limit_count"]=> string(0) "" ["data_select"]=> string(1) "*" }

      ["_DB_resultid"]=>
      int(30)
      ["_resultFields"]=>
      bool(false)
      ["_link_loaded"]=>
      bool(false)
      ["_join"]=>
      string(0) ""
      ["_lastError"]=>
      bool(false)
      }
      }
      }
      Array
      (
      [trace] => #0 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Utils/Type.php(347): CRM_Core_Error::fatal('One of paramete...')
      #1 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/DAO.php(1198): CRM_Utils_Type::validate(NULL, 'Integer')
      #2 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/DAO.php(1164): CRM_Core_DAO::composeQuery('? SELECT p...', Array, true)
      #3 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/BAO/RecurringEntity.php(451): CRM_Core_DAO::singleValueQuery('? SELECT p...', Array)
      #4 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/BAO/RecurringEntity.php(418): CRM_Core_BAO_RecurringEntity::getParentFor(NULL, NULL)
      #5 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/BAO/RecurringEntity.php(620): CRM_Core_BAO_RecurringEntity::getEntitiesFor(NULL, NULL)
      #6 [internal function]: CRM_Core_BAO_RecurringEntity::triggerInsert(Object(Civi\Core\DAO\Event\PostUpdate))
      #7 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/packages/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Civi\Core\DAO\Event\PostUpdate))
      #8 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/packages/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(53): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'DAO::post-inser...', Object(Civi\Core\DAO\Event\PostUpdate))
      #9 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/DAO.php(461): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('DAO::post-inser...', Object(Civi\Core\DAO\Event\PostUpdate))
      #10 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Utils/Migrate/Import.php(470): CRM_Core_DAO->save()
      #11 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Utils/Migrate/Import.php(86): CRM_Utils_Migrate_Import->profileJoins(Object(SimpleXMLElement), Array)
      #12 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Utils/Migrate/Import.php(57): CRM_Utils_Migrate_Import->runXmlElement(Object(SimpleXMLElement))
      #13 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/tools/extensions/civivolunteer/CRM/Volunteer/Upgrader/Base.php(95): CRM_Utils_Migrate_Import->run('/Users/totten/b...')
      #14 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/tools/extensions/civivolunteer/CRM/Volunteer/Upgrader/Base.php(245): CRM_Volunteer_Upgrader_Base::executeCustomDataFileByAbsPath('/Users/totten/b...')
      #15 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/tools/extensions/civivolunteer/volunteer.civix.php(45): CRM_Volunteer_Upgrader_Base->onInstall()
      #16 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/tools/extensions/civivolunteer/volunteer.php(99): _volunteer_civix_civicrm_install()
      #17 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Extension/Manager/Module.php(77): volunteer_civicrm_install()
      #18 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Extension/Manager/Module.php(50): CRM_Extension_Manager_Module->callHook(Object(CRM_Extension_Info), 'install')
      #19 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Extension/Manager.php(224): CRM_Extension_Manager_Module->onPreInstall(Object(CRM_Extension_Info))
      #20 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/api/v3/Extension.php(63): CRM_Extension_Manager->install(Array)
      #21 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(86): civicrm_api3_extension_install(Array)
      #22 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/Civi/API/Kernel.php(95): Civi\API\Provider\MagicFunctionProvider->invoke(Array)
      #23 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/api/api.php(25): Civi\API\Kernel->run('extension', 'install', Array, NULL)
      #24 /Users/totten/buildkit/build/dmaster/sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc(1365): civicrm_api('extension', 'install', Array)
      #25 [internal function]: drush_civicrm_api('extension.insta...', 'key=org.civicrm...', 'debug=1')
      #26 /Users/totten/buildkit/vendor/drush/drush/includes/command.inc(362): call_user_func_array('drush_civicrm_a...', Array)
      #27 /Users/totten/buildkit/vendor/drush/drush/includes/command.inc(214): _drush_invoke_hooks(Array, Array)
      #28 [internal function]: drush_command('extension.insta...', 'key=org.civicrm...', 'debug=1')
      #29 /Users/totten/buildkit/vendor/drush/drush/includes/command.inc(182): call_user_func_array('drush_command', Array)
      #30 /Users/totten/buildkit/vendor/drush/drush/drush.php(92): drush_dispatch(Array)
      #31 /Users/totten/buildkit/vendor/drush/drush/drush.php(61): _drush_bootstrap_and_dispatch()
      #32 /Users/totten/buildkit/vendor/drush/drush/drush.php(16): drush_main()
      #33

      {main}

      [is_error] => 1
      [error_message] => A fatal error was triggered: One of parameters (value: ) is not of the type Integer
      )
      ------------------

      CiviVolunteer apparently creates a record in civicrm_uf_join during installation, and the triggerInsert() doesn't seem to understand this record (which has NULL values for entity-table/entity-id):

      mysql> select * from civicrm_uf_join;
      --------------------------------------------------------------------------------+

      id is_active module entity_table entity_id weight uf_group_id module_data

      --------------------------------------------------------------------------------+

      1 1 User Registration NULL NULL 1 1 NULL
      2 1 User Account NULL NULL 1 1 NULL
      3 1 Profile NULL NULL 1 1 NULL
      4 1 Profile NULL NULL 2 2 NULL
      5 1 Profile NULL NULL 11 12 NULL
      6 1 CiviEvent civicrm_event 6 1 12 NULL
      7 1 CiviEvent civicrm_event 1 1 12 NULL
      8 1 CiviEvent civicrm_event 3 1 12 NULL
      9 1 CiviEvent civicrm_event 4 1 12 NULL
      10 1 CiviEvent civicrm_event 5 1 12 NULL
      11 1 CiviEvent civicrm_event 2 1 12 NULL
      12 1 CiviVolunteer NULL NULL 10 14 NULL

      --------------------------------------------------------------------------------+

      I'm not familiar enough with what's going on here to determine the right fix. (Can it be as simple as ignoring records with null entity-ids?)

        Attachments

          Activity

            People

            • Assignee:
              deepak Deepak Srivastava
              Reporter:
              timotten Tim Otten
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: