Skip to content
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

./yii fixture/add console command not working #439

Closed
arogachev opened this issue Feb 11, 2022 · 3 comments
Closed

./yii fixture/add console command not working #439

arogachev opened this issue Feb 11, 2022 · 3 comments
Assignees
Labels

Comments

@arogachev
Copy link
Contributor

arogachev commented Feb 11, 2022

According Codeception test fails as well.

What steps will reproduce the problem?

Run ./yii fixture/add console command`.

What is the expected result?

No errors.

What do you get instead?

./yii fixture/add
                                                                                                                        
 [ERROR] Transaction can't be finished. Some relations can't be resolved:                                               
Create new `postTag`                                                                                           
- tag.posts:postTag (Cycle\ORM\Relation\ShadowBelongsTo)  

Additional info

Q A
Version current master
PHP version
image: yiisoftware/yii-php:8.0-apache
Operating system
image: yiisoftware/yii-php:8.0-apache
@rossaddison
Copy link
Contributor

Encountering a similar issue with all my BelongsTo relations:

Cycle\ORM\Exception\TransactionException: Transaction can't be finished. Some relations can't be resolved:
Update product

  • family (Cycle\ORM\Relation\BelongsTo) in C:\wamp64\www\yii-invoice\vendor\cycle\orm\src\Exception\TransactionException.php:40
    Stack trace:
    #0 C:\wamp64\www\yii-invoice\vendor\cycle\orm\src\Transaction\UnitOfWork.php(104): Cycle\ORM\Exception\TransactionException::unresolvedRelations(Array, Object(Cycle\ORM\Service\Implementation\RelationProvider))
    Use View for index page #1 C:\wamp64\www\yii-invoice\vendor\cycle\orm\src\Transaction.php(48): Cycle\ORM\Transaction\UnitOfWork->run()
    \yii\di\Reference -> Yiisoft\Factory\Definitions\Reference #2 C:\wamp64\www\yii-invoice\vendor\yiisoft\yii-cycle\src\Data\Writer\EntityWriter.php(30): Cycle\ORM\Transaction->run()
    Add examples of basic and digest authentication [skip ci] #3 C:\wamp64\www\yii-invoice\src\Invoice\Product\ProductRepository.php(59): Yiisoft\Yii\Cycle\Data\Writer\EntityWriter->write(Array)
    Example of circular reference exception #4 C:\wamp64\www\yii-invoice\src\Invoice\Product\ProductService.php(30): App\Invoice\Product\ProductRepository->save(Object(App\Invoice\Entity\Product Cycle ORM Proxy))
    fix error "Return value must be of the type string, null returned" #5 C:\wamp64\www\yii-invoice\src\Invoice\Product\ProductController.php(239): App\Invoice\Product\ProductService->saveProduct(Object(App\Invoice\Entity\Product Cycle ORM Proxy), Object(App\Invoice\Product\ProductForm))
    Remove yiisoft/yii-base-web #6 [internal function]: App\Invoice\Product\ProductController->edit(Object(Yiisoft\Yii\View\ViewRenderer), Object(HttpSoft\Message\ServerRequest), Object(Yiisoft\Router\CurrentRoute), Object(Yiisoft\Validator\Validator), Object(App\Invoice\Product\ProductRepository), Object(App\Invoice\Setting\SettingRepository), Object(App\Invoice\Family\FamilyRepository), Object(App\Invoice\Unit\UnitRepository), Object(App\Invoice\TaxRate\TaxRateRepository), Object(App\Handler\NotFoundHandler))
    Change 'app' to Application::class #7 C:\wamp64\www\yii-invoice\vendor\yiisoft\injector\src\Injector.php(66): ReflectionFunction->invokeArgs(Array)
    Add alias in ViewFactory #8 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareFactory.php(89): Yiisoft\Injector\Injector->invoke(Object(Closure), Array)
    Add LoggerFactory #9 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(104): Psr\Http\Server\MiddlewareInterface@anonymous->process(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler))
    No definition for Psr\Log\LoggerInterface #10 C:\wamp64\www\yii-invoice\vendor\yiisoft\auth\src\Middleware\Authentication.php(57): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
    App doesn't work from subfolder #11 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(104): Yiisoft\Auth\Middleware\Authentication->process(Object(HttpSoft\Message\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
    /vendor/bin/yii serve error #12 C:\wamp64\www\yii-invoice\src\Middleware\AccessChecker.php(39): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
    Using of User and ActiveForm models #13 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareFactory.php(126): App\Middleware\AccessChecker->process(Object(HttpSoft\Message\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
    Add mailer example #14 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(104): Psr\Http\Server\MiddlewareInterface@anonymous->process(Object(HttpSoft\Message\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
    Fix VarDumper FQN #15 C:\wamp64\www\yii-invoice\vendor\yiisoft\yii-debug-viewer\src\Middleware\ToolbarMiddleware.php(33): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
    Fix 'dd' function conflicts with dependencies #16 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(104): Yiisoft\Yii\Debug\Viewer\Middleware\ToolbarMiddleware->process(Object(HttpSoft\Message\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
    Remove unnecessary settings #17 C:\wamp64\www\yii-invoice\vendor\yiisoft\data-response\src\Middleware\FormatDataResponse.php(29): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
    How to add Middleware, #18 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(104): Yiisoft\DataResponse\Middleware\FormatDataResponse->process(Object(HttpSoft\Message\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
    Best way to load params, proposal. #19 C:\wamp64\www\yii-invoice\vendor\yiisoft\csrf\src\CsrfMiddleware.php(48): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
    #20 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(104): Yiisoft\Csrf\CsrfMiddleware->process(Object(HttpSoft\Message\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
    Run application through RoadRunner #21 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(53): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
    make keyPrefix default to $app->id for host-shared caches like Apc, Memcache #22 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareDispatcher.php(50): Yiisoft\Middleware\Dispatcher\MiddlewareStack->handle(Object(HttpSoft\Message\ServerRequest))
    Using Cycle ORM #23 C:\wamp64\www\yii-invoice\vendor\yiisoft\router\src\MatchingResult.php(116): Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher->dispatch(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler))
    Replaced the variable with the getter method. #24 C:\wamp64\www\yii-invoice\vendor\yiisoft\router\src\Middleware\Router.php(61): Yiisoft\Router\MatchingResult->process(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler))
    Cycle orm migrations #25 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(104): Yiisoft\Router\Middleware\Router->process(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler))
    Added Cycle ORM support via yii-cycle package and configured; #26 C:\wamp64\www\yii-invoice\src\Middleware\LocaleMiddleware.php(94): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
    JQ已经是过去时代 期待希望3.0给我们惊艳,更易于和Vue 或 react 现代前端框架 结合  #27 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(104): App\Middleware\LocaleMiddleware->process(Object(HttpSoft\Message\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
    ContectController fix mailer params #28 C:\wamp64\www\yii-invoice\vendor\yiisoft\user\src\Login\Cookie\CookieLoginMiddleware.php(71): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
    Added routes names and replaced static url to dynamic #29 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(104): Yiisoft\User\Login\Cookie\CookieLoginMiddleware->process(Object(HttpSoft\Message\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
    Use auth package #30 C:\wamp64\www\yii-invoice\vendor\yiisoft\cookies\src\CookieMiddleware.php(84): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
    Merged last updates from master #31 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(104): Yiisoft\Cookies\CookieMiddleware->process(Object(HttpSoft\Message\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
    More verbose HTML mail layout #32 C:\wamp64\www\yii-invoice\vendor\yiisoft\session\src\SessionMiddleware.php(36): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
    Fix namespace of ErrorCatcher #33 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(104): Yiisoft\Session\SessionMiddleware->process(Object(HttpSoft\Message\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
    Subfolder support #34 C:\wamp64\www\yii-invoice\vendor\yiisoft\error-handler\src\Middleware\ErrorCatcher.php(135): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
    Error in /yii3.demo/public/ We were unable to find the page /yii3.demo/public/ #35 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(104): Yiisoft\ErrorHandler\Middleware\ErrorCatcher->process(Object(HttpSoft\Message\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
    update docker-compose and create Dockerfile #36 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(53): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
    composer update error #37 C:\wamp64\www\yii-invoice\vendor\yiisoft\middleware-dispatcher\src\MiddlewareDispatcher.php(50): Yiisoft\Middleware\Dispatcher\MiddlewareStack->handle(Object(HttpSoft\Message\ServerRequest))
    SubFolderMiddleware renamed to SubFolder #38 C:\wamp64\www\yii-invoice\vendor\yiisoft\yii-http\src\Application.php(87): Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher->dispatch(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler))
    Fix usage assets. #39 C:\wamp64\www\yii-invoice\vendor\yiisoft\yii-runner-http\src\HttpApplicationRunner.php(103): Yiisoft\Yii\Http\Application->handle(Object(HttpSoft\Message\ServerRequest))
    Apply fixes from StyleCI #40 C:\wamp64\www\yii-invoice\public\index.php(36): Yiisoft\Yii\Runner\Http\HttpApplicationRunner->run()
    This project vs the other yii3 project templates #41 {main}

@rossaddison
Copy link
Contributor

Similar to Albertborsos' issue, the relations work when adding and then submitting but not when editing and then submitting; using the same form of course.

@vjik
Copy link
Member

vjik commented May 30, 2022

All tests pass after #454

@vjik vjik closed this as completed May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants