Giter Site home page Giter Site logo

bitbagcommerce / syliuswishlistplugin Goto Github PK

View Code? Open in Web Editor NEW
65.0 12.0 55.0 2.47 MB

This plugin allows you to integrate wishlist features with Sylius platform app.

License: MIT License

PHP 79.01% JavaScript 6.10% Gherkin 6.32% Twig 6.14% SCSS 2.44%
wishlist sylius ecommerce symfony sylius-plugin plugin

syliuswishlistplugin's People

Contributors

arek31 avatar bitbager avatar dead-playmod avatar dependabot[bot] avatar fabulouspuppet avatar jakobtolkemit avatar jakubszczerba avatar lchrusciel avatar macbalc avatar marekrzytki avatar milwoz avatar mycreedo avatar pamil avatar patrick477 avatar pgrobelny avatar piotrkardasz avatar piotrszymanski2000 avatar pjedrzejewski avatar pogorivan avatar pptasinski avatar pptasinski-bitbag avatar radnok avatar rafalmal avatar senghe avatar stefandoorn avatar tbuczen avatar tymekb avatar wojdylak avatar zales0123 avatar zalmanix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

syliuswishlistplugin's Issues

[Q&A] The cookie name cannot be empty

This can happen after logging in to Account area
when you set something like this at plugin's config:

bit_bag_sylius_wishlist:
    wishlist_cookie_token: false

(I've misunderstood purpose of wishlist_cookie_token option and set false there)...

can't add to cart if stock not tracked

Hi,

I was wondering is there is a reason why you don't take into account if the product stock is tracked or not.
If the product stock is marked as non tracked, we can still add the product to the cart, even is the stock is not set higher than 0, but we can't add it from the wishlist.

I can do a simple PR is that 's a mistake

Inconsistent wishlists for logged in user

With version 2.0, wishlists for logged in user have a lot of inconsistencies.

Not logged in user
The first time a user enter the website a new token is generated and assigned to the user. This token is stored both on DB and as cookie. The token is used as identifier to retrieve the wishlists of the user. If the user cleans his cookie the wishlist resets as a new token is generated and assigned to him. This is ok.

The user logs in
Now, if a not logged in user has a wishlist with some products and logs in, he will see the new wishlist as his token is still the same, but if he clean his cookies, the wishlist disappears. This is bad, and this is due to the fact that, on the DB, the field "shop_user_id" of the wishlist is not populated with the id of the user upon login.

Now, a new token has been generated, and the user can add products to the wishlist, and this wishlist has the "shop_user_id" populated. Ok, but now, everytime the user cleans his cookies a new token will be generated and a new wishlist will be created for him.


P.S. the demo here doesn't seems to have the last version of this plugin. Moreover, it seems impossibile to register and login, cause the verification email is never delivered.

wishlist not updated after user register

When i come on the page as a new user, the wishlist is created without the shop user id. Then i create an account, an the wishlist is not updated, the shop user is not set

in this issue there is the same behaviour, the field "shop_user_id" of the wishlist is not populated with the id of the user

[feedback]Use App Channel entity in mappings instead of Component Channel

Sylius\Component\Channel\Model\Channel class should not be a target of the entity in mappings. The App\Entity\Channel\Channel should be used instead. Whenever the component entity is extended the application will fail. An example is Sylius Plus.

Now

<many-to-one field="channel" target-entity="Sylius\Component\Channel\Model\Channel">
    <join-column name="channel_id" on-delete="CASCADE" />
</many-to-one>

Should be

# src/Resources/config/doctrine/Wishlist.orm.xml
<many-to-one field="channel" target-entity="App\Entity\Channel\Channel">
    <join-column name="channel_id" on-delete="CASCADE" />
</many-to-one>

TypeError when adding a product to wishlist without a referer

When calling the URL to add a product to the wishlist without having a referer, a TypeError exception is thrown :

Symfony\Component\HttpFoundation\Request::create(): Argument #1 ($uri) must be of type string, null given, called in [...]/vendor/bitbag/wishlist-plugin/src/Controller/Action/AddProductToWishlistAction.php on line 110

This happens when bots are browsing the site, but also when a visitor shares the "Add to wishlist" button URL to someone instead of the product page URL.

I thought this could be fixed by redirecting to the homepage if there is no referer:

$referer = $request->headers->get('referer');
$redirectURL = $referer ? Request::create($referer)->getPathInfo() : $request->getSchemeAndHttpHost();

return new RedirectResponse($redirectURL);

Another option would be to inject the router in the controller and generate the URL to the product page.

I can submit a PR !

Huge performance problem and almost site-breaking

Hi guys,
there is a huge performance problem with the version 2.0.0 of this plugin. It's a combination of 2 changes that were made in this version and that were not properly addressed:

  1. On EVERY first request of a "new user", a record is added to the btibag wishlist. This is done here with an event listener on the kernel request. As you can see, this logic check if the cookie "wishlist_cookie_token" is set, otherwise it creates a NEW WISHLIST record in the table. Maybe a normal user would navigate the website for sometime with that cookie properly set, but if we consider all the traffic coming from bots, that can easily ignore cookies, this will lead to a new record on the table for each request!
    Moreover, there aren't any services that clean this table, so this will grow indefinitely.

  2. The "unique" constraint on the token field in the wishlist bitbag plugin has been removed, and the only index of the table is on the "shop_user_id" (excluding the ID), but all queries are made by using the shop_user_id and the token, that is not indexed, resulting in a very slow query that reads all the records. Combined with the previous point, this leads to a slower and slower website: the table grows on each request and the wishlist is read on a huge table without proper indexes.

Database Schema not in sync wit migrations

We are using Mysql and the DB Schema of this plugin is not in sync with the provided migrations.

When you exec bin/console do:mi:mi -n the migration bundle will create a new migration file.

Please add the missing token_idx migration to this plugin.

SQL Migration from <1.5.x to >1.5.x

Hello,

There's an issue with your Migration (Version20201029161558.php) while upgrading from version below 1.5 to version 1.5.x.

When executing php bin/console doctrine:migration:migrate -q it returns this error

Script doctrine:migration:migrate -q returned with error code 1
!!  
!!  In AbstractMySQLDriver.php line 57:
!!                                                                                 
!!    An exception occurred while executing 'CREATE TABLE bitbag_wishlist (id INT  
!!     AUTO_INCREMENT NOT NULL, shop_user_id INT DEFAULT NULL, token VARCHAR(255)  
!!     NOT NULL, UNIQUE INDEX UNIQ_578D4E775F37A13B (token), UNIQUE INDEX UNIQ_57  
!!    8D4E77A45D93BF (shop_user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8   
!!    COLLATE `UTF8_unicode_ci` ENGINE = InnoDB':                                  
!!                                                                                 
!!    SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'bitbag_wish  
!!    list' already exists                                                         
!!                                                                                 
!!  
!!  In Exception.php line 18:
!!                                                                                 
!!    SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'bitbag_wish  
!!    list' already exists                                                         
!!                                                                                 
!!  
!!  In PDOConnection.php line 52:
!!                                                                                 
!!    SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'bitbag_wish  
!!    list' already exists                                                         
!!                                                                                 
!!  
!!  doctrine:migrations:migrate [--write-sql [WRITE-SQL]] [--dry-run] [--query-time] [--allow-no-migration] [--all-or-nothing [ALL-OR-NOTHING]] [--configuration CONFIGURATION] [--db-configuration DB-CONFIGURATION] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<version>]
!!  
!!  

It is actually because you don't check tables and columns in your migration class with methods like $schema->hasTable('xxx') or $schema->getTable('xxx')->hasColumn('xxx').

Thx

Doctrine migration is not up to date with the entity mappings

After migrating migration BitBag\SyliusWishlistPlugin\Migrations\Version20201029161558
and checking schema by following commad

bin/console doctrine:schema:validate

It will return an error

[ERROR] The database schema is not in sync with the current mapping file.

and after checking for missing SQL queries

bin/console doctrine:schema:update --dump-sql

returns:

 The following SQL statements will be executed:

     ALTER TABLE bitbag_wishlist_product DROP FOREIGN KEY FK_3DBE67A0FB8E54CD;
     ALTER TABLE bitbag_wishlist_product ADD CONSTRAINT FK_3DBE67A0FB8E54CD FOREIGN KEY (wishlist_id) REFERENCES bitbag_wishlist (id) ON DELETE CASCADE;

The next migration file should be created?

Add WishlistSyncInterface to every messenger handled message

I'am using the version 4.0 of this Plugin.

In our project every transport is async by default. So every action i make with wishlists is also async after installing the plugin. When creating a new wishlist i will get an error because the message was not handled in sync. Which also makes totally sense.

In my messenger configuration i had to configure the following, in order to get every single SyliusWishlistPlugin message handled by a sync transport.

framework:
  messenger:
    transports:
      sync:
        dsn: 'sync://'
    routing:
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\RemoveWishlist': sync
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\RemoveProductVariantFromWishlist': sync
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\RemoveProductFromWishlist': sync
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\UpdateWishlistNameInterface': sync
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\RemoveSelectedProductsFromWishlist': sync
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\ExportSelectedProductsFromWishlistToPdfInterface': sync
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\AddWishlistToUser': sync
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\CopySelectedProductsToOtherWishlistInterface': sync
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\AddSelectedProductsToCart': sync
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\CreateNewWishlist': sync
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\CreateWishlist': sync
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\AddProductToSelectedWishlist': sync
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\AddProductsToCartInterface': sync
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\WishlistTokenValueAwareInterface': sync

My idea here is to minimize the configuration by adding a WishlistSyncInterface to every messenger relevant command. And also adding a hint to the documentation that when you are using async transports only, you have to configure your messenger like this:

framework:
  messenger:
    transports:
      sync:
        dsn: 'sync://'
    routing:
      'BitBag\SyliusWishlistPlugin\Command\Wishlist\WishlistSyncInterface': sync

Unknown column 'b0_.name' in 'field list' on fresh install

Hello,

I have this error message after install plugin (on sylius fresh install) :

An exception occurred while executing 'SELECT b0_.name AS name_0, b0_.token AS token_1, b0_.id AS id_2, b0_.shop_user_id AS shop_user_id_3, b0_.channel_id AS channel_id_4 FROM bitbag_wishlist b0_ WHERE b0_.shop_user_id = ? OR b0_.token = ? ORDER BY b0_.id ASC' with params [22, ""]:

Any idea ?
Thank you

PHPStan

Hey, I just ran phpstan on the code and it found 22 errors.
Thing is, we use a fork of this plugin in our project where we don't want any phpstan errors.
I could fix them in the fork, but pulling updates from this repository would probably bring them back.

upgrade to sylius 1.5/1.6

Hello,

I'm using this package and I recently wanted to upgrade to Sylius 1.6, but the package's dependancy to Sylius 1.4 make it impossible. It would be good to make a new tag for these new version au Sylius!

Thank you !

Share wishlist

Hello

I want to know if there is any possibilities to share a wishlist ? By mail for example

Thanks

Error during cache generation

Sylius version: 1.11.7
Wishlist plugin version: 2.0.5

Since the 2.0.5 version an error occurred when I run the cache:clear command with the %kernel.debug% set to false :

request.CRITICAL: Uncaught PHP Exception Error: "Failed opening required '/srv/sylius/var/cache/prod/doctrine/orm/Proxies/__CG__SyliusComponentChannelModelChannel.php' (include_path='.:/usr/local/lib/php')" at /srv/sylius/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php line 197 {"exception":"[object] (Error(code: 0): Failed opening required '/srv/sylius/var/cache/prod/doctrine/orm/Proxies/__CG__SyliusComponentChannelModelChannel.php' (include_path='.:/usr/local/lib/php') at /srv/sylius/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:197)"}

Apparently the proxy class for Sylius\Component\Channel\Model\Channel cannot be generated. Actually we don't need a proxy class for the Sylius channel model, because we extend it as an entity.

After investigations it appears that the wishlist entity definition in the bitbag wishlist plugin is responsible for this error. The PR #158 will fix it.

Got error on symfony version 4.4.5

It's ok on symfony version 4.3.11. But not works on symfony version 4.4.5.
`Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException:
An error has occurred resolving the options of the form "Sylius\Bundle\CoreBundle\Form\Type\Order\AddToCartType": The option "is_wishlist" does not exist. Defined options are: "action", "allow_extra_fields", "allow_file_upload", "attr", "attr_translation_parameters", "auto_initialize", "block_name", "block_prefix", "by_reference", "compound", "constraints", "csrf_field_name", "csrf_message", "csrf_protection", "csrf_token_id", "csrf_token_manager", "data", "data_class", "disabled", "empty_data", "error_bubbling", "error_mapping", "extra_fields_message", "help", "help_attr", "help_html", "help_translation_parameters", "inherit_data", "invalid_message", "invalid_message_parameters", "label", "label_attr", "label_format", "label_translation_parameters", "mapped", "method", "post_max_size_message", "product", "property_path", "required", "row_attr", "translation_domain", "trim", "upload_max_size_message", "validation_groups".

at vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php:99
at Symfony\Component\Form\ResolvedFormType->createBuilder(object(FormFactory), '0', array('label' => false, 'required' => false, 'product' => object(Product), 'data' => object(AddToCartCommand), 'is_wishlist' => true))
(vendor/symfony/symfony/src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeDataCollectorProxy.php:74)
at Symfony\Component\Form\Extension\DataCollector\Proxy\ResolvedTypeDataCollectorProxy->createBuilder(object(FormFactory), '0', array('label' => false, 'required' => false, 'product' => object(Product), 'data' => object(AddToCartCommand), 'is_wishlist' => true))
(vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php:76)
at Symfony\Component\Form\FormFactory->createNamedBuilder(0, object(ResolvedTypeDataCollectorProxy), null, array('label' => false, 'required' => false, 'product' => object(Product), 'data' => object(AddToCartCommand), 'is_wishlist' => true))
(vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php:94)
at Symfony\Component\Form\FormBuilder->create(0, 'Sylius\Bundle\CoreBundle\Form\Type\Order\AddToCartType', array('label' => false, 'required' => false, 'product' => object(Product), 'data' => object(AddToCartCommand), 'is_wishlist' => true))
(vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php:244)
at Symfony\Component\Form\FormBuilder->resolveChildren()
(vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php:195)
at Symfony\Component\Form\FormBuilder->getForm()
(vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php:30)
at Symfony\Component\Form\FormFactory->create('BitBag\SyliusWishlistPlugin\Form\Type\AddProductsToCartType', null, array('cart' => object(Order), 'wishlist_products' => object(PersistentCollection)))
(vendor/bitbag/wishlist-plugin/src/Controller/Action/ListWishlistProductsAction.php:82)
at BitBag\SyliusWishlistPlugin\Controller\Action\ListWishlistProductsAction->__invoke(object(Request))
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:146)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:201)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(public/index.php:25)`

Unable to add translations to modal

Hi all.

We are using the wishlist plugin in a different language, and we are able to override all translations that are used in the Twig templates, so that is great. But i am not able to easily change the content of the modal. And i believe all the text in this modal is all set in javascript. Is there an easy way to add the required translations instead of forking this repository?

Thanks for this plugin and your time.

CreateNewWishlistSubscriber breaks `debug:event-dispatcher` command

when i type bin/console debug:event-dispatcher -vvv

the command is blocked by:

[Webmozart\Assert\InvalidArgumentException]
The class has to be used in HTTP context only
Webmozart\Assert\Assert::notNull() at vendor/bitbag/wishlist-plugin/src/EventSubscriber/CreateNewWishlistSubscriber.php:48

I modified the code by not injecting the Request into constructor and using the request object from the RequestEvent. Also removed the Assert.

public function onKernelRequest(RequestEvent $event): void
{
    if (!$event->isMainRequest()) {
        return;
    }
    $request = $event->getRequest();
    $currentPath = $request->getPathInfo();
    if (!str_starts_with($currentPath, self::ALLOWED_ENDPOINTS_PREFIX)) {
        return;
    }

    /** @var WishlistInterface[] $wishlists */
    $wishlists = $this->wishlistsResolver->resolve();

    $wishlistCookieToken = $request->cookies->get($this->wishlistCookieToken);

    if (!empty($wishlists)) {
        if (null === $wishlistCookieToken) {
            $request->attributes->set($this->wishlistCookieToken, reset($wishlists)->getToken());
        }

        return;
    }

    if (null === $wishlistCookieToken) {
        $wishlistCookieToken = $this->wishlistCookieTokenResolver->resolve();
    }

    $request->attributes->set($this->wishlistCookieToken, $wishlistCookieToken);
}

public function onKernelResponse(ResponseEvent $event): void
{
    if (!$event->isMainRequest()) {
        return;
    }
    $request = $event->getRequest();
    if (!str_starts_with($request->getPathInfo(), self::ALLOWED_ENDPOINTS_PREFIX)) {
        return;
    }

    if ($request->cookies->has($this->wishlistCookieToken)) {
        return;
    }

    $response = $event->getResponse();
    $wishlistCookieToken = $request->attributes->get($this->wishlistCookieToken);

    if (!$wishlistCookieToken) {
        return;
    }

    $cookie = new Cookie($this->wishlistCookieToken, $wishlistCookieToken, strtotime('+1 year'));
    $response->headers->setCookie($cookie);

    $request->attributes->remove($this->wishlistCookieToken);
}

services.yaml not read

After upgrading to Sylius 1.5.9 and Sf 4.4.5
the services in file /vendor/bitbag/wishlist-plugin/src/Resources/config/services.yml
are not correctly loading the services . (I have ensured that services.yml is read)

In OrderItemController at this line $addToWishlist = $form->get('addToWishlist');
form child 'addToWishlist' is not loaded.

An exception has been thrown during the rendering of a template ("Child "addToWishlist" does not exist.").

That corresponds to service
bitbag_sylius_wishlist_plugin.form.type.extension.add_to_cart_type_extension: class: BitBag\SyliusWishlistPlugin\Form\Extension\AddToCartTypeExtension tags: - { name: form.type_extension, extended_type: Sylius\Bundle\CoreBundle\Form\Type\Order\AddToCartType }

If I copy this service to our /config/services.yaml this error disappears. and console command console debug:form 'Sylius\Bundle\CoreBundle\Form\Type\Order\AddToCartType' confirms.
But we should not copy all your services into our files!

Do you know something about this ?

Symfony Toolbar problem on product page

Hi guys ,
I'm having a problem with the plugin on the product page. When I load the page, the Symfony toolbar never loads as in the attachment. Do you have any idea how to solve this problem?
Thank you ๐Ÿ™
image

WishlistProduct resource gets an incorrect controller class

If you try, to create a resource route with standard ResourceController for wishlist_product, you end up with an error of non-existing method.

Got dug into the code and found that the default controller is โ€” probably accidentally โ€” specified as one of EntityRepository aliases.

image

A workaround:

bit_bag_sylius_wishlist:
    resources:
        wishlist_product:
            classes:
                controller: Sylius\Bundle\ResourceBundle\Controller\ResourceController

Wishlist created on every request as anonymous user

In Version 4.0.1 with the Merge of the PR the bug where on every Request there is a new wishlist created.

After updating to 4.0.0 i created a test wich makes several request to sylius and counts the number of wishlists in database. Maybe also a good test for this plugin?

Anyways, i think the Wishlist Resolver and the CreateWishList Command must be modified to also return null or at least not persisting to database. Evereytime when renering the add_item_to_cart form, it creates a wishlist in database.

Two differents account can share the same wishlist

Steps to reproduce:

  • Log in with account1
  • Add products in wishlist
  • Logout
  • Log in with account2
  • Go to wishlist

Result: You have items in your account2's wishlist that account1 put in its wishlist.

I presume it should be due to local storage, but if users are logged in, the plugin shouldnt use local storage

AddToCartTypeExtension creates at least one Wishlist in DB

In BitBag\SyliusWishlistPlugin\Form\Extension\AddToCartTypeExtension::buildForm() there is a call to resolveAndCreate() which is not that good, because just hitting the product detail page writes data to DB :/

->add('wishlists', EntityType::class, [
    'class' => Wishlist::class,
    'choices' => $this->wishlistsResolver->resolveAndCreate(),
    'choice_label' => 'name',
    'mapped' => false,
])

Not sure what to do here jet, but maybe just call $this->wishlistsResolver->resolve() is also fine and we can live with a empty list of wishlists here?

Unable to create wishlist using form submit in modal.

When creating a wishlist using the modal, it sometimes happens that a user presses submits the form using the keyboard instead of pressing 'Perform' in the modal.
Since the form in the modal does not have action or a submit event handler, the form posts its action to /wishlist instead of /wishlist/create. This causes either a 422 Method not allowed error, but in most cases nothing happens.

Is there something i am missing or is this not yet implemented?

When it is not yet implemented, I believe this can fixed/implemented by doing the following.
Add either a action to the form in the modal to /wishlists/create. Or call the performAction javascript function when the form is submitted, instead of only handling the performAction function on the click event of the 'Perform' button.

Due to time constraints i am unable to submit a PR in the near future.

Thank for your time and this plugin.

Plugin installation override the doctrine migration_paths order

Sylius version : 1.9
Plugin version : v1.5.3

After installing the plugin, I noticed that all the migrations that we create using the doctrine:migrations:diff (or :generate) ends up in the plugins migration folder, instead of the project's directory.

Turns out the plugin's BitBagSyliusWishlistExtension class prepend its migration_path, causing the following thing :
image

Migrations are correctly setup in our project (see our config/packages/doctrine_migrations.yaml file)
image

Is there a reason as to why this approach was chosen instead of a doctrine:migrations:diff then :migrate ?

Thanks

Irrelevant code at removeProduct method / Disappointing method name

public function removeProduct(WishlistProductInterface $product): self should be renamed to public function removeWishlistProduct(WishlistProductInterface $wishlistProduct): self.

Currently it looks like this:

    public function removeProduct(WishlistProductInterface $product): self
    {
        if ($this->hasWishlistProduct($product)) {
            $this->wishlistProducts->removeElement($product);
        }

        return $this;
    }

Exprcting this:

    public function removeWishlistProduct(WishlistProductInterface $wishlistProduct): self
    {
        if ($this->hasWishlistProduct($product)) {
            $this->wishlistProducts->removeElement($product);
        }

        return $this;
    }
    
    public function removeProduct(ProductInterface $product): self
    {
        foreach ($this->wishlistProducts as $wishlistProduct) {
            if ($wishlistProduct->getProduct() === $product) {
                $this->wishlistProducts->removeElement($wishlistProduct);
            }
        }

        return $this;
    }

Some aliases not defined for autowiring

This is a list of missing ones I've faced (but there may be more):

services:
    # Missed services required for autowiring
    BitBag\SyliusWishlistPlugin\Factory\WishlistFactoryInterface:
        alias: bitbag_sylius_wishlist_plugin.custom_factory.wishlist

    BitBag\SyliusWishlistPlugin\Factory\WishlistProductFactoryInterface:
        alias: bitbag_sylius_wishlist_plugin.custom_factory.wishlist_product

    BitBag\SyliusWishlistPlugin\Context\WishlistContextInterface:
        alias: bitbag_sylius_wishlist_plugin.context.wishlist

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.