-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Product association : ajax product search fails #9364
Comments
More information in duplicate ticket #9411. |
I can confirm this issue also occurs on |
Should be fixed by #9775. |
Thank you, @edouardT, for reporting this bug, should be fixed right now, don't hesitate to reopen this issue if there still will be some problems :) |
@Zales0123 Has this really been fixed? Because my project still fails to load the list of products. I am using symfony 4.2 with sylius 1.3. Sorry for disturbing but I really cannot find a solution to this problem |
@Zales0123 @andychan94 I confirm this bug is not fixed. Like I said, the problem is in the json response which returns all product data instead of product name. I don't know if it's easy to change it... Let me know if you find a solution. I will try to fix this in the next few weeks if I can. |
@edouardT sorry, any progress yet? If you are busy maybe I could try to work on it if you can give me details? Thanks! |
Issue still there in v1.3.5... |
Correct. Would appreciate if anyone shares a solution they found for this |
My workaround was replace the route with a custom action. routes.yaml
CustomController.php
|
@Zales0123 @pamil What about adding the suggestion above into core? |
@Takeno could you please show ur custom method in |
@andychan94 something like this: public function findBySearch($term)
{
return $this->createQueryBuilder('o')
->select('translation.name')
->addSelect('o.code')
->innerJoin('o.translations', 'translation', 'WITH', 'translation.locale = :locale')
->addOrderBy('o.updatedAt', 'DESC')
->andWhere('o.code LIKE :term')
->orWhere('translation.name LIKE :term')
->setParameter('locale', 'it_IT')
->setParameter('term', '%' . $term . '%')
->setMaxResults(20)
->getQuery()
->getResult();
} |
@Takeno thanks for your help!
But I am getting the following error
I cannot disable the autowiring for this controller, so I dont know what to do. If I do not extend the
I tried to follow the docs, read the Sorry if it is getting annoying but I would really appreciate your help! Thanks! |
Try
|
@jcgdjob thank you! Seems like this is working fine! Thank you guys so much! |
This bug occurred also for me (Sylius 1.5.2, Sf 4.3.2) and surprisingly it's stop happening when I add the (EDITED after @olia-bn comment)
I also try with Xdebugging it without the |
Hi guys, |
It is still present in 1.6.4 GraphNavigator is timing out: @Prometee 's solution works perfectly as a work-around, with one note: the path in his solution is incorrect; this will work tho:
|
@olia-bn you are right to fix the bug you have to put an override with the correct path into |
Hi all, I tried the solution:
But for me its not working. (Not in 1.6 and also not in 1.7.3 Any ideas? |
@TELLO0815 rechecking my fix proposition on 1.7.3 and it's working, do you debug the route definition in console : |
|
@TELLO0815 I don't have the same
|
Here is my full override, maybe you don't see the @olia-bn comment altering my comment (I edit my first post to avoid others having this issue too) :
|
Works. THX |
Hey folks, it seems like it is something we could fix in the core. Would you like to open a PR with the fix? Preferably with some PHPUnit test (if you will be able to make this call there, as it would be a first one). You can find some inspirations for tests here: https://github.com/Sylius/Sylius/blob/master/tests/Controller/AdminUserApiTest.php |
@lchrusciel I'm on it, I see that there is a fixture with an admin user now I have to found how to authenticate it in the unit test. |
if you are using nelmio fixtures, just add following array: Sylius/tests/Controller/AdminUserApiTest.php Lines 23 to 26 in 0e9d41d
Also, there are fixtures with a product already as well |
I see, authenticate with the bearer will work even if it's an |
@lchrusciel pushed it, I have to authenticate the user before making a request. Same process is used for behat tests into the service |
This PR was merged into the 1.7-dev branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | fixes #9364 | License | MIT Commits ------- 8022191 Fix ajax product search when too many products f93262c Add upgrade note c400b69 Add product associations to avoid regression 560bf13 Add old behaviour
Hi @Prometee, I just found this thread and as I am facing similar issue, I though maybe you could give some insights. When I try to add associated products (v1.7.6), I am not able to see the drop down list. There is no ajax requets (verified with developer tool). Seems to me that it is js issue, but I don't have any error message. When I manually load url from data-url attribut, I get a json list, which seems to work, but when I am on the input text for associated product selection, nothing happens. Do you know what may cause this? Thanks in advance |
@starmate I suspect something related with javascript setup at first sight, maybe you can ask for more help on Sylius's Slack support channel. |
Hi @Prometee , Yes it was actually. It was generated by glitch with mollie module in their app.js (v3.2.3). Seems to be fixed from v2.3.4. |
I'm using Sylius 1.10 and the problem is still here. |
thank you very mutch you are the best |
Sylius 1.10.14, still running into this issue. I either get an out of memory or max execution time reached error. Or the response simply contains no data. I tried to debug it for like 2 hours but it's not really that simple. Overwritting the route with a custom action is very simple and works easily. So thanks once more to @Takeno for this work around. |
I think the error is related with new attributes added to Product entity that the Default serilization is not able to serialize properly, in my case it was solved replacing in the route declaration Add to the final of config/routes/sylius_admin.yaml:
|
With more than 100 products in database and long text contents, espacially in description field (including html), when you modify a product in back-office and want to make a new product association, if you search a product in the dropdown selector, the request is really slow or fails.
The first thing is that the response returns all fields of the product in the JSON Response while we only need the name and the code of the product. So, it takes a lot of time to serialize the whole object and after, it takes a lot of time to display the list in the javascript function.
I didn't find if it's possible to request a part of the product field and not the whole object.
That's problematic because in a lot of case the request take too much time and stops, so we can't select any product for the association...
The text was updated successfully, but these errors were encountered: