I've downloaded the latest repair_settings.php from GitHub and the following error welcomes me to fixing my paths:
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:
$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.
/me feels repair_settings has not been touched in ages... ::)
So far it is working for me all the time (except for languages path).
I feel it doesn't work if it cannot find a working database connection.
Had exactly that problem the other day.
Thanks for this. It will be helpful for sure!
@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 :)
@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?
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. :(
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.
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 :(
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.
Thanks :D ... I'll take a look at the cache issue.
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
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
Here is an update that should fix the cache issue and the sources discovery issue ... for testing
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.
I thought I had moved that! .... must have missed committing it.
This should fix that issue.
All fixed now , looks full functional to me now
Thank you for the great job and the quick responses
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
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.
/me votes for having just 1 way to store the attachments and be happy with it.
Like 1 directory every 1000 attachments. O:-)
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.
Well, the let's use the monthly separation. :P (And as extreme measure subdivision within month if we really want.)
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 ;)
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