Ahwxorg / LibreY

Framework and JS free privacy respecting meta search engine
GNU Affero General Public License v3.0
197 stars 26 forks source link

Settings don't "stick" after clicking save. #157

Closed rjc3rd closed 5 months ago

rjc3rd commented 5 months ago

An example is like this.

Go to the settings page and change a few of things. Theme - Light Disable Frontends - Checked Safe Search - Checked

Click save. You are taken back to start page and theme is correctly set to your new theme and I assume the frontends are disabled and safe search is on as you set them.

Don't make any searches yet though. You are still on the front page and all you've done is go to settings and make a few changes at this point.

Now go back to settings now for the second time, and sure enough the settings are still showing to be set the way you set them. Now don' make any changes here this time.

Click save, and again you are returned to the start page but the new settings are no longer set. You can tell initially that the theme is back to the default setting.

Plus if you go back to the settings a third time, you will see that all the setting you made are back to default settings.

Is this correct the expected and correct behavior?

rjc3rd commented 5 months ago

I think it's related to the conflict between settings.php and config.php when index.php is reloaded.

I'm still trying to reverse engineer it. I'm a hack though. So it's tough for me to figure it out. I thought I'd ask here.

rjc3rd commented 5 months ago

If you go first time and make changes but don't go back to settings, the setting do stick. I am able to search as many times as I like. Even if I leave the website and come back the settings are fine.

The problem only happens if you go back to the settings page, even if I don't actually make any changes. If I click save that second time, it reverts back to default.

Then I can go back and make the changes again just as if it was the first time again and it works again.

Not a deal breaker, but I'd like to solve it, if I can.

Ahwxorg commented 5 months ago

This is not expected behavior, I tried to reproduce it and it's the same on my instance.

Ahwxorg commented 5 months ago

I think it's related to the conflict between settings.php and config.php when index.php is reloaded.

I'm still trying to reverse engineer it. I'm a hack though. So it's tough for me to figure it out. I thought I'd ask here.

I'll wait for your findings! (partially because I have no clue how to debug this myself lol)

rjc3rd commented 5 months ago

I'm working on it today.

Ahwxorg commented 5 months ago

Closing as this is completed in your PR.