Help for a newby please - I really need step by step simple help.

I have loaded the node_privacy_byrole module and get some lines of error message at the top of the page depending on who logs in. Example below is a failed login:

warning: array_keys(): The first argument should be an array in /home/d/e/mydatabasename/public_html/modules/node_privacy_byrole.module on line 143.

warning: Invalid argument supplied for foreach() in /home/d/e/mydatabasename/public_html/modules/node.module on line 1675.

user error: Table 'mydatabasename.event' doesn't exist
query: SELECT DISTINCT(n.nid), e.start FROM event e INNER JOIN node n USING (nid) INNER JOIN node_access na ON (na.nid = 0 OR na.nid = n.nid) WHERE na.grant_view = 1 AND CONCAT(na.realm, na.gid) IN ('all0','node_privacy_byrole_user') AND n.status = 1 AND e.start > 1099267200 AND e.start < 1101859199 ORDER BY e.start in /home/d/e/mydatabasename/public_html/includes/database.mysql.inc on line 125.

warning: array_keys(): The first argument should be an array in /home/d/e/mydatabasename/public_html/modules/node_privacy_byrole.module on line 143.

warning: Invalid argument supplied for foreach() in /home/d/e/mydatabasename/public_html/modules/node.module on line 1675.

warning: array_keys(): The first argument should be an array in /home/d/e/mydatabasename/public_html/modules/node_privacy_byrole.module on line 143.

warning: Invalid argument supplied for foreach() in /home/d/e/mydatabasename/public_html/modules/node.module on line 1675.

warning: array_keys(): The first argument should be an array in /home/d/e/mydatabasename/public_html/modules/node_privacy_byrole.module on line 143.

warning: Invalid argument supplied for foreach() in /home/d/e/mydatabasename/public_html/modules/node.module on line 1675.

And variations on the following depending on page appear now I have loaded the event module:

user error: Table 'mydatabasename.event' doesn't exist
query: SELECT * FROM event WHERE nid = 4 in /home/d/e/mydatabasename/public_html/includes/database.mysql.inc on line 125.

user error: Table 'mydatabasename.event' doesn't exist
query: SELECT DISTINCT(n.nid), e.start FROM event e INNER JOIN node n USING (nid) WHERE '1' AND n.status = 1 AND e.start > 1099267200 AND e.start < 1101859199 ORDER BY e.start in /home/d/e/mydatabasename/public_html/includes/database.mysql.inc on line 125.

user error: Table 'mydatabasename.event' doesn't exist
query: SELECT n.nid, n.title, n.status, n.moderate, e.* FROM node n INNER JOIN event e ON n.nid = e.nid WHERE n.type='event' AND '1' AND n.status = 1 AND e.start >= 1099409337 ORDER BY e.start LIMIT 0, 6 in /home/d/e/mydatabasename/public_html/includes/database.mysql.inc on line 125

I could create a table in the database but have no clue of the field requirements etc that would be needed.

Help please. Be gentle with me....

thanks in anticipation

Comments

Steven’s picture

lepus’s picture

Thanks for the link Steven, but it doesn't help me much. It says:

1. Create the SQL tables. This depends a little on your system, but the most common method is:
mysql -u username -ppassword drupal < event.mysql

What do I do with this? Where do I put this code? I am unable to use any third party management tool on my MySQL and can only use the control panel my host supplies. This alows me to create tables manually but I have no grasp of what it all means.

Can you be a little more specific? Step by step is good.

Cheers

amanda’s picture

Okay, so command line is fun but you can't use it.

The file "event.mysql" contains the SQL commands to create the tables you need for the event module. You have to communicate those commands to your mysql server some how. One way is to slurp the whole file into mysql at the command line, which is what they describe on the link Steven referred you to. Depending on the control panel that your ISP offers, your options can vary.

Can you upload a file to your ISPs mysql control panel? If you upload event.mysql to something like PHPmyAdmin, it will read the commands just fine.

Can you paste some raw SQL in a box on the control panel? Yoy could just cut and paste the whole text of event.mysql.

You might want to ask your ISP if neither of these makes sense. Tell them you are trying to import a file that contains your mysql statements and you want to know how to do that. That is a perfectly reasonable question, and if they don't make it easy on the control panel they should be prepared to answer that question.

lepus’s picture

Amanda, this is great. Just what I needed, in terms I can understand. It fixed the create a database problem with the event module which now seems to work fine.

As to the other problem with node_privacy_byrole, would my guess be right that I would do the same with the patch I found (but probably can't find again!)?

Your help is much appreciated

Cheers

sepeck’s picture

install the dba.module and activate it (no tables required).
Open the events.mysql file and copy the contents out
Go to Administer/database execute tab
paste the contents of events.mysql into it and click the execute button ONCE

Check that the tables are created.
Activate the events module.

You can do this for any module that has mySQL tables.

This aviods the ISP control panel and keeps it all nicely within Drupal. Be VERY careful aout setting permissions of this module, I only allow one account to access it myself.

You might consider going through the mySQL tutorial docs on the mySQL site. Start with chapter 1 and go through at least chapter 3.
http://dev.mysql.com/doc/mysql/en/index.html

-sp

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

lepus’s picture

Thanks for that. As you will see in the thread I have already managed to sort the events module problem. That in itself has given me a little window towards understanding all this a bit better.

I had noticed the dba.module in my search but was not confident that I knew enough not to screw things up. Perhaps now I might venture there when needs must.

I really appreciate the link to the mySQL tutorial. I'll definitely check it out.

Many thanks again

Any advice on my other problem with node_privacy_byrole? Or any other method of keeping sections of the site private to groups ideally by taxonomy/category? The node_privacy_byrole module is not ideal for our needs as it allows a user to control who sees stuff. Ideally the user in one group should not even be able to see that there are other groups.

Cheers