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

Upgrading from 5.1 to 5.2 produces multiple errors in field labels. #1500

Closed J-Wick4 closed 1 year ago

J-Wick4 commented 1 year ago

I just upgraded, and most of the site is missing proper field labels.

Screen Shot 2022-10-19 at 7 30 04 PM

Unpacked the 5.2 folder, ran the wizard, selected upgrade from 5.1, and had all great checkmarks system check.

cholloSalvador commented 1 year ago

Same issue.

RajithaKumara commented 1 year ago

Hi @J-Wick4 , Did you unpacked OrangeHRM 5.2 into old OrangeHRM 5.1 folder? When upgrading it's recommended to backup and delete old version codebase and place new codebase in that location. Otherwise some files may conflicted. I guess here cache folder got conflicted with old cache folder.

There is a simple solution, can you run below command at the root of the orangehrm codebase;

php bin/console cache:clear
J-Wick4 commented 1 year ago

Hey @RajithaKumara, Yes, that's how I did the upgrade, using the new unpacked folder. I'll give it another try tomorrow and run your command. Thank you.

cholloSalvador commented 1 year ago

How to run command?

RajithaKumara commented 1 year ago

Hi @cholloSalvador , if you are the server administrator, login/ssh to the server. And locate the orangehrm application directory.

cd /path/to/orangehrm
php bin/console cache:clear
cholloSalvador commented 1 year ago

sorry I dont have any idea. Can you share me a sample video? Thanks

salmansiddiqui17 commented 1 year ago

I also tried a fresh installation but faced the same issue. I guess it's a bug.

salmansiddiqui17 commented 1 year ago

I executed php bin/console cache:clear but still same issue

image
RajithaKumara commented 1 year ago

Hi @salmansiddiqui17 , is it possible you to open developer tool network tab and provide more info like below screenshot;

Note I reproduce this by revoking write permission to src/cache directory

Screenshot from 2022-10-25 19-50-21

salmansiddiqui17 commented 1 year ago

@RajithaKumara Response is empty but status code is 304 not modified

Note: I have 777 permission on set on src folder

image image
Super-Chama commented 1 year ago

Hi @salmansiddiqui17 It looks like the response is fine. Can you change the language to English US (if not already) then check and using the developer tools, please confirm any console logs are displayed.

  1. Change Language to English US

    • Navigate to Admin -> Configuration -> Localization.
    • Change Language drop-down to "English (United States)".
    • Click Save.
    • Check if problem is resolved. image
  2. Confirm No Error Logs

    • After page is fully loaded press Ctrl + Shift + I to Open browser developer tools.
    • Select Console tab
    • Check if any errors are present. image
pbaranski commented 1 year ago

Hi, having the same problem. When loading in incognito first time it is ok. When reloading then bug appear. When local storage in browser is removed an reload applied then site looks fine until next request. This is server installation - locally it works fine. Guess some server dependencies.

Super-Chama commented 1 year ago

@pbaranski sorry to hear that. Language strings are cached in local storage from first request onwards. please check if your browser supports/allow local storage (by default this is enabled in chrome/firefox/safari) also additional information such as console logs and browser type,version is appreciated.

pbaranski commented 1 year ago

@Super-Chama Browsers are OK - tested on clean Chrome installation. Looks like hit to local storage is somehow broken

@salmansiddiqui17 @J-Wick4 @cholloSalvador Quick fix for that problem is turning off redirection: modify app file: \src\plugins\orangehrmI18NPlugin\Controller\I18NMessagesController.php comment if lines (add //) like below:


        // if (!$response->isNotModified($request)) {
            $response->setContent($this->getI18NService()->getTranslationMessagesAsJsonString($locale));
            $this->setCommonHeaders($response, 'application/json');
        // }
salmansiddiqui17 commented 1 year ago

@pbaranski localization language is already English (US). Here is the SS of the Console

image
salmansiddiqui17 commented 1 year ago

@pbaranski Thanks I'll try that.

pbaranski commented 1 year ago

@pbaranski localization language is already English (US). Here is the SS of the Console

image

I think this was addressed to @Super-Chama

SupperDog commented 1 year ago

@Super-Chama Browsers are OK - tested on clean Chrome installation. Looks like hit to local storage is somehow broken

@salmansiddiqui17 @J-Wick4 @cholloSalvador Quick fix for that problem is turning off redirection: modify app file: \src\plugins\orangehrmI18NPlugin\Controller\I18NMessagesController.php comment if lines (add //) like below:

        // if (!$response->isNotModified($request)) {
            $response->setContent($this->getI18NService()->getTranslationMessagesAsJsonString($locale));
            $this->setCommonHeaders($response, 'application/json');
        // }

This fix doesn't work for me.

kdy294 commented 1 year ago

Yeah I’m experiencing the same issue. It was a fresh install and everything was good to go. Just labels not appearing correctly or button labels.

mleader1 commented 1 year ago

It turned out the value stored in localStorage in browsers are having some issues @SupperDog

I solve it temporarily using the code below by appending into /web/dist/js/app.js


function languageFix() {
window.localStorage.setItem('"/RveX7hH7+0PZ5+FUVr/pX4WeN/w5Dn7zeeOwHWp+tA="', window.localStorage.getItem('W/"/RveX7hH7+0PZ5+FUVr/pX4WeN/w5Dn7zeeOwHWp+tA="'));
window.localStorage.setItem('core/i18n/messages','"/RveX7hH7+0PZ5+FUVr/pX4WeN/w5Dn7zeeOwHWp+tA="');
}

setTimeout(languageFix, 500);

It works neatly so far. I'm first timer in using OrageHRM, can't wait for for the proper fix and more feature releases!

Cheers

joelicatajr commented 1 year ago

@Super-Chama Browsers are OK - tested on clean Chrome installation. Looks like hit to local storage is somehow broken @salmansiddiqui17 @J-Wick4 @cholloSalvador Quick fix for that problem is turning off redirection: modify app file: \src\plugins\orangehrmI18NPlugin\Controller\I18NMessagesController.php comment if lines (add //) like below:

        // if (!$response->isNotModified($request)) {
            $response->setContent($this->getI18NService()->getTranslationMessagesAsJsonString($locale));
            $this->setCommonHeaders($response, 'application/json');
        // }

This fix doesn't work for me.

I am experiencing the same issue. New clean installation. This fix also doesn't work for me.

Thanks for your help with this one.

joelicatajr commented 1 year ago

Just a FYI for anyone else experiencing this problem. I wiped my install and deployed with 5.1 instead of 5.2 to resolve my issue since there doesn't appear to be a conclusive working fix I could find for 5.2.

RajithaKumara commented 1 year ago

This issue was fixed in OrangeHRM 5.3. Get the latest build here.

J-Wick4 commented 1 year ago

Everything is working for me now, thanks.