-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.11.0-beta1 PHP 8.1 - Embed media button broken #10305
Comments
Can replicate locally with a modified oembed.yml file. Issue related to environments with an Embed v3 CurlDispatcher had a public constructor, v4 has a private constructor - you're not supposed to instantiate this class, instead you're supposed to call The constructors are also fundamentally different We need to set the |
I think the solution here is to swap out the Client from Curl to Guzzle, which is allowed via the use of PSR standards, and then configure Guzzle to set the proxy variables The oembed.yml in cwp-core <=2.10 is incompatible with embed v4 which is introduced in framework 4.11, so we'll need to add a composer conflict in The oembed.yml in framework defines a 'Crawler' which, with its empty constuctor, will default to creating a So we should create a Guzzle Client service class and ideally configure it with proxy variables in cwp-core 2.11 yml. We can should delete the old curl config from cwp-core |
Great investigation! Just blinding looking at the All things being equal, my preference would be to stick with CURL if only for simplicity. We'll need to document this in the changelog as it might trip other people. |
@emteknetnz This is in peer review but the PRs are in draft - can you please set them to ready if they're ready, or else indicate what it is that should be reviewed at this stage? |
I've set them to ready for review |
Linked PRs are all merged. |
Server error when attempting to embed media
I saw this in logs for an unrelated issue, though likely it's the reason why inserting media wasn't working
error-log.ERROR: Uncaught Exception Error: "Call to private Embed\Http\CurlDispatcher::__construct() from scope SilverStripe\Core\Injector\InjectionCreator" at /sites/<mysite>/releases/20220506003258/vendor/silverstripe/framework/src/Core/Injector/InjectionCreator.php line 17 {"exception":"[object] (Error(code: 0): Call to private Embed\\Http\\CurlDispatcher::__construct() from scope SilverStripe\\Core\\Injector\\InjectionCreator at /sites/<mysite>/releases/20220506003258/vendor/silverstripe/framework/src/Core/Injector/InjectionCreator.php:17)"} []
This happened because we recently changed - https://github.com/silverstripe/silverstripe-framework/blob/4/src/Core/Injector/InjectionCreator.php to use
new $class(...$values)
rather than Reflection. CurlDispatcher has a private constructor, which is allowed, because you're expected to use it viapublic static function fetch
which callsnew static()
which does have access to the private constructorEither revert the change, or update calls to CurlDispatcher to use
public static fetch()
Update
[Emergency] Uncaught ReflectionException: Access to non-public constructor of class Embed\Http\CurlDispatcher
ACs
PRs
The text was updated successfully, but these errors were encountered: