Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
upper case letter in the database/company name .....
01-08-2014, 07:53 PM,
#41
RE: upper case letter in the database/company name .....
Phil, I notice that despite two promises, one on this forum, and one on the mailing list you have still not applied this bug fix. Am happy to apply it myself if you give me the access

Tim
Reply
01-10-2014, 12:06 AM,
#42
RE: upper case letter in the database/company name .....
It seems that this simple and obvious bug is still awaiting the fix applying, so let us try again.
This is nothing to do with who wrote the code, the line is well intentioned but in this case wrong, but we all make mistakes sometimes.
Everybody agrees that where table names, and field names are hard coded into webERP then we should keep them all lower case, so that if in future we enable a DBMS that doesn't like lower case then the code should just work. In fact I have tried hard (but so far failed) to persuade people here of the benefit of using standard ANSI sql for this purpose.
However this bug has nothing to do with avoiding hard coded upper case characters. Throughout the last decade webERP has allowed those using mysql to have upper case characters in their database name. With the latest release those who chose this option now find on upgrade their webERP throws an error saying

"ERROR Message Report : You do not seem to have a database
configured correctly to use with webERP. Check you database exists and there
is a corresponding directory in the 'companies' directory of the same name.
Contact your system administrator for assistance."

Not helpful... The reason for this is that webERP stores the database name in a session variable. The line in includes/ConnectDB.inc changes this value to all lower case. Now if the database name is all lower case nothing happens, but if it contains one or more upper case characters then the value of this session variable is changed to something that is not the database name in use.

Now if we want to restrict the installer to only install lower case DB names (can't it be done on a per DBMS basis? ie only restrict if the chosen DBMS does not allow upper case?) then that would be one thing. However this bug causes webERP implementations that have worked fine for a decade to suddenly crash. It does seem a bit of a no brainer to fix it, or am I missing something?

If the user wants to transfer to postgres at a later date, then actually changing the case of their DB name would be the least of their problems Smile
Reply
01-10-2014, 09:56 PM,
#43
RE: upper case letter in the database/company name .....
This bug fix has now been applied by Phil.

Thanks very much for doing this Phil!

I will start a new thread for the next bug fix I have, lets hope it doesn't take quite so much time and effort for the next one Smile
Reply
02-10-2014, 08:01 PM,
#44
RE: upper case letter in the database/company name .....
I finally got to looking at this and it seems to me that:

1. We should allow database names with upper and lower case characters (as well as some special characters)

2. The directory was meant to be all lower case to prevent problems that occur when using case/non-case sensitive operating systems, but also for some SCM software which can also get confused with upper/lower case file names.

Looks like originally from some time back the there was some contradiction in code allowing upper/lower case in some parts but only lower case in other for database name.

However there would have been a typo when creating and saving the database named directory - that should have been lower case to prevent the operating system/SCM software issues that might arise.

While the code now works, it doesn't implement the above logic but rather just allows upper and lower case database names and creates a file directory of the same.

I'm not sure wether we want to correct this or not now.
We would have to allow for the older installs or newer once since the logic changed again - where upper/lower case names have been allowed and maybe check for this as a last option in the connect function.

Thanks,
Reply
02-10-2014, 10:04 PM,
#45
RE: upper case letter in the database/company name .....
Hi Jo, AFAIK the code has always been consistent in allowing upper and lower case characters in the database name. There is no problem in future with enforcing new databases to be lower case, the problem was that this change affected databases that already existed, and broke those implementations.

If the database exists, and the directory exists, and the two have the same name then the user should be able to continue. I don't see why webERP should block them, but this wasn't the case, and webERP blocked access.

Again AFAIK there is no problem at the OS level as we use PHP functions to do any of the work.

It is the same with the illegal characters thing. IMHO I don't see that we should be telling people what characters they can use in their company name, or their customers and suppliers can use. If problems exist with particular characters we should solve those problems rather than just block users.

Thanks
Tim
Reply
02-10-2014, 10:20 PM,
#46
RE: upper case letter in the database/company name .....
(02-10-2014, 10:04 PM)Forums Wrote: Hi Jo, AFAIK the code has always been consistent in allowing upper and lower case characters in the database name.
I did note when I first went into the code that in some places it forced lower case for database name, but not on the last 'new' install which was not checked. It is now i think.
Quote:There is no problem in future with enforcing new databases to be lower case, the problem was that this change affected databases that already existed, and broke those implementations.
This wasn't the problem here or at least what I was talking about. I would not want to enforce lower case in database names either. They should be allowed to have upper case and lower case and special characters as is allowed now (I think - not tried lately on install).

This bug was really about creating the company file directory during install - the issue was there. The check for lower case in connect db would have been correct had it not been for the typo in install that created that directory.The later check in connect db should also have checked for 'old' installs if they did indeed allow upper and lower case file directory names at some point.
Quote:If the database exists, and the directory exists, and the two have the same name then the user should be able to continue. I don't see why webERP should block them, but this wasn't the case, and webERP blocked access.
Yes, I know what the bug was - there was a check for lower case on the directory file name. This would have been correct - but the typo was in the directory creation during company creation which was meant to create a lower case directory file name so that it did not cause issues between case sensitive/non-case sensitive operating systems, and some SCM that also have the same case issue and need lower case file directory names.
Quote:It is the same with the illegal characters thing. IMHO I don't see that we should be telling people what characters they can use in their company name, or their customers and suppliers can use. If problems exist with particular characters we should solve those problems rather than just block users.
I don't either, I agree with you but while it seemed to be an issue in the past (when i first started usingwebERP with some code contradiction - and maybe later i can't recall) that was not the issue in this case. It was the issue of file system name.

Cheers,

Reply
02-10-2014, 11:58 PM,
#47
RE: upper case letter in the database/company name .....
Hi Jo,

It may have been in the old installer, but there was no contradictory code in webERP itself up until the change to the connectdb file. It should be remembered that until 2008 or 2009 there was no installer at all, and all installations were done manually so that any characters that were allowable in the DB name and the directory name were being used. Even after that date there was a lot of installations being done manually, and I imagine there still are. This has to be taken into account by developers as they cannot guarantee that things that are enforced in the installer will be in all installations.

All I had been saying throughout this thread was that the change to connectdb had unwittingly broken a number of existing installations, and I suggested a fix for the problem that sorted it. For some reason this turned into a bigger deal than it should as there was reluctance to admit the problem existed. However it has now been fixed.

For my understanding can you elaborate on the OS and SCM issues you mention?

Thanks
Tim
Reply
02-11-2014, 12:13 AM,
#48
RE: upper case letter in the database/company name .....
Hi Tim,
(02-10-2014, 11:58 PM)Forums Wrote: It may have been in the old installer, .... ... I had been saying throughout this thread was that the change to connectdb had unwittingly broken a number of existing installations, and I suggested a fix for the problem that sorted it. For some reason this turned into a bigger deal than it should as there was reluctance to admit the problem existed. However it has now been fixed.
Yes I understand what you were saying. It worked for what you meant it to do, that was good.

What I was saying was, the fix applied was OK for the immediate symptom, but the actual bug in this case of the logic I explained above, was a problem in the installer - ie the installer created a directory with upper and lower case names instead of the intended lower case. This was part of the installer rewrite. The case of the database was irrelevant really to the actual bug I'm talking about. The connect db code was in fact therefore correct and supposed to ensure it lower case in the file system. The error was in the installer. I was asked to look at this a while back but some issues have delayed me this last month or so, and this post is just a response to that, no more.

Irrespective of that, if there is any fix put in place now or wanted to support the logic I posted about, it would have to also do a final check for 'old' upper/lower case file system directories. I don't mind what is decided , I've adjusted my custom repo for this but I can adjust the main repo code if you need.

Cheers,
Reply
02-11-2014, 03:42 AM,
#49
RE: upper case letter in the database/company name .....
Hi Jo, sorry I am clearly being a bit slow here, but I don't see the bug that you mention. Can you clarify for me?

I'm not sure why the installer should be bothered about the case here, but if we do use the installer to enforce case then we must allow for the legacy installations to work. Also for those who choose to not to use the installer. That was the issue with the change in connectdb script, as it broke these older installations. As I say I may be being slow but connectdb seems the totally wrong place for this.

Thanks
Tim
Reply
02-11-2014, 11:12 AM,
#50
RE: upper case letter in the database/company name .....
Hi, all,

The company name can be any form of alphanumeric and other characters instead of English characters. And there is no upper and lower case constrain for the database name now.

I have no idea of bugs about the file directory. It'll be highly appreciated for any information about this.

Best regards!

Exson
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)