-
Notifications
You must be signed in to change notification settings - Fork 334
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
History not working in Silverstipe 4.11 CMS with GraphQL 4 and PHP 8.1 #2750
Comments
I believe, this is the solution to the problem (escaping
/**
* Get meta-data details on a named method
*
* @param string $method
* @return array List of custom method details, if defined for this method
*/
protected function getExtraMethodConfig($method)
{
// Lazy define methods
if (!isset(self::$extra_methods[static::class])) {
$this->defineMethods();
}
if (isset(self::$extra_methods[static::class][strtolower($method ?? '')])) {
return self::$extra_methods[static::class][strtolower($method ?? '')];
}
return null;
} |
Strange enough, the /**
* Return TRUE if a method exists on this object
*
* This should be used rather than PHP's inbuild method_exists() as it takes into account methods added via
* extensions
*
* @param string $method
* @return bool
*/
public function hasMethod($method)
{
return method_exists($this, $method ?? '') || $this->getExtraMethodConfig($method);
} |
Looks like the |
I've also hit this issue. I've traced it to the 'lastEdited' field name @GuySartorelli. Full stack trace:
|
@thats4shaw are you able to give me some steps which would let me reproduce the issue from a fresh install? That would be a big help. |
@GuySartorelli just gave it a try on a nudge on a complete fresh install and got the same behaviour as the 2 existing projects I've upgraded to 8.1 in the past week. Literally just loading up the site and visiting the history tab of the home page after Running PHP
|
Created a simple PR to fix silverstripe/silverstripe-framework#10417 |
Linked PR has been merged and released in framework 4.11.5 Please update your version of framework and let us know on this issue if this did not solve the reported issue |
Request:
URL:
POST http://localhost/silverstripe/admin/graphql
Payload:
Response:
Status:
[HTTP/1.1 500 Internal Server Error]
Error:
[Network error]: ServerParseError: JSON.parse: unexpected character at line 1 column 1 of the JSON data [bundle.js:1:6732](http://localhost/silverstripe/_resources/vendor/silverstripe/admin/client/dist/js/bundle.js?m=1655944491)
[Deprecated] strtolower(): Passing null to parameter #1 ($string) of type string is deprecated
Line 164 in
/Users/***/Sites/silverstripe/vendor/silverstripe/framework/src/Core/CustomMethods.php
Source:
PRs
The text was updated successfully, but these errors were encountered: