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

Exception Error in Catalog Price Rule while Backend language is not English #12399

Closed
Drakas opened this issue Nov 22, 2017 · 23 comments
Closed
Assignees
Labels
Event: squashtoberfest Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@Drakas
Copy link

Drakas commented Nov 22, 2017

Preconditions

  1. Magento 2.2.1, Php 7, Mysql 5.6
  2. Interface Backend Magento language SET to Italy.

Steps to reproduce

  1. Go to: Marketing -> catalog price rule
  2. Edit a record already created
  3. Click on "Save and Apply"

Expected result

  1. The following message:
  • We found updated rules that are not applied. Please click "Apply Rules" to update your catalog.
  • You saved the rule.

Actual result

  1. Error message that say that "something got wrong, check the log". (See the image attached)

Error detailed from exception.log:
main.CRITICAL: DateTime::__construct(): Failed to parse time string (22/11/2017) at position 0 (2): Unexpected character {"exception":"[object] (Exception(code: 0): DateTime::__construct(): Failed to parse time string (22/11/2017) at position 0 (2): Unexpected character at /home/zboutiqf/public_html/nuovo_magento/vendor/magento/module-rule/Model/AbstractModel.php:399)"} []

IMPORTANT:
With Backend language set to English the error does not occur, only with Italian language.

schermata 2017-11-22 alle 13 13 42

@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Nov 22, 2017
@magento-engcom-team
Copy link
Contributor

@Drakas thank you for your report.
We were not able to reproduce this issue by following the steps you provided. Please provide more detailed steps to reproduce or try to reproduce this issue on a clean installation.

@tommybds
Copy link

tommybds commented Nov 24, 2017

Same problem with french language here, on Magento 2.2.0 , Php 7, Mysql 5.6
I am able to create basket price rules however

@tommybds
Copy link

Someone had the same problem 1 year ago

Apparently it can be because magento need a date filter to convert the localized date to an internal date "dd/MM/y" instead of "M/d/yy"

@tommybds
Copy link

I can confirm it is because the date format, I am able to register a new rule in french language if I set it to an MM/DD/YY format (that's why we couldn't do it for black friday @Drakas)

@magento-engcom-team magento-engcom-team added 2.2.x Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release and removed Progress: needs update labels Nov 28, 2017
@okorshenko okorshenko removed the 2.2.x label Dec 14, 2017
@sedax90
Copy link

sedax90 commented Dec 29, 2017

Same problem in M2.2.2 with italian localization... it's a very annoying issue because we need to launch our website asap and this issue is currently blocking it!

@lucacanella
Copy link

Same problem here. Magento 2.2.3, Italian localization. Currently working on it.

@sedax90
Copy link

sedax90 commented Mar 2, 2018

seriously, we have some ecommerce to publish and no one has yet made a backport for version 2.2 (besides the fact that nobody knows when the 2.3 will be released)

@lucacanella
Copy link

I'm resolving with a plugin to reformat dates before they get to the method that throws the exception. Frankly I think this is a poor fix, but gets the job done and that's better than nothing until we get a better one. If I manage to fix this I'll post some code here.

@lucacanella
Copy link

lucacanella commented Mar 3, 2018

Comment edited

Yesterday I published a quick fix in this comment but it wasn't helping much. I think you should try with this: https://github.com/Magonex/module-datetime

Other issues that seem to be related can be found here:
https://github.com/magento/magento2/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+Invalid+input+datetime+format+of+value

@Cristiano81
Copy link

Cristiano81 commented Mar 12, 2018

I found a solution, please try to follow this fix:
#11306
and then change
/vendor/magento/module-catalog-rule/Controller/Adminhtml/Promo/Catalog/Save.php
adding this lines after line 62

`
$filterValues = ['from_date' => $this->_dateFilter];

            if ($this->getRequest()->getParam('to_date')) {
            	$filterValues['to_date'] = $this->_dateFilter;
            }

            $inputFilter = new \Zend_Filter_Input(
            		$filterValues,
            		[],
            		$data
            		);

            $data = $inputFilter->getUnescaped();

`

these lines are present in module-sales-rule but not in module-catalog-rule

@SamB-GB
Copy link

SamB-GB commented Mar 30, 2018

Still seeing the issue in 2.2.3 when user is set to British English.

@Drakas
Copy link
Author

Drakas commented May 14, 2018

@magento-engcom-team

@LucaGallinari
Copy link

Based on @Cristiano81 comment i created this patch that you can apply until this is resolved:
https://gist.github.com/LucaGallinari/f476c5383a7eeafdfe778c8a980902df

@sedax90
Copy link

sedax90 commented Sep 21, 2018

@LucaGallinari 'spatch is working fine, @magento-engcom-team it's possibile to include it in 2.2.7 release?

@Drakas
Copy link
Author

Drakas commented Sep 21, 2018 via email

@Mardl
Copy link
Contributor

Mardl commented Oct 6, 2018

#squashtoberfest

@magento-engcom-team
Copy link
Contributor

@Mardl thank you for joining. Please accept team invitation here and self-assign the issue.

@larsroettig
Copy link
Member

@magento-engcom-team give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @larsroettig. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @larsroettig, here is your Magento instance.
Admin access: https://i-12399-2-3-develop.engcom.dev.magento.com/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@larsroettig
Copy link
Member

larsroettig commented Oct 6, 2018

Error can reproduce in 2.3 vanilla Instance is not fixed in 2.3

https://www.youtube.com/watch?v=xBMxMfKHmuc&feature=youtu.be

@larsroettig larsroettig added Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release and removed Fixed in 2.3.x The issue has been fixed in 2.3 release line labels Oct 6, 2018
@okorshenko okorshenko added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Oct 31, 2018
@okorshenko
Copy link
Contributor

Hi @Drakas. Thank you for your report.
The issue has been fixed in #18419 by @Mardl in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.1 release.

@magento-engcom-team
Copy link
Contributor

Hi @Drakas. Thank you for your report.
The issue has been fixed in #19074 by @Mardl in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.8 release.

magento-engcom-team added a commit that referenced this issue Nov 7, 2018
…ice Rule while Backend language is not English #19074

 - Merge Pull Request #19074 from Mardl/magento2:back-port-pull-18419
 - Merged commits:
   1. a5a0b0b
magento-engcom-team pushed a commit that referenced this issue Nov 7, 2018
…ice Rule while Backend language is not English #19074
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Event: squashtoberfest Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests