ElkArte Community

Project Support => Support => Topic started by: CrimeS on June 04, 2016, 04:30:22 am

Title: Repair settings doesn't work
Post by: CrimeS on June 04, 2016, 04:30:22 am
I've downloaded the latest repair_settings.php from GitHub and the following error welcomes me to fixing my paths:

Code: [Select]
Fatal error: Uncaught Error: Call to undefined function database() in C:\xampp\htdocs\sc\forum\repair_settings.php:122 Stack trace: #0 C:\xampp\htdocs\sc\forum\repair_settings.php(37): action_show_settings() #1 {main} thrown in C:\xampp\htdocs\sc\forum\repair_settings.php on line 122

I know that I can fix the paths myself, but what if someone's forum needs fixing paths and the tool itself isn't working.

Line 122:
Code: [Select]
$db = database();

The connection to database is working (the forum loads and operates fine, localhost xampp). There is no password for the database user, perhaps that's an issue with addition to localhost?



I managed to fix it by changing paths in Settings.php to closest as they should look, after that the tool started working and is able to fix all the paths. A little weird though that it wouldn't work straight out of the box.
Title: Re: Repair settings doesn't work
Post by: emanuele on June 05, 2016, 03:22:21 am
/me feels repair_settings has not been touched in ages... ::)
Title: Re: Repair settings doesn't work
Post by: ahrasis on June 05, 2016, 05:19:55 am
So far it is working for me all the time (except for languages path).
Title: Re: Repair settings doesn't work
Post by: emanuele on June 05, 2016, 05:52:31 am
I feel it doesn't work if it cannot find a working database connection.
Title: Re: Repair settings doesn't work
Post by: Antechinus on June 05, 2016, 06:35:16 am
Had exactly that problem the other day.
Title: Re: Repair settings doesn't work
Post by: ahrasis on February 05, 2017, 02:35:26 am
I already updated some of the code and now attempting to upgrade it based on the code here (https://raw.githubusercontent.com/SimpleMachines/tools/master/repair_settings.php), if possible. The reason is it is not working for me for 1.1 and it might be useful for other 1.1 users, especially when upgrading may cause some errors which requires some settings to be fixed etc.

I have done it half way, and will continue after further this but I intend to attach it here just in case I got busy or somehow forget to continue with it. Note that this is NOT finished.

There is some note on whether to delete or modify some of the code as they made it for three version while we only have two. Whatever are already good from current version are re-used into this new version.

(Link-4469)
Title: Re: Repair settings doesn't work
Post by: badmonkey on February 05, 2017, 10:01:30 am
Thanks for this.  It will be helpful for sure!
Title: Repair settings languages path
Post by: sherif on February 11, 2017, 10:51:27 am
Quote from: ahrasis – So far it is working for me all the time (except for languages path).
@ahrasis thank you so much
regarding the above error you mentioned as quoted , it still happening for me
(Link-4508)
 so is there any info about the reason for it , how to fix manually until the tool get some last fix , or if this error is fake and not affecting the forum at all since the folder exist and the language is fine ?
thank you again  :)
Title: Re: Repair settings doesn't work
Post by: Spuds on February 11, 2017, 12:25:47 pm
@ahrasis why did you start with the SMF version of the tool and not the ElkArte 1.0 version http://tools.elkarte.net/2014/12/repair_settings/

Are there some new features that need to be added or was it just that broken on 1.1 or am I just misunderstanding?


Title: Re: Repair settings doesn't work
Post by: ahrasis on February 12, 2017, 12:40:06 am
No. I merely suggested it and I am still using EA version but I just was looking if there is a new thing that could be useful to us especially the version recognition as far EA repair can only work on 1.0 but not 1.1. So may be, instead of creating a new file for it, just use something similar to check the version before we proceed.

Besides, my PR is the EA version right? If not I am might be posting a wrong file then. :(
Title: Re: Repair settings doesn't work
Post by: Spuds on February 12, 2017, 08:50:30 am
Your PR's have been to the correct file  :)   I just wanted to make sure I was not missing something.  It looks like a couple of things have been added that may be indeed be useful that we should consider.
Title: Re: Repair settings doesn't work
Post by: Spuds on February 14, 2017, 01:20:36 pm
Here is an updated version  repair_settings.php  (41.07 KB) which should work on 1.0.x and 1.1

And a minor update since I used the wrong case on a directory :(

Title: Re: Repair settings doesn't work
Post by: ahrasis on February 14, 2017, 05:41:03 pm
Great work there @Spuds. It is working great so far for in my 1.0 and 1.1. Good looking UI, better than.

Only one thing I tried didn't work for 1.0.x that is enabling the cache. I think it will go back to off though you have selected on and save.
Title: Re: Repair settings doesn't work
Post by: Spuds on February 14, 2017, 07:02:08 pm
Thanks :D ... I'll take a look at the cache issue.
Title: Re: Repair settings doesn't work
Post by: sherif on February 19, 2017, 07:22:59 pm
First , thank you @Spuds for a great job
tried it on my xampp localhost test forum , i have already downloaded it from my test live site with the older paths
The tool kept giving error on start about wrong sources path
nothing worked until i manually changed ONLY the sources path to the local one
Code: [Select]
D:\xampp\htdocs\elkarte\sources

and the tool worked just fine for me,

I can also confirm the cache setting problem mentioned by @ahrasis  , its always ON in my case
switching OFF and saving doesn't change it .

thank you all for keeping this tool improving

Edited to mention that the version is ElkArte 1.0.9
Title: Re: Repair settings doesn't work
Post by: Spuds on February 20, 2017, 10:26:52 am
Here is an update that should fix the cache issue and the sources discovery issue ... for testing
Title: Re: Repair settings doesn't work
Post by: sherif on February 21, 2017, 11:30:20 am
I tested the sources directory discovery issue , it is fixed now .
Switching the cache on/off settings , is fixed now.
great job :)

However , discovering the Cache Directory is working but not saving the correct path from "Paths & URLs" section Because :
there is a following setting in the "Cache Settings" section also named Cache Directory , which contains the older founded value , and has no "Recommended value" link, and not affected by the "Restore All Settings" button click , so if not manually modified before saving, will keep saving the older value.
Title: Re: Repair settings doesn't work
Post by: Spuds on February 21, 2017, 11:43:51 am
I thought I had moved that! .... must have missed committing it.

This should fix that issue.
Title: Re: Repair settings doesn't work
Post by: sherif on February 21, 2017, 11:09:31 pm
All fixed now , looks full functional to me now
Thank you for the great job and the quick responses
Title: Re: Repair settings doesn't work
Post by: sherif on February 23, 2017, 12:41:17 am
I hate to do this again ::) but this new thing came out from nowhere  :-[

the Attachment Directory discovery in the Paths & URLs section now says: No recommended value
Title: Re: Repair settings doesn't work
Post by: Spuds on February 23, 2017, 11:40:25 am
Its not going to necessary have a recommendation for that, depends on how you have set up attachments and if it can discover where they are.  If it can't it will not have a recommendation.
Title: Re: Repair settings doesn't work
Post by: emanuele on February 24, 2017, 12:02:22 pm
/me votes for having just 1 way to store the attachments and be happy with it.
Like 1 directory every 1000 attachments. O:-)
Title: Re: Repair settings doesn't work
Post by: Spuds on February 24, 2017, 12:05:19 pm
I actually like some of the options we have but only in the sense of backups.  It allows me to do incremental backups on the monthly but archive previous month or year ones.  That said I do agree what we have is a bit confusing and messy in many ways.
Title: Re: Repair settings doesn't work
Post by: emanuele on February 24, 2017, 12:55:49 pm
Well, the let's use the monthly separation. :P (And as extreme measure subdivision within month if we really want.)
Title: Re: Repair settings doesn't work
Post by: radu81 on February 24, 2017, 06:04:13 pm
Quote from: Spuds – I actually like some of the options we have but only in the sense of backups.  It allows me to do incremental backups on the monthly but archive previous month or year ones. 
When I set up my attachments settings I choosed the same setting (subdivided by years and months) for the same reason: backups. Well, I still need to setup an external backup, but that's another story ;)
Title: Re: Repair settings doesn't work
Post by: sherif on February 25, 2017, 09:21:46 am
Then there is nothing wrong with the repair tool , and it is leaving this attachment directory setting out of recommendations as a flexible setting , i like that .
So what happens to older attachments when forum admin decide to change the method for the management of the attachment directories  ::) ? just curious