Something doesn't work at step 2.5

Events happening in the community are now at Drupal community events on www.drupal.org.
SpectralDart's picture
Start: 
2007-01-24 18:38 Etc/GMT

Hi, I tried the procedure again.. And after step 2.5, I never see my user logged in to the forums when trying a new user from drupal. I need to activate the module first in drupal and then make my modifications.. am I doing something wrong??

Comments

You are right, I had edited

arkepp's picture

You are right, I had edited away the activation of the module, which should happen at the end of step 2.3.

Still the same problem

SpectralDart's picture

I tried everything you wrote in the instructions.. Even tried mysqli.. But no matter what I do, I guess this error when I try to create an account :

Query failed: 0 INSERT INTO phpbb_users (user_id,username,username_clean,user_password,user_regdate,user_email,user_options,user_lang,user_timezone) VALUES(1005,'SpectralDart','SpectralDart','dc9aaec8e44ssffs4a7ddabd212baf2100',1188016653,'testl@gmail.com','853','en',-5)

And if I add the code I suggested, it goes fine but, I noticed that PHP doesn't create everything it should.. Which causes problems to edit permissions because the user is only entered in the PHPBB_USERS table and everything making reference to that user in other tables are missing..

Am I the only one exhibiting this problem?

Are Drupal and phpBB in the

arkepp's picture

Are Drupal and phpBB in the same database? Try running the exact same query through phpMyAdmin (cut'n'paste from the error above).

Drupal and PHPBB in the same DB

SpectralDart's picture

Yeah, both the drupal and phpbb tables are in the same DB. I'll try running the same command in phpmyadmin. Or from the admin tools for mysql. I'll let you know what comes out of it.

Are you running everything on a Linux system or windows?

I just found the problem

SpectralDart's picture

I don't know how I missed this.. was obvious.. I guess its been a long time I've done SQL.. phpAdmin was a little more thorough in giving me the information that was missing :

SQL query:

INSERT INTO phpbb_users( user_id, username, username_clean, user_password, user_regdate, user_email, user_options, user_lang, user_timezone )
VALUES ( 1005, 'SpectralDart', 'SpectralDart', 'dc9aaec8e44ssffs4a7ddabd212baf2100', 1188016653, 'testl@gmail.com', '853', 'en' , -5 )

MySQL said: Documentation

1046 - No database selected

INSERT INTO 'db'.phpbb_users, 'db' is the part that was missing (where 'db' is the name of your database). Now this is either a coding error or I'm missing something somewhere in my configuration. But at step 2.5, adding the extra step that was missing in your instructions (activating the phpbb module), and nothing more, that is what is causing the problem according to phpAdmin. So, I believe that adding the extra code that I gave you a few weeks ago might not be necessary but we'll have to try. I will actually make this little modification to the code to take into account my database and see if with the standard values it works.

Let me know if this is something that your fixed and that is missing in the code or if you think it might be a configuration issue.. That way we can add more information into the installation notes.

Thanks

I don't think that is it.

arkepp's picture

I don't think that is it. Try selecting the database in phpMyAdmin (so you see the structure in the right hand window) before going to the SQL tab.

There is a separate statement for selecting the database, both phpBB and Drupal do it when establishing the connection, neither of the programs include the database as a prefix in their statements, so all other queries would fail too.

You are right

SpectralDart's picture

I was doing something wrong, didn't have the right database selected. My bad. I tried it and I get this :


SQL query:

INSERT INTO phpbb_users( user_id , username , username_clean , user_password , user_regdate , user_email , user_options , user_lang , user_timezone )
VALUES ( 1008, 'test3', 'test3', '492d31bb95324fb3a3e234df16c4ebf5', 1188069837, 'test3@gmail.com', '853', 'en' , -5 )

MySQL said: Documentation

#1364 - Field 'user_permissions' doesn't have a default value

So, it comes back down to the problem I had initially. Those table entries I mentionned, they all need to be there. I don't know how you got it to work without adding those table entries in your query. What version of mysql are you using?

By the way, you said you added the modifications but when I downloaded the phpbb.tgz from your site, those changes were not there. Maybe you updated the data somewhere else?

Okay, now we are getting

arkepp's picture

Okay, now we are getting somewhere. That error message is consistent with everything that has come up so far, and easy to understand.

I wrote I did NOT add your patch because it made no sense to me, my database had those default values + there are lots of other fields that should have the same problem.

I am using various minor versions of MySQL 5.x. If you are using 3.x, could you try to find out whether there is a bug in the corresponding install script for phpBB? It's bad form to not set default values for fields that cannot be null.

phpBB3 rc4 user creation is ok

SpectralDart's picture

I tried it and I have no errors creating a user with phpbb if that is what you meant.. I looked at the code for phpbb and there are many variables that have empty values and that are being passed during the creation process which is what we are missing in the phpbb module.

There is a reason why you can do it and I can't.. I am sure I am not alone with this problem and I doubt you are the only one having success.. We need to find out what the reason is otherwise this could be a problem that will come back. The only way I have found to fix it, is by adding the same variables that are supposed to be set just like in the phpbb3 user creation function.

But I do agree that if a table has been set to not allow any nulls, there shouldnt be any.. I don't think that in the phpbb3 code there is any case of that.. I looked at it. But it is still weird to me that it works for you... I wonder what is different..

Well, I'll repeat my

arkepp's picture

Well, I'll repeat my question a bit more pointedly: Why does your table not have default value? I suspect the answer is in the installation scripts, since those are the only ones that modify the phpBB database structure.

phpBB installation scripts?

SpectralDart's picture

You mean the phpbb installation scripts? I guess some of them are left empty for the admin to set them later or depending on how you want to set your forum.. Then, the difference is there.. You setted your forums already with defaults and it works for you but with the standard installation (RC5 is out by the way), it doesn'T work.. I did no modifications except installing drupal and phpbb3 and added the phpbb module.

No defaults for user_permissions

SpectralDart's picture

Ok, looking at the phpbb_users, column user_permissions, I don't have any defaults there.. And that is what is causing the problem because its not allowing null. After I installed phpbb, I didnt change anything. So.. There must be a place where I can set those defaults that I havent seen in the admin page of the phpbb. Anyways, as far as I am concerned, that is a bug on the phpbb side, but it forces us to plan for it.. Wouldn't you agree?

Please look at my comment

arkepp's picture

Please look at my comment http://groups.drupal.org/node/5808#comment-16668 again. If there is a bug (or an inconsistency) in phpBB we will first contact the phpBB developers with a patch, and only if they refuse to incorporate it do we mask the symptoms.

Please make an effort to find the reason for this inconsistency, or let me know if you are certain that it is not caused by the database creation script.

I added my fix and it works fine now

SpectralDart's picture

It seems to work now but.. I noticed some differences between a user created with phpbb and one created with the module from drupal. They might be nothing but, we have to make sure..

There is one user I created which gave me a problem and for some reason when I go on the admin page of phpbb, when I type in the name and go submit (to find it), it said it didnt exist but when I press FIND a member, its listed.. Weird.. It happened only once..

One more thing.. I noticed that in phpbb.module for the user_options we have 853.. But when you create a user with phpbb it gives it 895. I changed that.. I don't know exactly what it implies just yet but I figure if after creating a user it gives it that, it might be to have the basic setup.

Let me know what you think.

My choice initially, standard now

arkepp's picture

895 was my choice initially, after setting up a profile the way I thought the default should be.

I am not sure what version of phpBB you are using, but the phpBB developers appear to agree with me now,
'user_options' => 895,
on line 176 in includes/functions_user.php

phpbb

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: