meeting-room-booking-system / mrbs-code

MRBS application code
Other
124 stars 61 forks source link

Problems upgrading from 1.7.1 to 1.7.3 #2527

Open jberanek opened 5 years ago

jberanek commented 5 years ago

Hi, I'm trying to upgrade my MRBS from 1.7.1 to 1.7.3. I overwrote my files with the last version except for the config files (config.inc.php, custom.css, lang.es, and styling.inc). But when access to the url, it sends me the following errors:

E_USER_NOTICE in mrbs/web/language.inc at line 826
Server failed to set locale to 'es_.UTF-8'

E_USER_WARNING in mrbs/web/init.inc at line 67
MRBS: session table does not exist
MRBS GET: Array
(
)
MRBS POST: Array
(
)

E_USER_WARNING in mrbs/web/init.inc at line 79
Could not start DB sessions, trying ordinary PHP sessions. Note that this error will normally only occur if the sessions table doesn't exist, which will be the case when upgrading to database schema version 56. If it happens at any other time then something has gone wrong and it should be investigated.
MRBS GET: Array
(
)
MRBS POST: Array
(
)

E_WARNING in mrbs/web/init.inc at line 84
session_start(): Cannot send session cache limiter - headers already sent (output started at mrbs/web/functions_error.inc:62)
MRBS GET: Array
(
)
MRBS POST: Array
(
)
MRBS SESSION: Array
(
    [csrf_token] => 995969e711cc8030ba5db9860f5c7a359731a1daf5b34aad4acb5df09b9f441d
)

E_WARNING in mrbs/web/functions.inc at line 214
Cannot modify header information - headers already sent by (output started at mrbs/web/functions_error.inc:62)
MRBS GET: Array
(
)
MRBS POST: Array
(
)
MRBS SESSION: Array
(
    [csrf_token] => 995969e711cc8030ba5db9860f5c7a359731a1daf5b34aad4acb5df09b9f441d
)

E_WARNING in mrbs/web/functions.inc at line 201
Cannot modify header information - headers already sent by (output started at mrbs/web/functions_error.inc:62)
MRBS GET: Array
(
)
MRBS POST: Array
(
)
MRBS SESSION: Array
(
    [csrf_token] => 995969e711cc8030ba5db9860f5c7a359731a1daf5b34aad4acb5df09b9f441d
)

E_WARNING in mrbs/web/functions.inc at line 202
Cannot modify header information - headers already sent by (output started at mrbs/web/functions_error.inc:62)
MRBS GET: Array
(
)
MRBS POST: Array
(
)
MRBS SESSION: Array
(
    [csrf_token] => 995969e711cc8030ba5db9860f5c7a359731a1daf5b34aad4acb5df09b9f441d
)

I tried to upgrade from 1.7.1 to 1.7.2 but same errors. Could you please give me a hint of what could be posible wrong?

Reported by: *anonymous

Original Ticket: mrbs/support-requests/1828

jberanek commented 5 years ago

There are two separate problems:

(1) The "failed to set locale" problem. What are your browser language preferences (see the Help page)? And if you have $override_locale set what is it set to?

(2) The "Could not start DB sessions" problem. It looks like you don't have all the files uploaded properly, because those line numbers do not correspond to the 1.7.3 version of init.inc. Try uploading all your files again.

By the way, you should not edit lang.es, but instead use the $vocab_override config setting, eg

$vocab_override['es']['mrbs'] = 'Your text in here';

Original comment by: campbell-m

jberanek commented 5 years ago

Thanks for your response Campbell.

(1)My browser language is spanish. I dont have $override_locale in my config file and don't see it on config.inc.php-sample either, that variable should be set to what? ='es';

(2)Those files were from the test of upgrading 1.7.1 to 1.7.2, I tried again with 1.7.3, I already made the changes with $vocab_override for not touching lang files. But the errors are more less de the same:

E_USERNOTICE in mrbs/web/language.inc at line 826 Server failed to set locale to 'es.UTF-8'

E_WARNING in mrbs/web/init.inc at line 90 SessionHandler::read(): Cannot send session cookie - headers already sent by (output started at mrbs/web/functions_error.inc:62) MRBS GET: Array ( ) MRBS POST: Array ( ) MRBS SESSION: Array ( )

E_WARNING in mrbs/web/init.inc at line 90 session_start(): Cannot send session cache limiter - headers already sent (output started at mrbs/web/functions_error.inc:62) MRBS GET: Array ( ) MRBS POST: Array ( ) MRBS SESSION: Array ( )

E_WARNING in mrbs/web/functions.inc at line 214 Cannot modify header information - headers already sent by (output started at mrbs/web/functions_error.inc:62) MRBS GET: Array ( ) MRBS POST: Array ( ) MRBS SESSION: Array ( [csrf_token] => 56620fbfbe7b8a1693ec22ffe1c16d7f206fc7e05b4cd4381a3cdd62041393c9 )

E_WARNING in mrbs/web/functions.inc at line 201 Cannot modify header information - headers already sent by (output started at mrbs/web/functions_error.inc:62) MRBS GET: Array ( ) MRBS POST: Array ( ) MRBS SESSION: Array ( [csrf_token] => 56620fbfbe7b8a1693ec22ffe1c16d7f206fc7e05b4cd4381a3cdd62041393c9 )

E_WARNING in mrbs/web/functions.inc at line 202 Cannot modify header information - headers already sent by (output started at mrbs/web/functions_error.inc:62) MRBS GET: Array ( ) MRBS POST: Array ( ) MRBS SESSION: Array ( [csrf_token] => 56620fbfbe7b8a1693ec22ffe1c16d7f206fc7e05b4cd4381a3cdd62041393c9 )

Thanks in advance.

Original comment by: *anonymous

jberanek commented 5 years ago

OK, I think you just have one problem, the "failed to set locale" problem. The other problem is caused by the first error message being sent to the browser.

There is no need to set $override_locale, so don't worry about that. Can you copy and paste here please exactly what it says on the Help page about your browser language preferences?

I already made the changes with $vocab_override for not touching lang files

Good. In which case you should overwrite the lang.es file as the lang files change between releases. (You originally said you didn't overwrite that file). Incidentally you should as a general rule also update styling.inc and then re-apply any changes you made, but in this case I don't think it matters as I don't think there were any changes between 1.7.1 and 1.7.3.

Original comment by: campbell-m

jberanek commented 5 years ago

Dear Campbell, I'm not sure if the screenshots of the language preferences of both browsers I'm testing mrbs (Chrome and Firefox) is the info you're asking me. Please let me know and thanks again for your help.

As for the lang.es, yes, I already tried with the original one. And the styling. inc, I just checked the differences and is just a matter of one changing color in $color_types.

Original comment by: *anonymous

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/062f48cad9/16bf/attachment/chrome.PNG https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/062f48cad9/16bf/attachment/firefox.PNG

jberanek commented 5 years ago

Thanks. What I need is the language preferences as reported by MRBS. Go to the MRBS Help page and it will tell you.

Original comment by: campbell-m

jberanek commented 5 years ago

It's OK. I can reproduce the problem now. I'll work on a fix.

Original comment by: campbell-m

jberanek commented 5 years ago

I understand the problem. It is caused by a bug in MRBS which I will fix over the next few days. The problem is that MRBS doesn't handle properly the language preference 'es-419' , which is what your browser will send to MRBS if you have selected "Spanish - Latin American" or "Spanish - Mexican".

I will need to think about how to fix this properly. In the meantime you can get round the problem by setting in your config file

$override_locale = 'esm';  // if you have a Windows server
$override_locale = 'es_MX.utf-8';  // if you have a UNIX server

The disadvantage of using $override_locale is that dates, etc. will always appear in Spanish, even if a user has their browser set to another language as first preference. But maybe all your users will want Spanish anyway, so that won't be a big problem.

I will let you know when I have got a proper fix.

Original comment by: campbell-m

jberanek commented 5 years ago

Dear Campbell,

Yes!! I did the workaround with $override_locale and that fix the problem.
I am sorry I didn't understood correctly your request, but this is what my MRBS Help page says, if that could help your future fixes:

Acerca de MRBS Sistema de Reservas de Salas y Aulas MRBS 1.7.3 Su navegador está configurado para usar los siguientes juegos de caracteres: es-, es

Ayuda Contacte con Administrador para cualquier duda.

Thanks a lot for your help. Grettings from Mexico.

Original comment by: *anonymous

jberanek commented 5 years ago

I've now fixed this in the 1.7 (b6347c) and default (13c7de) branches.

Here's a new version of language.inc attached which should work with your MRBS 1.7.3 system and enable you to remove the $override_locale setting.

Original comment by: campbell-m

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/062f48cad9/3902/attachment/language.inc

jberanek commented 5 years ago

See also https://sourceforge.net/p/mrbs/patches/87/.

Original comment by: campbell-m