Closed diego-sorribas closed 2 years ago
Do you get any error messages? If so, can you please share them?
I did a manual verification of the aliases we have, and none appear to have changed; the only change was how we are resolving the legacy (ZF) aliases to the shipped classes (we are importing ZF class names in most cases). Error messages will help me better isolate the issue.
Thanks!
I created a new laminas-api-tools from scratch and this is the result I attach to you my composer.lock if you need it
I have the identical issue.
@weierophinney The problem is in api-tools-content-validation:
use Laminas\InputFilter\InputFilterAbstractServiceFactory;
use Laminas\ServiceManager\Factory\InvokableFactory;
use ZF\ContentValidation\InputFilter\InputFilterPlugin;
Can I just add to this and say I am seeing a similar issue which results in the following php log: PHP Fatal error: Uncaught Error: Class 'Laminas\ApiTools\Admin\Controller\InputFilter\RestService\PatchInputFilter' not found in ..... /vendor/laminas/laminas-servicemanager/src/Factory/InvokableFactory.php:33
Steps to reproduce: Update laminas-api-tools/api-tools-admin to 1.10.1 Select any service, change the 'page size' and Save. You will get the above error
is there any solution to fix this problem?
@fmangat
You can create a pull request to fix the namespace in the configuration file of laminas-api-tools/api-tools-content-validation.
Thanks in advance! 👍
@froschdesign am not sure .looks like ModuleInputFilter is not accessible its coming under undeined classes in psalm-baseline.xml
@froschdesign But the namespace is okay its the legacy ZF namespace or Im wrong? https://github.com/zfcampus/zf-content-validation/blob/master/src/InputFilter/InputFilterPlugin.php
yep as per rewrites rulesits correcr...... it s very odd that the basic installation is not working
its not something related to configs?
@diego-sorribas
@froschdesign But the namespace is okay its the legacy ZF namespace or Im wrong? https://github.com/zfcampus/zf-content-validation/blob/master/src/InputFilter/InputFilterPlugin.php
You are right and the Laminas\ApiTools\ContentValidation\ContentValidationListener::class
try to fetch the service with the legacy ZF namespace.
The module configuration of api-tools-content-validation looks good:
Please try to delete the cache for the config.
@froschdesign I dont know why but when we update to 1.10.0 the listener cant find the filter, look at my image the line: 1768 its what I added, the full namespace and works but above is the package declaration and at the left of the file is the path to the file thats its okay, so strange
@diego-sorribas Various problems are listed in this issue report:
PostInputFilter
not foundModuleInputFilter
not foundPatchInputFilter
not foundPlease only one problem at a time, otherwise we will not reach any goal. Thanks!
@froschdesign It seems to be all related to the module.config.php.
@diego-sorribas Sorry, I don't have an IDE available because I'm on the road. So I can only look here on GitHub.
Can you check the classnames and namespaces? The classes are there and under namespace Laminas
but something is wrong here:
https://github.com/laminas-api-tools/api-tools-admin/tree/1.11.x/src/InputFilter/RestService
"laminas-api-tools/api-tools-admin": "1.9.0",
i have downgraded api-tools-admin version to 1.9.0 which worked for now
This is a namespace issue in the module.config.php file. The namespace Laminas\ApiTools\Admin
is somewhere overwritten with ZF\Apigility\Admin\Controller
. This issue leads in several other issues so that services can 't be resolved by the service manager, because the class ZF\Apigility\Admin\Controller\InputFilter\WhatSoEver
does not exist. All input filter entries are affected. I have not yet been able to find the cause of this. But this small hotfix solves the problem.
Just replace the input filter configuration with the following snipped. This one worked fine for me.
'input_filters' => [
'aliases' => [
InputFilter\Authentication\BasicAuth::class => \Laminas\ApiTools\Admin\InputFilter\Authentication\BasicInputFilter::class,
InputFilter\Authentication\DigestAuth::class => \Laminas\ApiTools\Admin\InputFilter\Authentication\DigestInputFilter::class,
InputFilter\Authentication\OAuth2::class => \Laminas\ApiTools\Admin\InputFilter\Authentication\OAuth2InputFilter::class,
InputFilter\Authorization::class => \Laminas\ApiTools\Admin\InputFilter\AuthorizationInputFilter::class,
InputFilter\ContentNegotiation::class => \Laminas\ApiTools\Admin\InputFilter\ContentNegotiationInputFilter::class,
InputFilter\CreateContentNegotiation::class => \Laminas\ApiTools\Admin\InputFilter\CreateContentNegotiationInputFilter::class,
InputFilter\DbAdapter::class => \Laminas\ApiTools\Admin\InputFilter\DbAdapterInputFilter::class,
InputFilter\Documentation::class => \Laminas\ApiTools\Admin\InputFilter\DocumentationInputFilter::class,
InputFilter\Module::class => \Laminas\ApiTools\Admin\InputFilter\ModuleInputFilter::class,
InputFilter\RestService\PATCH::class => \Laminas\ApiTools\Admin\InputFilter\RestService\PatchInputFilter::class,
InputFilter\RestService\POST::class => \Laminas\ApiTools\Admin\InputFilter\RestService\PostInputFilter::class,
InputFilter\RpcService\PATCH::class => \Laminas\ApiTools\Admin\InputFilter\RpcService\PatchInputFilter::class,
InputFilter\RpcService\POST::class => \Laminas\ApiTools\Admin\InputFilter\RpcService\PostInputFilter::class,
InputFilter\Version::class => \Laminas\ApiTools\Admin\InputFilter\VersionInputFilter::class,
// Legacy Zend Framework aliases
BasicAuth::class => \Laminas\ApiTools\Admin\InputFilter\Authentication\BasicAuth::class,
DigestAuth::class => \Laminas\ApiTools\Admin\InputFilter\Authentication\DigestAuth::class,
OAuth2::class => \Laminas\ApiTools\Admin\InputFilter\Authentication\OAuth2::class,
\ZF\Apigility\Admin\InputFilter\Authorization::class => \Laminas\ApiTools\Admin\InputFilter\Authorization::class,
ContentNegotiation::class => \Laminas\ApiTools\Admin\InputFilter\ContentNegotiation::class,
CreateContentNegotiation::class => \Laminas\ApiTools\Admin\InputFilter\CreateContentNegotiation::class,
DbAdapter::class => \Laminas\ApiTools\Admin\InputFilter\DbAdapter::class,
\ZF\Apigility\Admin\InputFilter\Documentation::class => \Laminas\ApiTools\Admin\InputFilter\Documentation::class,
Module::class => \Laminas\ApiTools\Admin\InputFilter\Module::class,
PATCH::class => \Laminas\ApiTools\Admin\InputFilter\RestService\PATCH::class,
POST::class => \Laminas\ApiTools\Admin\InputFilter\RestService\POST::class,
\ZF\Apigility\Admin\InputFilter\RpcService\PATCH::class => \Laminas\ApiTools\Admin\InputFilter\RpcService\PATCH::class,
\ZF\Apigility\Admin\InputFilter\RpcService\POST::class => \Laminas\ApiTools\Admin\InputFilter\RpcService\POST::class,
Version::class => \Laminas\ApiTools\Admin\InputFilter\Version::class,
BasicInputFilter::class => \Laminas\ApiTools\Admin\InputFilter\Authentication\BasicInputFilter::class,
DigestInputFilter::class => \Laminas\ApiTools\Admin\InputFilter\Authentication\DigestInputFilter::class,
OAuth2InputFilter::class => \Laminas\ApiTools\Admin\InputFilter\Authentication\OAuth2InputFilter::class,
AuthorizationInputFilter::class => \Laminas\ApiTools\Admin\InputFilter\AuthorizationInputFilter::class,
ContentNegotiationInputFilter::class => \Laminas\ApiTools\Admin\InputFilter\ContentNegotiationInputFilter::class,
CreateContentNegotiationInputFilter::class => \Laminas\ApiTools\Admin\InputFilter\CreateContentNegotiationInputFilter::class,
DbAdapterInputFilter::class => \Laminas\ApiTools\Admin\InputFilter\DbAdapterInputFilter::class,
DocumentationInputFilter::class => \Laminas\ApiTools\Admin\InputFilter\DocumentationInputFilter::class,
ModuleInputFilter::class => \Laminas\ApiTools\Admin\InputFilter\ModuleInputFilter::class,
PatchInputFilter::class => \Laminas\ApiTools\Admin\InputFilter\RestService\PatchInputFilter::class,
PostInputFilter::class => \Laminas\ApiTools\Admin\InputFilter\RestService\PostInputFilter::class,
\ZF\Apigility\Admin\InputFilter\RpcService\PatchInputFilter::class => \Laminas\ApiTools\Admin\InputFilter\RpcService\PatchInputFilter::class,
\ZF\Apigility\Admin\InputFilter\RpcService\PostInputFilter::class => \Laminas\ApiTools\Admin\InputFilter\RpcService\PostInputFilter::class,
VersionInputFilter::class => \Laminas\ApiTools\Admin\InputFilter\VersionInputFilter::class,
\ZF\Apigility\Admin\InputFilter\InputFilter::class => \Laminas\ApiTools\Admin\InputFilter\InputFilter::class,
],
'factories' => [
\Laminas\ApiTools\Admin\InputFilter\Authentication\BasicInputFilter::class => InvokableFactory::class,
\Laminas\ApiTools\Admin\InputFilter\Authentication\DigestInputFilter::class => InvokableFactory::class,
\Laminas\ApiTools\Admin\InputFilter\Authentication\OAuth2InputFilter::class => InvokableFactory::class,
\Laminas\ApiTools\Admin\InputFilter\AuthorizationInputFilter::class => InvokableFactory::class,
\Laminas\ApiTools\Admin\InputFilter\ContentNegotiationInputFilter::class => InvokableFactory::class,
\Laminas\ApiTools\Admin\InputFilter\CreateContentNegotiationInputFilter::class => InvokableFactory::class,
\Laminas\ApiTools\Admin\InputFilter\DbAdapterInputFilter::class => InvokableFactory::class,
\Laminas\ApiTools\Admin\InputFilter\DocumentationInputFilter::class => InvokableFactory::class,
\Laminas\ApiTools\Admin\InputFilter\ModuleInputFilter::class => InvokableFactory::class,
\Laminas\ApiTools\Admin\InputFilter\RestService\PatchInputFilter::class => InvokableFactory::class,
\Laminas\ApiTools\Admin\InputFilter\RestService\PostInputFilter::class => InvokableFactory::class,
\Laminas\ApiTools\Admin\InputFilter\RpcService\PatchInputFilter::class => InvokableFactory::class,
\Laminas\ApiTools\Admin\InputFilter\RpcService\PostInputFilter::class => InvokableFactory::class,
\Laminas\ApiTools\Admin\InputFilter\VersionInputFilter::class => InvokableFactory::class,
\Laminas\ApiTools\Admin\InputFilter\InputFilter::class => InputFilter\Factory\InputFilterInputFilterFactory::class,
],
],
This can not be the solution of this problem. We all should look why the Laminas\ApiTools\Admin
namespace is overwritten with the ZF\Apigility\Admin\Controller
namespace.
This issue still stands unresolved. I've downgraded to 1.9.0 and it works fine. Why does it work for few and not for others or everyone has downgraded to 1.9.0 to make it work?
How long is it going to take to fix it? any idea?
Fixed with #79
BC Break Report
Summary
After upgrading to 1.10.0 from 1.9.0 I want to create a RPC service from the UI and launch me that error. I think there is some error in the aliases config. When I inspect with PhpStorm the new vendor/laminas-api-tools/api-tools-admin/config/module.config.php it cant resolve the PostInputFilter location.
Previous behavior
Create RPC services without error.
Current behavior
Can't create RPC services from api tools admin ui.
How to reproduce