The Acquia Content Hub module isn't compatible with other modules that rely on URL manipulation such as the CDN module. Thanks to Wim Leers who identified the culprit in \Drupal\acquia_contenthub\ContentHubInternalRequest::getEntityCdfByInternalRequest() with the way we generate sub-requests:
$request = Request::create($url);
which should be:
$master_request = $this->requestStack->getCurrentRequest(); // @todo inject the RequestStack service into this service.
$request = Request::create($url, 'GET', $master_request->query->all(), $master_request->cookies->all(), [], $master_request->server->all());
Comments
Comment #2
abarrios commentedComment #3
wim leersLooks good, that's indeed the fix I proposed.
Would be great if we could add integration test coverage, that would have caught this problem.
Comment #4
wim leersDiscovered via #2826137: CDN is serving files with wrong path.
Comment #5
scor commentedComment #6
wim leersHurray, tests!
FYI:
ConfigFactoryInterface::classwould be much friendlier for refactoring.FYI:
$this->prophesize(…)is MUCH nicer to work with than the old-school mocks.Comment #7
scor commentedReplaced some of the mock() with prophesize().
Comment #8
scor commentedInterdiff for previous patch.
Comment #9
scor commenteddoh! /me learns how to use drupal.org...
Comment #10
wim leersIt's just been too long :)
You haven't converted all of them to use
prophesize()but that is fine — it really was just meant as an FYI to hopefully make future maintenance simpler!Comment #11
scor commentedWe found another scenario not covered by the previous patches.
Comment #12
wim leersGlad to see this is helping stabilize the module in even more places!
Should the module perhaps have a service to handle internal requests? Then the same carefully crafted code can be reused everywhere, without the need to keep it all consistent.
Comment #13
didebruIs this issue related to this (warning/error) message?
Site is running on Drupal 8.5.0 with CDN enabled.
Comment #14
scor commentedThis was fixed with commit 90ca4c37 and released in 8.x-1.23.
@Insasse We fixed this issue as well as support for Drupal 8.5 in the new 8.x-1.23 release. Could you install this new version and let us know if the error is still happening? Please open a new ticket if you see errors.
Comment #15
didebruThanks @scor 1.23 fixed it for me.