Problem on saving variants on a selection product
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Problem on saving variants on a selection product
Hello,
Laravel: 5.6.
Aimeos: 2018.07.
OS: Centos7.
When creating a selection product and before saving adding a variant (child product) and then click on save. The Selection product is added but the variant is not saved loosing the changes.
If you try to add the variant product once again when selection product is already created (on first attempt) and click save the child product is created without a problem.
Is this a expected behavior? or maybe admins should be able to create a selections product and its variants click on save only once?
Thank you very much for your help
Regards,
Laravel: 5.6.
Aimeos: 2018.07.
OS: Centos7.
When creating a selection product and before saving adding a variant (child product) and then click on save. The Selection product is added but the variant is not saved loosing the changes.
If you try to add the variant product once again when selection product is already created (on first attempt) and click save the child product is created without a problem.
Is this a expected behavior? or maybe admins should be able to create a selections product and its variants click on save only once?
Thank you very much for your help
Regards,
Re: Problem on saving variants on a selection product
Thank you for your bug report. We can confirm the issue and already made a fix:
https://github.com/aimeos/ai-admin-jqad ... 38d3423a33
It will be part of the 2018.10 version released next week.
https://github.com/aimeos/ai-admin-jqad ... 38d3423a33
It will be part of the 2018.10 version released next week.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Problem on saving variants on a selection product
Hello there,
I've just exceuted composer update upgrade my aimeos/laravel installation to 2018.10 (2018.10.2) for testing selection products. Im getting the same reported error: When creating a selection product with 2 variants and then update the variants with price, stock, etc, the custom variant attribute disappears and have to be added again.
Thank you very much for your help.
Regards,
I've just exceuted composer update upgrade my aimeos/laravel installation to 2018.10 (2018.10.2) for testing selection products. Im getting the same reported error: When creating a selection product with 2 variants and then update the variants with price, stock, etc, the custom variant attribute disappears and have to be added again.
Thank you very much for your help.
Regards,
Re: Problem on saving variants on a selection product
Think that was a different issue we've fixed this week. The new release of the admin interface is now available so can you execute "composer update" and try again?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Problem on saving variants on a selection product
Hi there!!
After running composer update as you suggested, we are getting the following error when clicking on product detail:
htmlspecialchars() expects parameter 1 to be string, array given on vendor/aimeos/aimeos-core/lib/mwlib/src/MW/View/Helper/Encoder/Standard.php Line 55. With the demo data.
Logging then content of $value, we found this before code breaks:
[2018-10-17 11:59:35] dev.INFO: array (
0 => '/stock?s_prodcode%5B0%5D=demo-article',
)
[2018-10-17 11:59:35] dev.ERROR: htmlspecialchars() expects parameter 1 to be string, array given {"exception":"[object] (ErrorException(code: 0): htmlspecialchars() expects parameter 1 to be string, array given at .../vendor/aimeos/aimeos-core/lib/mwlib/src/MW/View/Helper/Encoder/Standard.php:59)
For now, i was able to fix this issue by adding an is_array check like this:
if (is_array($value)) {
return htmlspecialchars( $value[0], ENT_QUOTES, 'UTF-8' );
} else {
return htmlspecialchars( $value, ENT_QUOTES, 'UTF-8' );
}
We are wondering if this is a bug in the core or maybe is related to some of our customization?
As always, thank you very much for help.
Regards,
After running composer update as you suggested, we are getting the following error when clicking on product detail:
htmlspecialchars() expects parameter 1 to be string, array given on vendor/aimeos/aimeos-core/lib/mwlib/src/MW/View/Helper/Encoder/Standard.php Line 55. With the demo data.
Logging then content of $value, we found this before code breaks:
[2018-10-17 11:59:35] dev.INFO: array (
0 => '/stock?s_prodcode%5B0%5D=demo-article',
)
[2018-10-17 11:59:35] dev.ERROR: htmlspecialchars() expects parameter 1 to be string, array given {"exception":"[object] (ErrorException(code: 0): htmlspecialchars() expects parameter 1 to be string, array given at .../vendor/aimeos/aimeos-core/lib/mwlib/src/MW/View/Helper/Encoder/Standard.php:59)
For now, i was able to fix this issue by adding an is_array check like this:
if (is_array($value)) {
return htmlspecialchars( $value[0], ENT_QUOTES, 'UTF-8' );
} else {
return htmlspecialchars( $value, ENT_QUOTES, 'UTF-8' );
}
We are wondering if this is a bug in the core or maybe is related to some of our customization?
As always, thank you very much for help.
Regards,
Re: Problem on saving variants on a selection product
Hi there...
We also tested, with demo data the product/selection variants problems and bug is still there... when you edit any attribute on the variant product (price and stock in our case), the variant attributes disappears on parent product:
Thanks.
Regards,
We also tested, with demo data the product/selection variants problems and bug is still there... when you edit any attribute on the variant product (price and stock in our case), the variant attributes disappears on parent product:
Thanks.
Regards,
Re: Problem on saving variants on a selection product
That might be related to the items/promo header templates you've overwritten. The new ones look like this:ajrmzcs wrote: For now, i was able to fix this issue by adding an is_array check like this:
if (is_array($value)) {
return htmlspecialchars( $value[0], ENT_QUOTES, 'UTF-8' );
} else {
return htmlspecialchars( $value, ENT_QUOTES, 'UTF-8' );
}
We are wondering if this is a bug in the core or maybe is related to some of our customization?
https://github.com/aimeos/ai-client-htm ... andard.php
Reason: Instead of one URL, there are now several stock URLs to prevent problems with length of HTTP URLs if you have a lot of articles where stock levels should be fetched for.
Such kind of changes are the reason why you should only overwrite those templates you really need to change and don't copy all to your own extension.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Problem on saving variants on a selection product
Does your products have a lot of attributes or other data? We've seen missing data after saving if the value of max_input_vars is too low. But the admin interface of the 2018.10 release should warn you about that ...ajrmzcs wrote: We also tested, with demo data the product/selection variants problems and bug is still there... when you edit any attribute on the variant product (price and stock in our case), the variant attributes disappears on parent product:
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Problem on saving variants on a selection product
Hi, thanks for your response.
Please help.
Thanks a lot.
Regards,
No. I tested on a fresh aimeos installation with demo data a got the same error. (When editing and saving any child product. The parent's variant attribute disappears).Does your products have a lot of attributes or other data? We've seen missing data after saving if the value of max_input_vars is too low. But the admin interface of the 2018.10 release should warn you about that ...
Please help.
Thanks a lot.
Regards,
Re: Problem on saving variants on a selection product
Just to be sure: Can you list the steps and the SKUs of the demo products you are editing to get the error? Maybe with a screenshot of the product before and after its variant attributes are lost?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star