HugoFara / lwt

Learn languages by reading! A language learning app stemmed from Learning with Texts (LWT).
https://hugofara.github.io/lwt/
The Unlicense
168 stars 19 forks source link

Misc. warnings #121

Closed HenryWales closed 1 year ago

HenryWales commented 1 year ago

After updating settings, I get:

Warning: Undefined array key "set-tts" in C:\xampp\htdocs\lwt\settings.php on line 104

After creating a new multi-term word using the "new term" button on top of a text page:

Warning: Undefined array key "query" in C:\xampp\htdocs\lwt\inc\session_utility.php on line 2980

HugoFara commented 1 year ago

Hi!

I tried to reproduce the warning following your description but unfortunately, nothing out of the ordinary happened (I got no warnings). Can you confirm that you are using LWT 2.8.1?

I also looked at the source code for "set-tts", maybe because it is a checkbox a warning appears. Can you replace line 100 of settings.php by


        saveSetting(
            'set-tts',
            (
                array_key_exists('set-tts', $_REQUEST) && 
                (int)$_REQUEST['set-tts'] ? 
                1 : 0
            )
        );

As I cannot reproduce the issue I must rely on you here!

As a side note, you can deactivate warnings in XAMPP settings if it's an issue for you, they are intended for developers anyway.

HenryWales commented 1 year ago

Yes I can confirm I'm using LWT 2.8.1.

For the second warning, my description was inaccurate. I only use the add term button for multi-words (as adding multi-words directly from the text box doesn't work like it should), but the warning is actually unrelated as any kind of word can be added.

Warning

I also looked at the source code for "set-tts", maybe because it is a checkbox a warning appears. Can you replace line 100 of settings.php by

The error is not triggered when using the replacement code.

HugoFara commented 1 year ago

Hi! Thank you for the image, I was able to reproduce and fix the bug. It came with LWT 2.8.0 when I changed the dictionary URL standard.

I'm also fixed the bug in the settings, thanks for your help!

I am finishing some work on the dev branch, and I should push everything to master by the end of the week!