Field Group 3.5 WSODs on Drupal 10.3

Created on 3 August 2024, 4 months ago
Updated 8 September 2024, 3 months ago

Problem/Motivation

Updating (3.4.0 => 3.5.0) causes immediate site death :-(

Steps to reproduce

Update too 3.5.0 using composer…
composer require 'drupal/field_group:^3.5'

Diagnosis

[03-Aug-2024 04:56:27 UTC] Uncaught PHP Exception ArgumentCountError: "Too few arguments to function Drupal\field_group\FieldGroupFormatterPluginManager::__construct(), 3 passed in <site>\public_html\core\lib\Drupal\Component\DependencyInjection\Container.php on line 261 and exactly 4 expected" at <site>\public_html\modules\contrib\field_group\src\FieldGroupFormatterPluginManager.php line 37

System in use

Drupal 10.3.1
Apache/2.4.33 (Win64) OpenSSL/1.0.2u mod_fcgid/2.3.9 PHP/8.3.1
PHP 8.3.7, memory limit: 256M
MySQL 5.7.24
PHP Caching module: OpCache
πŸ› Bug report
Status

Closed: cannot reproduce

Version

3.5

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

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

Merge Requests

Comments & Activities

  • Issue created by @SirClickALot
  • πŸ‡¦πŸ‡ΉAustria maxilein

    Maybe this is a work around, until there is a solution https://www.drupal.org/project/field_group/issues/3452325#comment-15630502 πŸ› Twig\Error\LoaderError: Template "modules/field_group/templates/field-group-html-element.html.twig" is not defined Fixed

  • πŸ‡§πŸ‡ͺBelgium nils.destoop

    Did you clear the cache after update? As I'm having no problems on 10.3. Your PHP error says it only received 3 arguments, while the service definition is declaring 4.

  • πŸ‡¦πŸ‡ΉAustria maxilein

    Field Group 3.6 runs fine on D10.3

  • πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

    RE #4

    I have just performed a composer require 'drupal/field_group:^3.6'</code, upgrading from the <code>3.4.0 that I rolled abck to and I am back in the same place, even after a double drusr cr

    [03-Aug-2024 13:44:42 UTC] Uncaught PHP Exception ArgumentCountError: "Too few arguments to function Drupal\field_group\FieldGroupFormatterPluginManager::__construct(), 3 passed in <Site>\core\lib\Drupal\Component\DependencyInjection\Container.php on line 261 and exactly 4 expected" at C:\Users\nick\Sites\bit-by-bit.org\public_html\modules\contrib\field_group\src\FieldGroupFormatterPluginManager.php line 37

    System otherwise as in the orignal post.

    Roll back to 3.4.0 followed by a double drush cr and we're back in business.

  • πŸ‡¦πŸ‡ΉAustria maxilein

    I also use these 4 patches:
    But 2 of them don't apply since I think 3.4.

    "drupal/field_group": {
    "Ensure visibility of invalid fields JS = TRUE #85": "patches/fieldgroup_2787179_ensure_visibility_of_invalid_fields_6.patch",
    				"Horizontal vertical tabs set default tab to last item with #open = TRUE #2": "https://www.drupal.org/files/issues/2020-04-23/3130339-2.patch",
    				"Nested groups render on other entity forms (or when fields are inaccessible) when they shouldnt #17" : "https://www.drupal.org/files/issues/2023-01-12/3098550-17.patch",
    				"Add classes to JS rewriting in horizontal tabs" : "https://www.drupal.org/files/issues/add_classes_js-2936973-2.patch"				
    			},
  • πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

    @maxilein β†’ ,

    Got you, but then I think you'll agree that since I never applied any patches at all, that your affirmation that 3.5.0 is good to go as-is, is questionable.

  • πŸ‡¦πŸ‡ΉAustria maxilein

    Yes maybe. I never tested if any of these patches makes a difference...

  • πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

    OK, I've done some mre experimenting here and here's what I've found...

    1) Clean, new Drupal 10 site, installed 3.6.0 - no problems at all so in that sense agree with #4

    However,

    2) Existing 10.3 site where FieldGroups are used prolifically, updating to 3.6.0 immedaitely causes the same fatal error…

    [06-Aug-2024 08:17:26 UTC] Uncaught PHP Exception ArgumentCountError: "Too few arguments to function Drupal\field_group\FieldGroupFormatterPluginManager::__construct(), 3 passed in <site>public_html\core\lib\Drupal\Component\DependencyInjection\Container.php on line 261 and exactly 4 expected" at C:\Users\nick\Sites\bit-by-bit.org\public_html\modules\contrib\field_group\src\FieldGroupFormatterPluginManager.php line 37

    So might it be possible that on my existing some other 'plugged in' code is triggering the call to line 37 in src\FieldGroupFormatterPluginManager.php but not supplying the fourth argument?

    Either way, it's definitley an issue and needs some mitigating action I think to deal with the missing ContainerInterface $container on the constuctor call?

  • πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

    OK, I've got it.

    Following my own logic from #9 I took a look at which other modules might be providing a Formatter and traced the problem to the Field Group Popup module β†’ .

    I'll raise an issue there.

    Might be worth leaving this onpe as it may help others to diagnose.

  • πŸ‡¦πŸ‡ΉAustria maxilein

    Following your way I found these two modules installed:

    Field Group Markup
    Field Group Table

  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States brayn7 Lexington, Ky

    Try out the patch i created just removing a comma in the manager constructor. @SirClickalot

  • πŸ‡ΊπŸ‡ΈUnited States brayn7 Lexington, Ky
  • Pipeline finished with Failed
    3 months ago
    Total: 264s
    #256210
  • πŸ‡©πŸ‡ͺGermany michaellenahan

    @brayn7 - #13 #14 worked for me, thank you

  • i have created a patch from the diff in #13

  • πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

    @bryan7 β†’ RE the patch from your MR#72 - nice work, all sorted now, Field Group Popup was not the offender!
    Thanks

  • Status changed to Needs work 3 months ago
  • πŸ‡§πŸ‡ͺBelgium nils.destoop

    The trailing comma should not be the cause of your fatal error, as this is a coding standard. The pipelines are now failing because of this: https://git.drupalcode.org/issue/field_group-3465611/-/jobs/2465176

  • πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

    @nils.destoop,
    Maybe not in theory Nils but the patch to remove the trailing comma did immediately fix the situation and enabled us to start using the Field Group PopUp module again and in reality it's the latter that matters ;-)

    I'm curous though, a traiing comma after the last parameter in a function's parameter list?
    We used to do that a fair bit in the old days in PHP as I remember but doing so is at odds with what do elsewhere β€” for example in composer.json.

  • I have updated this module to the latest released version 3.6 with core 10.3. I do not see this issue. Looks like it has been fixed.

  • πŸ‡¬πŸ‡§United Kingdom SirClickALot Somerset

    @pilot3 β†’ ,

    I think you will only see the issue if you are using third-party modules that extend the use of the Field Group module.

  • Status changed to Closed: cannot reproduce 3 months ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Seems like either a cache was not cleared or this is from a contrib issue. Neither the MR nor the patch can fix this IMHO.
    See #10

Production build 0.71.5 2024