Closed (fixed)
Project:
Acquia Connector
Version:
8.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Dec 2019 at 18:24 UTC
Updated:
3 Jan 2020 at 02:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
wellsNot sure if this is the best approach, but the attached patch resolves this issue by injecting the
config.factoryservice with theacquia_connector.spiservice explicitly.Comment #3
wellsComment #4
jasonluttrellI tried the patch above (#2) and got the following error instead:
The website encountered an unexpected error. Please try again later.
ArgumentCountError: Too few arguments to function Drupal\acquia_connector\Controller\SpiController::__construct(), 1 passed in /PATH/TO/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php on line 269 and exactly 2 expected in Drupal\acquia_connector\Controller\SpiController->__construct() (line 54 of modules/contrib/acquia_connector/src/Controller/SpiController.php).
Comment #5
wells#4 — did you try a cache rebuild?
Comment #6
kregan commented#5 - This didn't have any effect for me.
Comment #7
wells#6 - Are you having the same result as #4?
Could either of you provide exact steps to get the error?
#4 looks like it is occurring when attempting to access the Acquia Connector settings form, which still works fine for me with this patch.
Comment #8
jasonluttrell--scratch what I said--
I will take a second look and get back to you.
Comment #9
kregan commented#7 - I'm able to access the Acquia Connector settings form just fine as well as save changes. I'm receiving this error when attempting to send SPI data manually or via cron.
Comment #10
jasonluttrellOK, so I am not seeing it anymore. So it's possible I thought I had cleared the cache but didn't. I will let you know if I see a recurrence. Thanks.
Comment #11
wells#9 - Manual send is working for me with this patch. Are you sure have done a cache rebuild? The "too few arguments" error would be expected with this patch before a cache rebuild but should definitely go away after.
Comment #12
kregan commented#11 - After patching and clearing cache it worked. Thanks!
Comment #13
jsutta commentedPatching and clearing cache worked for me too. ty!
Comment #14
danepowell commentedThanks everyone for the patches and reporting. If I understand correctly, this is breaking all cron runs, correct? Bumping issue priority accordingly.
Comment #15
wellsThanks for chiming in, Dane.
Yes, this breaks the SPI communications both during cron runs and using the manual route. I'm not sure what the (or if there is a) "Drupal way" is for properly getting services injected when using a controller extending
ControllerBaseas a service and I couldn't find other examples of this behavior in the contrib I use. Hence the patch adding only the service the SPI controller needs.Comment #16
danepowell commentedThis will need to go into 8.x-2.x first and get backported.
Comment #17
danepowell commentedWell this is odd. Patches #2 (for 8.x-1.x) and #16 (for 8.x-2.x) both seem to fix the issue for me locally. But both fail on drupal.org. I don't understand why that would be.
Comment #18
wellsDo you mean the tests? They are failing on the base branches so I wasn't concerned about them. Or at least that was the case for patch #2.
Comment #19
danepowell commentedThe automated tests on drupal.org for both patches are failing with the same error. Here's the failure from #16 for instance: https://dispatcher.drupalci.org/job/drupal8_contrib_patches/16120/console
It looks like the patch is correctly being applied. Yet the error is still thrown in both patches in the tests.
Comment #20
danepowell commentedAh, the SPI test class overrides the SPI controller and doesn't call its parent constructor, that's likely why the tests are failing. I don't think it's related to the patch itself, and we can follow up to fix that later.
Comment #21
danepowell commentedI trimmed the patches slightly and am committing to dev now. New releases 8.x-2.0-beta2 and 8.x-1.18 will be out shortly.
I also found an example of this pattern in core, which makes me more confident that it's correct: https://git.drupalcode.org/project/drupal/blob/8.8.x/core/modules/system...
Comment #24
danepowell commented