Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.47k stars 2.8k forks source link

time zone error causes problems in chrome browser and derivatives (Buenos_Aires) #27352

Open luisuriarte opened 10 months ago

luisuriarte commented 10 months ago

Bug

When entering dolibarr, it shows the top menu and the rest: left and center sidebar is blank. Ref: https://www.dolibarr.org/forum/t/error-in-chrome-browser-and-others/24791

Environment Version

18.0.4, 19.0 beta

Environment OS

Ubuntu Server 23.10

Environment Web server

Nginx version: nginx/1.24.0 (Ubuntu)

Environment PHP

PHP 8.2.10-2ubuntu1 (cli) (built: Sep 5 2023 14:37:47)

Environment Database

mysql Ver 15.1 Distrib 10.11.4-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper

Environment URL(s)

No response

Expected and actual behavior

No response

Steps to reproduce the behavior

No response

Attached files

image

JonBendtsen commented 10 months ago

So here's apparently the error from his nginx from the link to the other dolibarr forum.

PHP Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad
timezone (America/Buenos_Aires) in /var/www/html/dolibarr/htdocs/core/lib/functions.lib.php:2819

@Real @Dolibarr @developers

What would be the correct procedure here?

  1. Flash an error at the user just like the green overlays when sending emails? This error could say that timezone is not well defined.
  2. Use the servers own timezone
  3. Use UTC?
  4. Attempt to guess the end users timezone based on the end users IP?
luisuriarte commented 10 months ago

My settings: Server zone: Server_zone

php Info: Php-Info

Chrome Develop image

Nginx Conf. Nginx-Conf

Nginx Error: image

dolibarr/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/php-bc.php (modified before installing) image

dolibarr/htdocs/includes/sabre/sabre/vobject/lib/timezonedata/windowszones.php (modified before installing) image

grep -irl America/Buenos_Aires * = Empty

luisuriarte commented 10 months ago

I think I found the error: It’s the browser. I don’t know why it has that wrong value for Buenos_Aires. I installed a plugin where I can change the time zone in Chrome (natively you can’t). I change the time zone as you can see: image

But when checking (Chrome, Brave, Edge, Chromium) In https://webbrowsertools.com/timezone/ image The zone is bad.

Mozilla Firefox: image The zone is good

@eldy The question is. Is it possible for Dolibarr to take the timezone of the web server (nginx, php) Not the browser?

eldy commented 10 months ago

We need to tak both the timezone of php and the timezone of browser. So we know whatcisbthe differencenand how to show the local hour according to the user tilezone (data are saved in the php tilezone). In buenos aires, the timezone has changed. It is now America/Argentina/Buenos Aires instead of America/Buenos Aires. Don't know why but we must wait this has been changed everywhzre (php, Browsers, ...) to not have trouble anymore...

luisuriarte commented 10 months ago

Thank you very much for taking care. For more than 15 years it has been America/Argentina/Buenos_Aires. I have no option but to use NON-Chromium browsers