News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

repair_settings appears to work, database doesn't update

Started by nc3man, March 21, 2023, 09:47:11 PM

Previous topic - Next topic

Sir Osis of Liver

Wasn't there a version of repair_settings where restore settings undid any changes that were made before saving?  Oldest one I can find is from 2017, but it's not original, I had modded the buttons.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

nc3man

One last note to explain why I was skeared to hit "Restore all settings" in the first place, For someone who doesn't know the underlying plumbing and sequence of events in repair_settings.php, this sounds like a direct action on the database, not simply displaying things on the screen. I hardly ever "restore settings" for most apps anywhere (software, phone, TV, my bike computers, my home router, etc.) when I've taken considerable time to configure them myself.

nc3man

Quote from: Sir Osis of Liver on March 22, 2023, 08:48:38 PMWasn't there a version of repair_settings where restore settings undid any changes that were made before saving?  ...
Yes, an "Undo Changes" button might be handy, although once you are familiar with the tool and understand the DB hasn't been touched at all until you press Save, you can just quit the tool and reload. I still like the idea of "Apply recommendations to URLs and Paths" only as that seems to be most crucial once the DB is connected. Also, for our use case, it is completely safe as it won't try to "localhost" our server.

Sir Osis of Liver

I've never used the restore settings button to apply changes, been clicking on recommended settings one at a time since repair_settings was changed.  Granted I'm not sharpest knife in the drawer, but this obviously has been a pia for others as well.  Yet another instance where older was better.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kindred

Undo changes assumes that the original values are stored somewhere... which is not part of repair_settings.php
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

nc3man

Quote from: Kindred on March 23, 2023, 10:56:40 AMUndo changes assumes that the original values are stored somewhere... which is not part of repair_settings.php
Assuming the user hasn't pressed "Save" I was only referring to resetting the grid to the initial state, meaning recommendations come from the current Settings.php + a few guesses, and the values comes from loading the database that is referenced. Same thing as exiting repair_settings and re-loading. And, if a Save had been pressed prematurely, it would simply set the state at the last Save.

nc3man

A quick review of the code looks like the action for an Undo Changes button would be to simply invoke the function initialize_inputs(). If that doesn't work because of unexpected interaction with the globals' state, the user should just exit and reload.

Advertisement: