# [SOLVED] Dokuwiki some functionality broken after failed tinkering



## -WOLF-

Hi there.

I wanted to get rid of the inability to have spaces in pagenames as it looks unprofessional. 

since it was rather close to my Anteater Dokuwiki so I thought would be able to perform the tricks provided.

However, altering the template.php with nothing other than


Code:


require_once(DOKU_INC.'hacks/nicetitle.php'); //brings in function nicetitle()
  $name = nicetitle($id); //nicetitle() will replace underscores "_" by " "

 then creating a file within the path /hacks/nicetitle.php and inputting the following


Code:


function 

nicetitle($id) {
    $result = preg_replace("/_/"," ",$id);
    if ($result) {
        return($result);
    }
    else {
        return($id);
    }
 }

 yielded a completely nonfunctional wiki. 

That's fine, I fixed the problem by copying the template.php from an older version of my wiki (still same Dokuwiki, just dissimilar pages) and replacing the current one with that version.

Now, however, the admin, recent changes and old revisions options are nonfunctional. When I attempt to use such features I get the following:


Code:


Fatal error: Call to a member function int() on a non-object in K:\dokuwikistick-2010-11-07a\DokuWikiStick\dokuwiki\inc\template.php on line 121

for revisions;


Code:


Fatal error: Call to a member function str() on a non-object in K:\dokuwikistick-2010-11-07a\DokuWikiStick\dokuwiki\inc\template.php on line 245

 for admin; 

and


Code:


Fatal error: Call to a member function extract() on a non-object in K:\dokuwikistick-2010-11-07a\DokuWikiStick\dokuwiki\inc\template.php on line 127

 for recent changes.

Keep in mind I did this overnight and didn't think of keeping an actual backup of my wiki until after the fact. 

Please help me get at least the admin panel back.

note: i posted this issue on dokuwiki's forums many days ago and have gotten no response. I'd like some assistance with it, if at all possible, please.


----------



## Fjandr

*Re: Dokuwiki some functionality broken after failed tinkering*

Are you using the current version? If so, you should be able to download the installation files and get another copy of the borked file.

If not, have you looked for a copy of the installation which matches your version?

Are you using add-ons? (I'm not familiar with DocuWiki, so this may not be applicable)


----------



## -WOLF-

*Re: Dokuwiki some functionality broken after failed tinkering*

Well, see, that's the funny thing. I replaced the offending file - template.php - with the one from my non-mobile copy. That one and my mobile copy run the same version of Dokuwiki so it should have identical template files. I have several plugins but all were tested prior and worked fine, it wasn't until I applied my 'hack' that this happened. It's strange that when I reverse the changes, functionality is broken.


----------



## Fjandr

*Re: Dokuwiki some functionality broken after failed tinkering*

I would suggest backing up the installation, re-installing, and then transferring the data back into the new installation. Unless it's a heavily-modified version, it'll likely take you less time than tracking down the offending changes.

If you really want to fix it manually, the first place to start is looking for identical function calls or variable uses in the lines mentioned, as well as the line immediately before each.


----------



## -WOLF-

*Re: Dokuwiki some functionality broken after failed tinkering*



Fjandr said:


> I would suggest backing up the installation, re-installing, and then transferring the data back into the new installation. Unless it's a heavily-modified version, it'll likely take you less time than tracking down the offending changes.
> 
> If you really want to fix it manually, the first place to start is looking for identical function calls or variable uses in the lines mentioned, as well as the line immediately before each.


That actually worked perfectly. I feel silly not having thought of that now, it seems obvious!

Thanks.


----------



## Fjandr

Quite welcome, happy to help.


----------

