orangehrm / orangehrm

OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures all the essential functionalities required for any enterprise.
GNU General Public License v3.0
746 stars 537 forks source link

Issues in 5.5 after fix #1500, #1517 #1729

Closed microservice-tech-nicolas closed 10 months ago

microservice-tech-nicolas commented 10 months ago
          Fix for #1500, #1517

_Originally posted by @RajithaKumara in https://github.com/orangehrm/orangehrm/pull/1530#discussion_r1020301132_

Hi, I am new and trying to get started with the development environment. But I am running against some issues.

I used this guide for setting up my dev environment: https://github.com/orangehrm/orangehrm-os-dev-environment/wiki/How-to-setup

I used this guide to install the environment (using git clone): https://github.com/orangehrm/orangehrm/wiki/5.x-development-guide

I encountered the same issue in version 5.5. After a clean install in dev environment this error popped up at first load.

Screenshot 2023-07-31 213104

Screenshot 2023-07-31 213334

During installation this showed, don't know if this is related:

Screenshot 2023-07-31 215439

` [01-Aug-2023 07:57:08 Pacific/Auckland] PHP Fatal error: Uncaught TypeError: Return value of OrangeHRM\I18N\Service\I18NService::getETagByLangCode() must be of the type string, null returned in /var/www/orangehrm/src/plugins/orangehrmI18NPlugin/Service/I18NService.php:273 Stack trace:

0 /var/www/orangehrm/src/plugins/orangehrmI18NPlugin/Service/I18NService.php(238): OrangeHRM\I18N\Service\I18NService->getETagByLangCode('en_US')

1 /var/www/orangehrm/src/plugins/orangehrmI18NPlugin/Service/I18NService.php(334): OrangeHRM\I18N\Service\I18NService->getTranslationMessagesSourceTargetArray('en_US')

2 /var/www/orangehrm/src/plugins/orangehrmI18NPlugin/Service/I18NHelper.php(63): OrangeHRM\I18N\Service\I18NService->transBySource('Auth', Array, 'en_US')

3 /var/www/orangehrm/src/plugins/orangehrmCorePlugin/Helper/VueControllerHelper.php(257): OrangeHRM\I18N\Service\I18NHelper->transBySource('Auth')

4 /var/www/orangehrm/src/plugins/orangehrmCorePlugin/Helper/VueControllerHelper.php(147): OrangeHRM\Core\Helper\VueControllerHelper->getBreadcrumb()

5 /var/www/orangehrm/src in /var/www/orangehrm/src/plugins/orangehrmI18NPlugin/Service/I18NService.php on line 273

`

Super-Chama commented 10 months ago

@microservice-tech-nicolas can you examine the etag header sent in the first request?

microservice-tech-nicolas commented 10 months ago

@microservice-tech-nicolas can you examine the etag header sent in the first request?

Thanks for following up. I reinstalled the application to trace down the Etag header. It is present on the final call after completing the installation.

Screenshot 2023-08-01 154725

But missing on every call after that (some redirection occurs).

Screenshot 2023-08-01 154918

Super-Chama commented 10 months ago

I'm not sure as why this is happening for you but since you're in a development environment, you can edit the getETagByLangCode function and hardcode a string for now. (not recommended for production application) https://github.com/orangehrm/orangehrm/blob/15a58279bf3978b9be6d18bf731eaa653e3185c6/src/plugins/orangehrmI18NPlugin/Service/I18NService.php#L262 Hope someone will provide you more helpful insight

microservice-tech-nicolas commented 10 months ago

I've installed the dev environment on a server and all seems to be working.

I was running the container through wsl on windows and developed through my IDE. Problems kept persisting. I suspect a racing condition in the file transfer between wsl and windows itself. When running in ubuntu all is working.

@Super-Chama Thank you for the help

Super-Chama commented 10 months ago

@microservice-tech-nicolas glad to hear your issue was resolved it was a tricky one. I'll close this issue for now but we'll keep lookout for WSL issues in our dev environment.