Closed (fixed)
Project:
Invite
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 Nov 2006 at 03:24 UTC
Updated:
13 Dec 2006 at 21:39 UTC
This is an issue for both the CVS and current 4.7 releases. I've also disabled LoginToboggan (which is said to be incompatible with invite.module on 89125) and these errors still appear.
Warning: Invalid argument supplied for foreach() in /home/fabmin/public_html/modules/node.module on line 359
Warning: implode() [function.implode]: Bad arguments. in /home/fabmin/public_html/modules/node.module on line 363
Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.moderate, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /home/fabmin/public_html/includes/database.mysql.inc on line 120
Warning: Cannot modify header information - headers already sent by (output started at /home/fabmin/public_html/modules/node.module:359) in /home/fabmin/public_html/includes/common.inc on line 266The account is created at the end of the registration process, but I'm marking this as critical since many users will likely give up at the sight of these errors.
Comments
Comment #1
Christefano-oldaccount commentedHere's my setup.
Comment #2
apus commentedI have been able to reproduce this problem with my full install.
drupal bluemarine (unchanged)
modules installed:
comment, contact, fileshare,forum, front_page, help, invite (obviously), legal, menu, og, og_basic, og_mandatory_group, og_moderate, page, path, profile, statistics, story, taxonomy.
Further testing with a brand new "naked" drupal-4.7.4 install show no error messages.
It suggests that some other module or setting is causing the grief... I will start adding modules to my test case until I
get the problem.
suspected modules are modules that interact with the registration process, like og_manadatory, legal, or possibly front_page, I will test these first.
apus. (more soon hopefully)
Comment #3
apus commentedI've tested and tested the different modules to find out that:
1) I cant reproduce the error on a clean install. :( which is good news for other... and bad news for me...
2) grrr. I still don't know why my current install is hosed...
3) looking at the messages on my main site giving errors, I noticed that the success messages for creation of the groups where different. after making a backup to another test location, I changed my the organics group module to the newest og-4.7.x (previously just 4.7)
I now get new error messages... elsewhere...
my suspicion is that the underlying data tables are different. grr.... in the different og modules and that standards changes might be behind it.
I'm starting to dislike having site content in a database.... where module configurations (ie. settings) and data are mixed, and not easily separated... (atleast by me) I've been snooping around in mysql and found that backup dumps don't give you clean installs either unless you go in and DROP the DATABASE first.
If anyone with the same problem figures out a solution, please post it here for others, and shoot me an email.
thanks, apus.
P.S.
Here's what i tested:
methodology-> install and enable the module. configure it. send a test invite. repeat for each grouping of modules.
Testing with version: invite-4.7.x-1.x.tar.gz, Nov 13th
modules to test:
main suspects:
default enabled modules:
page (enabled)
taxonomy (enabled)
menu (enabled)
comment (enabled)
story (enabled)
1) profile: enabled (invite test result: OK)
added different fields including one for adsense
Adsense_code profile_adsense_code single-line textfield Adsense
First Name profile_firstname single-line textfield UserInfo
Last Name profile_lastname single-line textfield UserInfo
Street Address profile_street_address multi-line textfield UserInfo
City profile_city single-line textfield UserInfo
Province/State profile_province_state single-line textfield UserInfo
Postal Code profile_postalcode single-line textfield UserInfo
Country profile_country single-line textfield UserInfo
Gender profile_gendere list selection UserInfo
2) legal: enabled (legal-4.7.0.tar.gz, Aug 15th) (invite test result: OK)
created legal block with two links to dummy legal and privacy
policies
3) front_page (front-4.7.0.tar.gz, Apr 17) (invite test result: OK)
created dummy frontpage.
4) og (og-4.7.x-1.x.tar.gz, Nov 13) (invite test result: OK)
og_basic
created group staff
open group, registration form
enabled block my groups, and block group details
5) og_mandatory_group (og_mandatory_group-4.7.x-1.x.tar.gz, Nov 13)
(invite test result: OK)
changed staff to mandatory group
changed staff to closed group
6) added remaining built in modules: (invite test result: OK)
path (enabled)
statistics (enabled)
help (enabled)
contact (enabled)
forum (enabled)
7) og_moderate (og_moderate-4.7.x-1.x.tar.gz, Nov 13) (invite test result: OK)
8) fileshare (fileshare-4.7.x-1.x.tar.gz, Nov 12) (invite test result: OK)
set up fileshare in files/fileshare
Grrr... the good news is that everything works... :(
The bad news is that I don't know why my real site is fubarred...
Comment #4
apus commentedNote this fix is a little involved.
WARNING: Don't attempt this unless you've backed up your site (directories and Database) and know how to restore it (if you don't know how see here . YOU CAN SERIOUSLY HOSE YOUR SITE IF YOU DO SOMETHING WRONG MESSING WITH THE DATABASE.
It worked for me, your mileage may vary.
As noted in my last post I identified that the og module I was using in my test duplication was different from the main site with the problem.
Here's what I did:
or where ever you installed it)
rm -R /var/www/drupal/sites/default/modules/og/
or where ever you installed it before)
wget http://drupal.org/files/projects/og-4.7.x-1.x.tar.gz
tar xvzf og-4.7.x-1.x.tar.gz -C /var/www/drupal/sites/default/modules/
got error table og_uid_global missing
mysql -u root -p
(enter mysql root password)
select the sites database
(in my case drupal_base_db,
for your site replace it with the database name in /drupal/sites/default/settings.php
in the line $db_url = 'mysql://drupal_DB_user:password@localhost/drupal_base_db'; )
mysql> USE drupal_base_db
(copied format, and defaults from working site testsite og_uid_global using DECRIBE).
mysql>
CREATE TABLE og_uid_global (uid INT(11) PRIMARY KEY, og_email INT(11) NOT NULL DEFAULT 2);
mysql> INSERT INTO og_uid_global (uid) SELECT DISTINCT uid FROM og_uid ORDER BY uid;
mysql> UPDATE og_uid_global SET og_email=1;
the two other og modules that could play a role:
og_manadatory_group, and og_moderate
rm -R /var/www/drupal/sites/default/modules/og_mandatory_group/
tar xvzf og_mandatory_group-4.7.x-1.x.tar.gz -C /var/www/drupal/sites/default/modules/
rm -R /var/www/drupal/sites/default/modules/og_moderate/
tar xvzf og_moderate-4.7.x-1.x.tar.gz -C /var/www/drupal/sites/default/modules/
Testing of invites shows the error message is now gone.
Note: it is my best guess that the og_uid_global table has something to do with being emailed about group
changes by users, so you might get some emails from your site. There is some setting somewhere in administer>groups or in the group itself when you create it that controls emails sent.
Good luck! my site works again, let me know if it worksfor you with a short post here or an email.
apus.
Comment #5
Nick Wilson commentedSo to clarify, this is something that can only be fixed by editing the OG code?
Comment #6
apus commentedThe OG code doesn't get edited by me, but you are correct it is different (because we reinstalled a newer version). If you look at the instructions above you see that the OG modules themselves just get deleted and reinstalled. What does get changed is the mysql data related to the OG module (I guess you could think of it code.. sort of, but technically it is data).
The editing I describe is the editing of the database (by adding a new table). In drupal the modules are php code that is run by your web browser, and the web pages (nodes), group data, user data etc... is stored in a mysql database (more or less).
Here's why I edited the database: The newer version of the og module requires a new data table (think of it like a variable or box where it stores some sort of group info), normally it should create this table by itself on install. However since the OG module has been installed before and some of the database tables already exist the module gets confused and thinks that it already is installed and doesn't create the missing table.
The steps above show you how to manually create this missing table in the database to allow the newer version of OG to function properly without the error.
I'm not sure where the original error came from, I'm guessing an interaction between the user registration routine and the og_mandatory module (since the mandatory group needs to show up in the registration form) caused the grief. When updating that module I also updated the OG base module (for good measure), which created the missing table error.
Sorry if my original explanation wasn't entirely clear. The reason I gave the warning for the need to backup your site is because once you are working directly with the database it is actually possible to hose your whole site. I used the above process without problems, but I also made a backup just in case. You can read more about mysql at http://dev.mysql.com/doc/ if you want to understand the commands I used.
apus.
Comment #7
apus commentedNick: I reread your question, and think I misunderstood its intent the first time around, here's another simpler way to understand my patch, and description of the problem:
For the current og modules and invite modules, with a new install I have no problems:
there is no bug.
only on an older install with older og modules where you install the invite module has the problem. In this case my fix helps update the older install with older og modules to the newest og modules and the problem goes away (as if you had reinstalled everything from scratch).
apus.
Comment #8
AjK commentedapus Update 13 of the OG install creates and populates that table for you. The correct method to upgrade your installation is, after putting the new module files in place is to run update.php. See the link to see how to upgrade.
Comment #9
(not verified) commentedComment #10
apus commentedThanks for the update.php suggestion AjK.
I found that later too, and felt pretty dumb for doing all the work... :}
Although the work paid off, as it is I now understand the DB structure and more about MySQL which is definitely useful... (I later used what I learned about DB queries when migrating from taxonomy_access to OG to use queries to set the group audiences based on previous access taxonomies) :)
For those of you that did use my correction approach, og_uid_global controls the global email settings and you likely want og_email = 0 or 2 (0 = never send emails, 1 = always send emails, and 2= depends on group subscription settings).
you can fix it with an update statement (back up DB first!).
e.g. UPDATE og_uid_global SET og_email=2 WHERE og_email=1;
Have to say now that I understand the DB and learning php, I'm glad I chose Drupal...
Thanks.