Syntax errors on 4.0.0-alpha6

Created on 15 January 2025, 7 months ago

I just updated from 4.0.0-alpha5 to -alpha6, and ran into syntax errors on my Drupal 9.5.11 site.

Some examples:

ParseError: syntax error, unexpected 'protected' (T_PROTECTED), expecting variable (T_VARIABLE) in /code/web/modules/composer/conditional_fields/src/Form/ConditionalFieldDeleteForm.php on line 47

ParseError: syntax error, unexpected ')', expecting variable (T_VARIABLE) in /code/web/modules/composer/conditional_fields/src/Form/ConditionalFieldEditForm.php on line 42 #0 /code/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}('/code/web/modul...')

Made some adjustments to fix it on my end. Will upload patch shortly.

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @asila96
  • Assigned to chhavi.sharma
  • 🇮🇳India chhavi.sharma

    Generated MR for the patch #2. Needs review.

  • Pipeline finished with Failed
    3 months ago
    Total: 1251s
    #498091
  • 🇺🇸United States goose2000

    Now on Drupal 10.4.7 - patch NOT applied yet, just documenting. Error:

    ArgumentCountError: Too few arguments to function Drupal\conditional_fields\ConditionalFieldsElementAlterHelper::__construct(), 0 passed in D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Component\DependencyInjection\Container.php on line 261 and exactly 2 expected in Drupal\conditional_fields\ConditionalFieldsElementAlterHelper->__construct() (line 38 of D:\wwwroot\pss-2024-dev\web\modules\contrib\conditional_fields\src\ConditionalFieldsElementAlterHelper.php).

    #0 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Component\DependencyInjection\Container.php(261): Drupal\conditional_fields\ConditionalFieldsElementAlterHelper->__construct()
    #1 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Component\DependencyInjection\Container.php(179): Drupal\Component\DependencyInjection\Container->createService(Array, 'conditional_fie...')
    #2 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal.php(197): Drupal\Component\DependencyInjection\Container->get('conditional_fie...')
    #3 D:\wwwroot\pss-2024-dev\web\modules\contrib\conditional_fields\conditional_fields.module(102): Drupal::service('conditional_fie...')
    #4 [internal function]: conditional_fields_element_after_build(Array, Object(Drupal\Core\Form\FormState))
    #5 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Form\FormBuilder.php(1082): call_user_func_array('conditional_fie...', Array)
    #6 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Form\FormBuilder.php(1074): Drupal\Core\Form\FormBuilder->doBuildForm('views_exposed_f...', Array, Object(Drupal\Core\Form\FormState))
    #7 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Form\FormBuilder.php(579): Drupal\Core\Form\FormBuilder->doBuildForm('views_exposed_f...', Array, Object(Drupal\Core\Form\FormState))
    #8 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Form\FormBuilder.php(326): Drupal\Core\Form\FormBuilder->processForm('views_exposed_f...', Array, Object(Drupal\Core\Form\FormState))
    #9 D:\wwwroot\pss-2024-dev\web\core\modules\views\src\Plugin\views\exposed_form\ExposedFormPluginBase.php(134): Drupal\Core\Form\FormBuilder->buildForm('\\Drupal\\views\\F...', Object(Drupal\Core\Form\FormState))
    #10 D:\wwwroot\pss-2024-dev\web\core\modules\views\src\ViewExecutable.php(1298): Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase->renderExposedForm()
    #11 D:\wwwroot\pss-2024-dev\web\core\modules\views\src\Plugin\views\display\PathPluginBase.php(393): Drupal\views\ViewExecutable->build()
    #12 D:\wwwroot\pss-2024-dev\web\core\modules\views\src\Plugin\views\display\Page.php(198): Drupal\views\Plugin\views\display\PathPluginBase->execute()
    #13 D:\wwwroot\pss-2024-dev\web\core\modules\views\src\ViewExecutable.php(1690): Drupal\views\Plugin\views\display\Page->execute()
    #14 D:\wwwroot\pss-2024-dev\web\core\modules\views\src\Element\View.php(81): Drupal\views\ViewExecutable->executeDisplay('page_1', Array)
    #15 [internal function]: Drupal\views\Element\View::preRenderViewElement(Array)
    #16 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Security\DoTrustedCallbackTrait.php(113): call_user_func_array(Array, Array)
    #17 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Render\Renderer.php(875): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...')
    #18 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Render\Renderer.php(432): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
    #19 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Render\Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, false)
    #20 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Render\MainContent\HtmlRenderer.php(238): Drupal\Core\Render\Renderer->render(Array, false)
    #21 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Render\Renderer.php(638): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
    #22 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Render\MainContent\HtmlRenderer.php(239): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
    #23 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Render\MainContent\HtmlRenderer.php(128): Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
    #24 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\EventSubscriber\MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
    #25 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
    #26 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
    #27 D:\wwwroot\pss-2024-dev\vendor\symfony\http-kernel\HttpKernel.php(186): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view')
    #28 D:\wwwroot\pss-2024-dev\vendor\symfony\http-kernel\HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
    #29 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\StackMiddleware\Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #30 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\StackMiddleware\KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #31 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\StackMiddleware\ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #32 D:\wwwroot\pss-2024-dev\web\core\modules\big_pipe\src\StackMiddleware\ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #33 D:\wwwroot\pss-2024-dev\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #34 D:\wwwroot\pss-2024-dev\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #35 D:\wwwroot\pss-2024-dev\web\core\modules\ban\src\BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #36 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\StackMiddleware\ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #37 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\StackMiddleware\NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #38 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\StackMiddleware\AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #39 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\StackMiddleware\StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #40 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #41 D:\wwwroot\pss-2024-dev\web\index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
    #42 {main}
  • 🇺🇸United States goose2000

    I was able to apply the patch fine:
    git apply fix_syntax_errors-3500066-2.patch

    I think most errors are now gone, but found a new one I think:
    Drupal 10.4.7
    PHP 8.1

    TypeError: Drupal\Component\Utility\NestedArray::getValue(): Argument #2 ($parents) must be of type array, null given, called in D:\wwwroot\pss-2024-dev\web\modules\contrib\conditional_fields\src\ConditionalFieldsFormHelper.php on line 905 in Drupal\Component\Utility\NestedArray::getValue() (line 69 of D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Component\Utility\NestedArray.php).

    #0 D:\wwwroot\pss-2024-dev\web\modules\contrib\conditional_fields\src\ConditionalFieldsFormHelper.php(905): Drupal\Component\Utility\NestedArray::getValue(Array, NULL)
    #1 D:\wwwroot\pss-2024-dev\web\modules\contrib\conditional_fields\src\ConditionalFieldsFormHelper.php(830): Drupal\conditional_fields\ConditionalFieldsFormHelper::formFieldGetValues(NULL, Object(Drupal\Core\Form\FormState))
    #2 [internal function]: Drupal\conditional_fields\ConditionalFieldsFormHelper::formValidate(Array, Object(Drupal\Core\Form\FormState))
    #3 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Form\FormValidator.php(82): call_user_func_array(Array, Array)
    #4 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Form\FormValidator.php(274): Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object(Drupal\Core\Form\FormState))
    #5 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Form\FormValidator.php(118): Drupal\Core\Form\FormValidator->doValidateForm(Array, Object(Drupal\Core\Form\FormState), 'node_recertific...')
    #6 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Form\FormBuilder.php(593): Drupal\Core\Form\FormValidator->validateForm('node_recertific...', Array, Object(Drupal\Core\Form\FormState))
    #7 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Form\FormBuilder.php(326): Drupal\Core\Form\FormBuilder->processForm('node_recertific...', Array, Object(Drupal\Core\Form\FormState))
    #8 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Controller\FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\node\NodeForm), Object(Drupal\Core\Form\FormState))
    #9 D:\wwwroot\pss-2024-dev\web\core\modules\layout_builder\src\Controller\LayoutBuilderHtmlEntityFormController.php(39): Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
    #10 [internal function]: Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
    #11 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
    #12 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\Render\Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #13 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
    #14 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
    #15 D:\wwwroot\pss-2024-dev\vendor\symfony\http-kernel\HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #16 D:\wwwroot\pss-2024-dev\vendor\symfony\http-kernel\HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
    #17 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\StackMiddleware\Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #18 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\StackMiddleware\KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #19 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\StackMiddleware\ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #20 D:\wwwroot\pss-2024-dev\web\core\modules\big_pipe\src\StackMiddleware\ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #21 D:\wwwroot\pss-2024-dev\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #22 D:\wwwroot\pss-2024-dev\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #23 D:\wwwroot\pss-2024-dev\web\core\modules\ban\src\BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #24 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\StackMiddleware\ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #25 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\StackMiddleware\NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #26 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\StackMiddleware\AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #27 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\StackMiddleware\StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #28 D:\wwwroot\pss-2024-dev\web\core\lib\Drupal\Core\DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #29 D:\wwwroot\pss-2024-dev\web\index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
    #30 {main}
Production build 0.71.5 2024