in 8.5.x core I have this error:

TypeError: Argument 8 passed to Drupal\ultimate_cron\UltimateCron::__construct() must implement interface Drupal\Core\Config\ConfigFactoryInterface, instance of Drupal\Component\Datetime\Time given, called in /srv/realty/agent/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 294 in Drupal\ultimate_cron\UltimateCron->__construct() (line 44 of /srv/realty/agent/web/modules/contrib/ultimate_cron/src/UltimateCron.php)

Comments

alphawebgroup created an issue. See original summary.

alphawebgroup’s picture

StatusFileSize
new1.78 KB

Here is a patch with fix

alphawebgroup’s picture

Assigned: alphawebgroup » Unassigned
Status: Active » Needs review
berdir’s picture

Priority: Normal » Critical
Status: Needs review » Needs work

Thanks for the patch, but this hard to keep working on both 8.4 and 8.5, so lets try the approach that I recently documented on https://www.md-systems.ch/en/blog/techblog/2016/12/17/how-to-safely-inje..., remove the constructor and instead add a setConfigFactory() method.

Setting to critical as this breaks tests here as well as in projects that have integration tests like Monitoring.

alphawebgroup’s picture

Assigned: Unassigned » alphawebgroup
alphawebgroup’s picture

Assigned: alphawebgroup » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2.65 KB

Refactored.
please review

Status: Needs review » Needs work

The last submitted patch, 6: ultimatecron_class_fix-2919408-6.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

alphawebgroup’s picture

Status: Needs work » Needs review
StatusFileSize
new3.34 KB

also the /src/Tests/LoggerWebTest.php test have been fixed

alphawebgroup’s picture

so, it looks like 8.4.x and 8.5.x have different html structure for the cron job log page
that's why the test fails with 8.4.x and 8.3.x what is pretty clear from the test logs

there 2 variants of the line 98 in /src/Tests/LoggerWebTest.php

this one is correct for 8.5.x

$xpath = '/html/body/div/div/main/div/div/table/tbody/tr/td[4]';

and another one is correct for 8.4.x and 8.3.x

$xpath = '/html/body/div/main/div/div/table/tbody/tr/td[4]';

@Berdit
anyway, it needs your review and advice

berdir’s picture

Status: Needs review » Needs work

Yeah, that's because it is a view now in 8.5.x.

There are a few things that we could do, one is check the first xpath, if that finds nothing, fall back to the other. We could also do an explicit version check on \Drupal::VERSION.

The changes for the service looks great.

alphawebgroup’s picture

StatusFileSize
new3.44 KB

test is fixed now

@Berdit
please review

alphawebgroup’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 11: ultimatecron_class_fix-2919408-11.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

alphawebgroup’s picture

Status: Needs work » Needs review

it looks like there are some other stuff in fails of PHP 5.6 & MySQL 5.5, D8.5
not related to the module

alphawebgroup’s picture

berdir’s picture

Status: Needs review » Fixed

Thanks!

Yes, those are caused by a new feature in Drupal 8.5. I've now changed our configuration to run tests against the supported release (which is currently 8.4) by default.

Committed, of course that also means this wouldn't actually fail anymore, but it still makes sense to have it fixed for other modules and so on and to be prepared.

  • Berdir committed b5f41ef on 8.x-2.x authored by alphawebgroup
    Issue #2919408 by alphawebgroup: UltimateCron::__construct() doesn't...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.