androbey Posted September 29, 2023 Share Posted September 29, 2023 Hi all, I have once again a probably unique request. For a project I am using a SlimPHP based approach, which is connected to a ProcessWire instance via bootstrapped API. In general this works very well - except when using custom page class methods. Method Page::getTest does not exist or is not callable in this context Am I missing something? Or is this not supported at all? I tested it with both version 3.0.228 and 3.0.227. Link to comment Share on other sites More sharing options...
da² Posted September 30, 2023 Share Posted September 30, 2023 Hello, Without code it's hard to help you. I found that this error is thrown by PW, Wire.php: protected function ___callUnknown($method, $arguments) { if($arguments) {} // intentional to avoid unused argument notice $config = $this->wire()->config; if($config && $config->disableUnknownMethodException) return null; throw new WireException("Method " . $this->className() . "::$method does not exist or is not callable in this context"); } So it looks like you are trying to call this method on a Page instance, and not on an instance of your custom page class. 1 Link to comment Share on other sites More sharing options...
androbey Posted September 30, 2023 Author Share Posted September 30, 2023 Great, thank you very much for your tip! This has brought me on the right track: I have now requested a fresh copy from the database (via selector). Previously, a Page object was passed directly, which seemed to be just an instance of the Page class. Now it works! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now