Comments (4)
Can you check again now? It should be fixed in e0895f0.
from sylius.
No, still error while executing insert. I update app completly and make the fix, but the exception is present.
from sylius.
Hi, could fix this problem but the changes was made in AssortmentBundle, i comment here because i post here, maybe you can move it to AssortmentBundle issue.
When you create a product normaly, it dispatch 4 events
sylius.product.pre_create
sylius.product.pre_update
sylius.variant.pre_create
sylius.variant.pre_update
And sylius.listener.image_upload is listening this event, when its hear this event it make all about image...
The problem its when you create a product from prototype, any of this event are dispatch, so path in INSERT INTO sylius_variant_image is empty and throw an exception.
To fix it I chage
AssortmentBundle\Controller\PrototypeController, buildAction. When form is POST i call $productController->create (inherit FROM RESOURCE CONTROLLER) , it persis,flush and dispatch event.
I delete the persist and flush directly from the $productController->getManager().
It look so
public function buildAction(Request $request, $id)
{
$prototype = $this->findOr404(array('id' => $id));
$productController = $this->getProductController();
$product = $productController->createNew();
$this
->getBuilder()
->build($prototype, $product)
;
$form = $productController->getForm($product);
if ($request->isMethod('POST') && $form->bind($request)->isValid()) {
//$manager = $productController->getManager();
//$manager->persist($product);
//$manager->flush();
$productController->create($product);
$productController->setFlash('success', '%resource% has been successfully created.');
return $productController->redirectTo($product);
}
return $productController->renderResponse('build.html', array(
'prototype' => $prototype,
'product' => $product,
'form' => $form->createView()
));
}
Now when you create a product from prototype and choose a image it work all fine.
Greeting,
Carlos
from sylius.
This is the fix indeed! Thanks for debugging the issue. Can you open a PR for assortment bundle?
Simplest way to do it, is to install vendors with composer install --prefer-source
. Then inside vendors/sylius/assortment-bundle...
you'll have Sylius assortment bundle repository. You can fork it, add as remote and push your changes there - finally open PR. :) Or you can just fork&clone assortment bundle, make the changes, push, open PR.
I can help you with all that if you want. Thanks!
from sylius.
Related Issues (20)
- Localized datetime depending of browser or logged in admin HOT 2
- Cannot apply multiple taxes on a product HOT 8
- [ADMIN][UI] Administrator form display issue HOT 2
- Bug with docker, chmod required for public directory
- Add a new rule to promotion HOT 2
- Base_currency_id cannot be null when creating a new channel
- On product attribuites of type select the apply to all button doesn't select the correct options
- SyliusCoreBundle 1.13 depends on non-existing package HOT 7
- Apply catalog promotions only to enabled products/variants HOT 1
- [SyliusShopBundle] Error rendering "Add to cart" button on product cards HOT 3
- Channel category menu option vs Product main taxon HOT 1
- Twig collection Item could implement label and help (if provided)
- Duplicated /ship route HOT 6
- Link to translated page on locale_switch
- `AsPromotionAction` attribute does not work because the `sylius.promotion_action` tag requires `form_type` to be set. HOT 3
- BC Break 1.13-APLHA - StateMachine changes HOT 1
- Cart summary should (not) include tax in estimated shipping costs HOT 2
- Invalid coupon code make the cart summary look weird HOT 2
- Allow the enabled property of a sylius_ui template to be defined using the ExpressionLanguage Component
- [ProductAttribute] "Apply To all" for select use the order position, not the value HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sylius.