Topic: Language select only check directory not for files.

I found out that when you got a directory in the lang directory it will be listed as a language in the options for profile, register and admin.

Normally you won't have empty dirs in lang but because i update my site trough a cvs. There is a directory CVS in lang.  The CVS dir will show up every where as a language option.

When you select the language that is actually a empty dir. PunBB will report that the language files are missing. But will update the user settings with the faulty language. Leaving the forum unusable for the user.

To correct the user profile direct edit in de db is then necessary.

Again this will affect very few users of punBB. The only normal example I can think of is when you de-install a language but forget to delete the language directory itself.

My idea to correct this would be to test for the correctness of the language before updating db. And to prevent for empty dirs showing up in the forum. There might be a need for a function that checks if all necessary files for a language are present.

Maybe not a real bug but something that could be addressed for a future version.

2 (edited by Smartys 2005-04-10 23:16)

Re: Language select only check directory not for files.

Orpheus wrote:

To correct the user profile direct edit in de db is then necessary.

I think there's an admin plugin to do that, and it's only one query wink

Orpheus wrote:

Again this will affect very few users of punBB. The only normal example I can think of is when you de-install a language but forget to delete the language directory itself.

Deleting the directory IS how you uninstall the language (along with changing the language of anyone who is using it).

Orpheus wrote:

My idea to correct this would be to test for the correctness of the language before updating db

You mean open every file and check that every variable is defined? Or just that all the necessary files exist (which doesn't mean the files couldn't be blank wink ).

It just really seems un-necessary: the only time a dir would be in there is if you put it there. wink

Re: Language select only check directory not for files.

Smartys wrote:
Orpheus wrote:

To correct the user profile direct edit in de db is then necessary.

I think there's an admin plugin to do that, and it's only one query wink

Orpheus wrote:

Again this will affect very few users of punBB. The only normal example I can think of is when you de-install a language but forget to delete the language directory itself.

Deleting the directory IS how you uninstall the language (along with changing the language of anyone who is using it).

Orpheus wrote:

My idea to correct this would be to test for the correctness of the language before updating db

You mean open every file and check that every variable is defined? Or just that all the necessary files exist (which doesn't mean the files couldn't be blank wink ).

It just really seems un-necessary: the only time a dir would be in there is if you put it there. wink

I know it's only one query ? That is not really the problem. And not everybody have plugins installed wink

And yes I know that deleting the dir would be the right way to deinstall a language . But there is allways the possibilty that you forgot to do so offcourse.

And yes I mean to check if each necessary files exist. Checking each variable would be overkill. The files can indeed still be blank but that would be a really great exception.

The function might be overkill. But checking if all necessary files are present before updating the database would be a good idea.

Re: Language select only check directory not for files.

Orpheus wrote:

And yes I know that deleting the dir would be the right way to deinstall a language . But there is allways the possibilty that you forgot to do so offcourse.

There is no other way to uninstall a language tongue

Re: Language select only check directory not for files.

Orpheus: I see your point. It actually happened to me as well (albeit with an svn directory). I will look into it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Language select only check directory not for files.

Fixed. I fiex it by making sure the directory contains a file called common.php. That should be enough.

"Programming is like sex: one mistake and you have to support it for the rest of your life."