Answers.Body: <p>do not know if there was bad code , bur a &quot;composer update -W&quot; brought down version 570.1 and then Could not delete without locking up the site, so I ran an update.  Same issue, but it threw arrors into the terminal of  the $var error and identified the file as /vendor/pear/db/DB.php on line 474, 547, 549 and 552, and I fixed those, and had to run &quot;mysql_upgrade -u root -pxxx &quot; from a mysql.proc error and it finally came up  See also <a href="https://stackoverflow.com/questions/27918764/cannot-load-from-mysql-proc-the-table-is-probably-corrupted">https://stackoverflow.com/questions/27918764/cannot-load-from-mysql-proc-the-table-is-probably-corrupted</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-28T21:45:01.583Z
Answers.LastActivityDate: 2024-02-28T21:45:01.583Z
Answers.UserDisplayName: Wilbur Union
Body: <p>On attempt to install on Drupal 10.2.3 I get at line</p>
  <pre><code>if (isset($this-&gt;dispatchPolicyExact[$eventName])) {
  </code></pre>
  <pre><code>TypeError: Illegal offset type in isset or empty in Civi\Core\CiviEventDispatcher-&gt;checkDispatchPolicy() (line 417 of vendor/civicrm/civicrm-core/Civi/Core/CiviEventDispatcher.php).
  Civi\Core\CiviEventDispatcher-&gt;dispatch(Object, 'civi.setup.init') (Line: 106)
  Civi\Setup::init(Array) (Line: 120)
  _civicrm_setup() (Line: 71)
  civicrm_requirements('install')
  call_user_func_array(Object, Array) (Line: 400)
  Drupal\Core\Extension\ModuleHandler-&gt;invoke('civicrm', 'requirements', Array) (Line: 156)
  Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler-&gt;invoke('civicrm', 'requirements', Array) (Line: 958)
  drupal_check_module('civicrm') (Line: 463)
  Drupal\system\Form\ModulesListForm-&gt;buildModuleList(Object) (Line: 481)
  Drupal\system\Form\ModulesListForm-&gt;submitForm(Array, Object)
  call_user_func_array(Array, Array) (Line: 129)
  Drupal\Core\Form\FormSubmitter-&gt;executeSubmitHandlers(Array, Object) (Line: 67)
  Drupal\Core\Form\FormSubmitter-&gt;doSubmitForm(Array, Object) (Line: 597)
  Drupal\Core\Form\FormBuilder-&gt;processForm('system_modules', Array, Object) (Line: 325)
  Drupal\Core\Form\FormBuilder-&gt;buildForm(Object, Object) (Line: 73)
  Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)
  call_user_func_array(Array, Array) (Line: 123)
  Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 627)
  Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 121)
  Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
  Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 181)
  Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 76)
  Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 58)
  Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 48)
  Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 28)
  Drupal\Core\StackMiddleware\ContentLength-&gt;handle(Object, 1, 1) (Line: 32)
  Drupal\big_pipe\StackMiddleware\ContentLength-&gt;handle(Object, 1, 1) (Line: 106)
  Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 85)
  Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 52)
  Drupal\crawler_rate_limit\CrawlerRateLimitMiddleware-&gt;handle(Object, 1, 1) (Line: 57)
  Drupal\advban\AdvbanMiddleware-&gt;handle(Object, 1, 1) (Line: 50)
  Drupal\ban\BanMiddleware-&gt;handle(Object, 1, 1) (Line: 48)
  Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 51)
  Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 36)
  Drupal\Core\StackMiddleware\AjaxPageState-&gt;handle(Object, 1, 1) (Line: 51)
  Drupal\Core\StackMiddleware\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 704)
  Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-12T21:49:55.800Z
Comments.Text: Can you check in composer.lock and see what versions of the various symfony/event* packages got installed? I'm wondering if symfony 7 got installed - I don't think there's been much testing with 7.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-13T19:26:02.617Z
Comments.Text: Composer show - tends to indicate v6.43 is installed
Comments.UserDisplayName: Wilbur Union
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-13T22:32:29.813Z
Comments.Text: Ok, are you able to debug what $eventName is in line 417 in CiviEventDispatcher.php - it sounds like it's an array or something but the value might give a clue what's happening. Also the isset() is on line 415, so it's a little strange the error says it's line 417 - unless maybe you had already added some debugging code.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-15T18:45:02.067Z
Comments.Text: This has been an issue for quite awhile.  See e.g. https://github.com/civicrm/civicrm-core/pull/19960
Comments.UserDisplayName: Wilbur Union
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-15T18:56:16.613Z
Comments.Text: Timed out on me --- This has been an issue for quite awhile.  See e.g. https://github.com/civicrm/civicrm-core/pull/19960  The line is right because I have two extra use statements at the top from a virgin file which are "hookstylelistener" and  "hookstyleservicelistener"  The code does change it to an array  and there is an array_merge above
Comments.UserDisplayName: Wilbur Union
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-15T19:59:46.990Z
Comments.Text: In your stacktrace, it has `Civi\Core\CiviEventDispatcher->dispatch(Object, 'civi.setup.init')` being called from setup\src\Setup.php in its init() function. If you look at how that line is supposed to look, it has the event name first, and the event object second: https://github.com/civicrm/civicrm-core/blob/7e2d00f356f254d19c13220e63b4c96f5de10044/setup/src/Setup.php#L105. What do you have there?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-17T00:11:39.993Z
Comments.Text: Mine is backwards =>        self::$instance->getDispatcher()->dispatch($event, 'civi.setup.init');   and I tried reversing it and same result
Comments.UserDisplayName: Wilbur Union
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-18T18:04:28.943Z
Comments.Text: It sounds like you have several customized files in the core tree. Have you tried using a fresh version of the code? e.g. delete vendor/civicrm/civicrm-core and run composer install to pull down a fresh copy.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-18T18:17:35.660Z
Comments.Text: So you mean delete the directories and then in the core directory run composer install ??
Comments.UserDisplayName: Wilbur Union
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-18T18:27:25.980Z
Comments.Text: delete vendor/civicrm/civicrm-core and then in the top level directory of the whole install, where you have web, vendor, and drupal's composer.json and composer.lock, is where you run composer install. Unless you have a non-standard setup - so I mean however you downloaded civicrm-core code before, refresh it with a fresh copy.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-19T21:29:10.157Z
Comments.Text: OK - I did that once before, but I did run rector to update - because I was getting  a $var error.  I will try it again.  I did not delete the directory previously
Comments.UserDisplayName: Wilbur Union
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-02-28T21:42:28.393Z
Comments.Text: Could not delete without locking up the site, so I ran an update.  Same issue, but it threw arrors into the terminal of  the $var error and identified the file as /vendor/pear/db/DB.php on line 474, 547, 549 and 552, and I fixed those, and had to run "mysql_upgrade -u root -pxxx " from a mysql.proc error and it finally came up
Comments.UserDisplayName: Wilbur Union
Tags: <install>
Title: illegal offset type in CiviEventDispatcher
ThreadText: # illegal offset type in CiviEventDispatcher
  
  (Asked by: username_0 on 2024-02-12)
  
  On attempt to install on Drupal 10.2.3 I get at line
  if (isset($this->dispatchPolicyExact[$eventName])) {
  
  TypeError: Illegal offset type in isset or empty in Civi\Core\CiviEventDispatcher->checkDispatchPolicy() (line 417 of vendor/civicrm/civicrm-core/Civi/Core/CiviEventDispatcher.php).
  Civi\Core\CiviEventDispatcher->dispatch(Object, 'civi.setup.init') (Line: 106)
  Civi\Setup::init(Array) (Line: 120)
  _civicrm_setup() (Line: 71)
  civicrm_requirements('install')
  call_user_func_array(Object, Array) (Line: 400)
  Drupal\Core\Extension\ModuleHandler->invoke('civicrm', 'requirements', Array) (Line: 156)
  Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler->invoke('civicrm', 'requirements', Array) (Line: 958)
  drupal_check_module('civicrm') (Line: 463)
  Drupal\system\Form\ModulesListForm->buildModuleList(Object) (Line: 481)
  Drupal\system\Form\ModulesListForm->submitForm(Array, Object)
  call_user_func_array(Array, Array) (Line: 129)
  Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 67)
  Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
  Drupal\Core\Form\FormBuilder->processForm('system_modules', Array, Object) (Line: 325)
  Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
  Drupal\Core\Controller\FormController->getContentResult(Object, Object)
  call_user_func_array(Array, Array) (Line: 123)
  Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
  Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
  Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
  Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
  Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
  Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
  Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
  Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
  Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
  Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
  Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
  Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 52)
  Drupal\crawler_rate_limit\CrawlerRateLimitMiddleware->handle(Object, 1, 1) (Line: 57)
  Drupal\advban\AdvbanMiddleware->handle(Object, 1, 1) (Line: 50)
  Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
  Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
  Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
  Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
  Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
  Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
  
  **Tags:** install
  
  > **Comments:**
  > **username_1**: Can you check in composer.lock and see what versions of the various symfony/event* packages got installed? I'm wondering if symfony 7 got installed - I don't think there's been much testing with 7.  
  > **username_0**: Composer show - tends to indicate v6.43 is installed  
  > **username_1**: Ok, are you able to debug what $eventName is in line 417 in CiviEventDispatcher.php - it sounds like it's an array or something but the value might give a clue what's happening. Also the isset() is on line 415, so it's a little strange the error says it's line 417 - unless maybe you had already added some debugging code.  
  > **username_0**: This has been an issue for quite awhile.  See e.g. https://github.com/civicrm/civicrm-core/pull/19960  
  > **username_0**: Timed out on me --- This has been an issue for quite awhile.  See e.g. https://github.com/civicrm/civicrm-core/pull/19960  The line is right because I have two extra use statements at the top from a virgin file which are "hookstylelistener" and  "hookstyleservicelistener"  The code does change it to an array  and there is an array_merge above  
  > **username_1**: In your stacktrace, it has `Civi\Core\CiviEventDispatcher->dispatch(Object, 'civi.setup.init')` being called from setup\src\Setup.php in its init() function. If you look at how that line is supposed to look, it has the event name first, and the event object second: https://github.com/civicrm/civicrm-core/blob/7e2d00f356f254d19c13220e63b4c96f5de10044/setup/src/Setup.php#L105. What do you have there?  
  > **username_0**: Mine is backwards =>        self::$instance->getDispatcher()->dispatch($event, 'civi.setup.init');   and I tried reversing it and same result  
  > **username_1**: It sounds like you have several customized files in the core tree. Have you tried using a fresh version of the code? e.g. delete vendor/civicrm/civicrm-core and run composer install to pull down a fresh copy.  
  > **username_0**: So you mean delete the directories and then in the core directory run composer install ??  
  > **username_1**: delete vendor/civicrm/civicrm-core and then in the top level directory of the whole install, where you have web, vendor, and drupal's composer.json and composer.lock, is where you run composer install. Unless you have a non-standard setup - so I mean however you downloaded civicrm-core code before, refresh it with a fresh copy.  
  > **username_0**: OK - I did that once before, but I did run rector to update - because I was getting  a $var error.  I will try it again.  I did not delete the directory previously  
  > **username_0**: Could not delete without locking up the site, so I ran an update.  Same issue, but it threw arrors into the terminal of  the $var error and identified the file as /vendor/pear/db/DB.php on line 474, 547, 549 and 552, and I fixed those, and had to run "mysql_upgrade -u root -pxxx " from a mysql.proc error and it finally came up  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2024-02-28. Score: 0
  
  do not know if there was bad code , bur a "composer update -W" brought down version 570.1 and then Could not delete without locking up the site, so I ran an update. Same issue, but it threw arrors into the terminal of the $var error and identified the file as /vendor/pear/db/DB.php on line 474, 547, 549 and 552, and I fixed those, and had to run "mysql\_upgrade -u root -pxxx " from a mysql.proc error and it finally came up See also <https://stackoverflow.com/questions/27918764/cannot-load-from-mysql-proc-the-table-is-probably-corrupted>
  
  
  ---
  
  