Problem/Motivation

First time trying this module. I'm unable to anaylize the site code. I get the following error.

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /batch?id=468&op=do_nojs&op=do
StatusText: 500 Service unavailable (with message)
ResponseText: The website encountered an unexpected error. Try again later.TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in count() (line 1182 of /Users/loze/Sites/hsc/vendor/drupal-code-builder/drupal-code-builder/Task/Collect/PluginTypesCollector.php). DrupalCodeBuilder\Task\Collect\PluginTypesCollector->addConfigSchemaPrefix(Array) (Line: 312)
DrupalCodeBuilder\Task\Collect\PluginTypesCollector->gatherPluginTypeInfo(Array) (Line: 129)
DrupalCodeBuilder\Task\Collect\PluginTypesCollector->collect(Array) (Line: 143)
DrupalCodeBuilder\Task\Collect->collectComponentDataIncremental(Array, Array) (Line: 241)
Drupal\module_builder\Form\ProcessForm::batchOperation(Array, Array) (Line: 296)
_batch_process() (Line: 138)
_batch_do() (Line: 94)
_batch_page(Object) (Line: 52)
Drupal\system\Controller\BatchController->batchPage(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
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: 53)
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: 206)
Drupal\cleantalk\EventSubscriber\BootSubscriber->handle(Object, 1, 1) (Line: 53)
Asm89\Stack\Cors->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: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Comments

loze created an issue. See original summary.

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

Could you debug and see what's going on at line 1180 please?

jlholmes’s picture

I am having a similar issue with an Ajax error preventing code analysis from completing. The error occurs in drupal-code-builder/EntityTypesCollector.php file in public function collect($job_list) at the line 'label' => $entity_type->getLabel()->getUntranslatedString()

   foreach ($entity_types as $id => $entity_type) {
      $data[$id] = [
        <strong>'label' => $entity_type->getLabel()->getUntranslatedString(),</strong>
        'group' => $entity_type->getGroup(),
      ];

My site does not use translation (Content Translation, Configuration Translation, Interface Translation are all disabled). $entity_type->getLabel() returns a string resulting in getUntranslatedString() throwing an error "error evaluating code: Call to a member function getUntranslated_string() on string". On the 72nd pass through the loop, Ajax has had enough and stops.

Here is the error

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /batch?id=1340&op=do_nojs&op=do
StatusText: error
ResponseText: The website encountered an unexpected error. Try again later.Error: Call to a member function getUntranslatedString() on string in DrupalCodeBuilder\Task\Collect\EntityTypesCollector->collect() (line 65 of /var/www/html/vendor/drupal-code-builder/drupal-code-builder/Task/Collect/EntityTypesCollector.php). DrupalCodeBuilder\Task\Collect->collectComponentDataIncremental() (Line: 241)
Drupal\module_builder\Form\ProcessForm::batchOperation() (Line: 297)
_batch_process() (Line: 139)
_batch_do() (Line: 95)
_batch_page() (Line: 52)
Drupal\system\Controller\BatchController->batchPage()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 637)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 206)
Drupal\cleantalk\EventSubscriber\BootSubscriber->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

joachim’s picture

@jlholmes That doesn't look like the same problem as the OP here. I've filed https://github.com/drupal-code-builder/drupal-code-builder/issues/403 for it and I'll make a new release soon with the fix.

jlholmes’s picture

@joachim Sorry. I note that removing '->getUntranslatedString()' from line 65 solves the problem and allows the code analysis to complete.

joachim’s picture

I've made a new release of drupal-code-builder/drupal-code-builder with that fix.