Results 1 to 10 of 44

Hybrid View

  1. #1
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    806
    Plugin Contributions
    0

    Default Site Crashed U_ILLEGAL_ARGUMENT_ERROR in IntlDateFormatter

    EDIT: Affects 8.1.25, 8.2.12, and 8.3.0RC3+

    Hello All,
    1.5.8 (forget the revision) on php 8.2. Woke this morning to white screens in admin and front end.

    Code:
    [02-Nov-2023 10:05:18 America/New_York] Request URI: /manufactuername-m-1.html, IP address: 11.22.33.44
    --> PHP Fatal error: Uncaught IntlException: datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR in /home/account/www.website.com/includes/classes/zcDate.php:87
    Stack trace:
    #0 /home/account/www.website.com/includes/classes/zcDate.php(87): IntlDateFormatter->__construct('C', 3, -1)
    #1 /home/account/www.website.com/includes/classes/zcDate.php(39): zcDate->initializeConversionArrays()
    #2 /home/account/www.website.com/includes/autoload_func.php(47): zcDate->__construct()
    #3 /home/account/www.website.com/includes/application_top.php(237): require('/home/account...')
    #4 /home/account/www.website.com/index.php(25): require('/home/account...')
    #5 {main}
      thrown in /home/account/www.website.com/includes/classes/zcDate.php on line 87.
    Please help.

    Thank you,
    John

  2. #2
    Join Date
    Jun 2005
    Posts
    310
    Plugin Contributions
    0

    Default Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR

    Me too, thought it was the hosting service
    2 + 2 = 5 for extremely large values of 2

    Pez Collectors Store

  3. #3
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    806
    Plugin Contributions
    0

    Default Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR

    I just switched php back to 8.0 and it's running again seemingly without errors or warnings. I'd really like to get this resolved though so we can go back to 8.2.

    Thanks again,
    John

  4. #4
    Join Date
    Apr 2009
    Posts
    425
    Plugin Contributions
    2

    Default Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR

    This has just started happening on my test site. Live is ok.
    It appears that this code in includes/classes/zcDate.php is the issue
    Code:
                $this->locale = setlocale(LC_TIME, 0);
    
                // -----
                // Using the current locale, retrieve the locale-specific 'short' date and time
                // formats.
                //
                $format = new IntlDateFormatter(
                    $this->locale,
                    IntlDateFormatter::SHORT,
                    IntlDateFormatter::NONE
                );
    The issue appears to be that if setlocale has not been called before zcDate is initialised the server returns a local of "C" this appears to mean not set yet.
    I found this from @DrByte https://github.com/php/php-src/issues/12561#issuecomment-1786428271

    I don't know enough to fix this.

    I suspect that zcDate class is being initialised before setlocale is set in

    includes/languages/lang.english.php
    YOURADMIN/languages/lang.english.php

    If I add the setlocale from the language file to the begining index.php and YOURADMIN/index.php the system seems to work OK. This is a workaround and not a solution! I will try a few other things to find a solution. Mean while if @drByte, @lat9... could look at this.
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  5. #5
    Join Date
    Jun 2005
    Posts
    310
    Plugin Contributions
    0

    Default Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR

    I agree. index.php requires includes/application_top.php, which loads the autoloaders including config.core.php, which calls zcDate.php
    only after application_top.php does all its stuff are the language files parsed, including the setlocale
    set locale may need to be moved to configure.php instead...
    2 + 2 = 5 for extremely large values of 2

    Pez Collectors Store

  6. #6
    Join Date
    Jun 2005
    Posts
    310
    Plugin Contributions
    0

    Default Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR

    lol, now that I'm all caught up on github convo I see that drbyte has just about decided the same.
    https://github.com/zencart/zencart/issues/6037
    2 + 2 = 5 for extremely large values of 2

    Pez Collectors Store

 

 

Similar Threads

  1. v158 IntlDateFormatter php issue
    By gothstone in forum Bug Reports
    Replies: 2
    Last Post: 22 Feb 2024, 11:55 AM
  2. v158 U_illegal_argument_error
    By jeking in forum General Questions
    Replies: 2
    Last Post: 2 Nov 2023, 08:13 PM
  3. v156 Site and Admin crashed!!!
    By wmorris in forum General Questions
    Replies: 9
    Last Post: 10 Jun 2019, 05:20 PM
  4. Replies: 11
    Last Post: 19 Sep 2009, 06:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR