Hi,

I encountered an error while i was trying to enable the 'authenticate' module. The error says:
user warning: Unknown column 'func' in 'where clause' query: SELECT aid FROM actions WHERE func = 'action_auth_report_notify_submitter' in /home/content/m/o/u/moudkv/html/includes/database.mysql.inc on line 172.

Could you help me here please.
P.S: I have enabled 'actions' module.

Comments

rkdesantos’s picture

I was able to install but get these errors in my log due to the same issue:

Unknown column 'func' in 'where clause' query: SELECT aid FROM actions WHERE func = 'action_auth_report_notify_submitter' in /home/afana/public_html/drupal5/includes/database.mysql.inc on line 172.

There is no table "func" in the actions table. The actions module does create a variable called $func but it is not saved in the database so far as I can tell.

Your module has this error exposed at line 341:
$result = db_query("SELECT aid FROM {actions} WHERE func LIKE '%s'", 'action_auth_%');
which is almost certainly why I see the log error.

Your install module has an "uninstall" line for this at line 62:
if (module_exists("actions")) db_query("DELETE FROM {actions} WHERE func LIKE '%s'", 'action_auth_%');
which will fail since you never created the table entry.

chrism2671’s picture

This worked for me.
Disable authenticate.
Uninstall the Actions module. Install the older-api actions module. Enable just the actions module on its own. Then enable authenticate.

I had the errors the first time but this cleared them right up.

I still haven't got this module working fully yet (I need to install the PEAR module, see the readme.txt).

If anybody has successfully installed/used this module please let me know- I am keen to hear more about it, and may try and install again this week.

kvmnext’s picture

Hi chrism2671,
Thanks for the info, but could you please explain it in detail. Im a bit of a novice here.
It would be great if you could help me out.

rkdesantos’s picture

Unfortunately, I have to use the latest version of the actions module for use with other modules. It is not a viable solution for me to go back to the earlier version which will not be forward compatible with v6 of Drupal. I am on Drupal 5.7 but will upgrade to v6 within six months or so.

I'd also point out that I had the actions module installed prior to ever installing authenticate.

chrism2671’s picture

I suspect if you wanted to use the actions module you might have to modify the authenticate module yourself, which is a little outside newbie scope. Sorry!

kvmnext’s picture

Hi chrism2671,
"older-api actions module": could you please tell me which version of actions module are you indicating here?

Thanks
kvmnext

rkdesantos’s picture

Category: support » bug

Patching is fine for me personally but I agree not for a newbie; but this appears to be a bug which the module developer needs to be aware of.

chrism2671’s picture

I am using Actions 5.x-1.0.

I have managed to get Authenticate working now - it's a great module, just a little fiddly to get started, but once you're going it's fine.

Remember, you need to have the pear module text_diff installed to make it work.

rkdesantos’s picture

The forward compatible version of Actions is 5.x-2.x. I am on 5.x-2.4. It is not feasible for me to go back to the earlier versions of the Actions module.

liquidcms’s picture

hey all... sorry .. for some reason I don't get notified when there are issues posted against my own projects.

Yes, PEAR text_diff is required. Not sure of "drupal best practices" for doing this - i could include the code with the module; but for my use, my client prefers simply stating external requirements and i have not been able to find anyone on d.org that confirms which method is preferred.

As for actions 1 vs 2 - yes, i am using Action 1.0; don't think there was a 2.0 when i started this module since i have only known about Actions 2.0 for a month or so. Ideally there needs to be a 2.0 compatible version of this module (and then a Dr6 version).

The actions are ONLY used to send out email notifications that an authenticate report has been completed - so, not exactly a strict requirement. I do check if the actions module exists - so as not to error if it doesn't but sadly, Drupal or Actions module devels don't make version control part of module_exists() function. I could simply do a file read of the .info file after doing module_exists() but seems like such a pain.

If anyone is interested in a patch for either the "disable if not 1.0" case or "works with 1.0 or 2.0 version of actions" i would gladly commit this to CVS.

Glad to see some people using (or at least trying to) this module. My client (NY Times/About.com) thinks this is the best module ever.. lol... they have actually fired one of their writers based off results from it.

rkdesantos’s picture

I think that if you simply fixed the install routine or variable call that would go a long way to resolving this issue. (see comment #1). I would be happy to test any patch submitted on this. It should be relatively easy to modify the code to use an alternate call for actions v2 at line 341 if the call to the "func" column fails (in theory anyway) but I defer to greater experts than myself.

I have PEAR text_diff installed so that is not the only issue.

liquidcms’s picture

"I think that if you simply fixed the install routine or variable call" - but not sure what fix is; since they aren't busted (and by install i assume you mean uninstall; and not sure what you mean by variable call).

The code in the module is correct for Actions 1.0. What would the fix be?

The only solution is to do the similar functions in 2 different ways (i.e. the way it is done now and whatever way it is done for Actions 2) and do some sort of test to tell which version of module is being used and then use correct method.

I am sure this is pretty simply to code; but i would need to figure out how these things are done in Actions 2. Unfortunately I would need my client to fund me doing this - which i am sure they will; but likely not until we begin migrating the site to Dr6. Which i doubt will be before Drupal 6 is ready for prime time - which won't be for at least a few months yet. I know chicken/egg thing; but best i can do right now. Hopefully someone familiar with Actions 2 can do up a patch sooner than i will get to it.

liquidcms’s picture

is there a mysql "field in a table" exists function? similar to "if table exists"? If there is i can likely do a test to see if "func" exists and if not assume we have Actions 2 and then, for no, just do nothing - but no errors.

liquidcms’s picture

StatusFileSize
new1.17 KB

perhaps someone with Actions 2 installed could check this patch

this doesn't make it compatible with Actions 2 - it simply checks if it is ver 1 before trying to do the actions.

chrism2671’s picture

I got it to work. I installed the Text_Diff module in the directory and edited the module code to point absolutely at it.

Great module by the way- really good once you get it working!

kvmnext’s picture

hi chrism2671,

great to hear that you got it to work! but i am still lost with the Text_Diff thing.

Could you post the steps how to/where to install the Text_Diff module. Also could you provide me the link where i could download the module from. And what are the code changes to be done?

It would be great if you could help me out.

liquidcms’s picture

code changes shouldn't be necessary.

PEAR is a standard part of any PHP install. It allows you to load different PHP classes intoa common directory in your PHP install folder and you should have a php_inlcude path setting ion your php.ini to point to where these get added. From that point on; PHP will just find the added class files.

I know the PEAR install and user manual is a bit tricky to find - but try this: http://pear.php.net/manual/en/installation.php

you likely all ready have PEAR installed and i think apps to load other class files; try runing pear.bat if you are on a PC.

perhaps i will soon breakdown and just include the text_diff files with the module

rkdesantos’s picture

Note: to ptalindstrom: sorry I didn't explain myself well, but your patch was more or less what I was looking for. A check for the existence of the function should do the trick.

I will test it and advise.

Looking forward to the time when you can make this compatible for actions v2 whenever that may be.

to chrism2671: can you post what you changed?

rkdesantos’s picture

OK, the module now works. However, it is still throwing errors like crazy:

Action Authenticate: Send notification to submitter created.

Unknown column 'func' in 'where clause' query: SELECT aid FROM actions WHERE func = 'action_auth_report_notify_submitter' in /home/afana/public_html/drupal5/includes/database.mysql.inc on line 172.

and these log entries repeat over and over.

liquidcms’s picture

StatusFileSize
new1.59 KB

oops.. yup.. missed a spot.. try this one

this patch is INSTEAD of other patch - NOT on top of.

rkdesantos’s picture

Looks like that did it. Thanks.

liquidcms’s picture

cool.. then i'll commit this to cvs - thanks for testing.

it really does suck that they make a very used api module like actions thinking people will use this functionality in their modules and then do a new non-backward compatible rev of it which breaks everyone's modules. I did take a quick look at the example they gave for 1.0/2.0 conversion and it isn't trivial. Which means i wont get to converting this until we switch our site over to Dr6 - which won't be until this fall ???

rkdesantos’s picture

One point of clarification regarding the Google submodule: Can you explain what goes in the "Google Search URL" and "Google HTTP Referrer" fields. I'm having some trouble because Google no longer supports the old Google Search API and now has the AJAX API instead. Where does the Google Referrer Id go? An example might be sufficient to clear up my confusion.

I sympathize with your situation relative to the Actions module. As long as the Authenticate module works now, and it does with Yahoo anyway, I can wait until you upgrade it to meet the Actions 2.0 requirements.

liquidcms’s picture

Ahh, yes... the Google API. Not a simple story.

The initial goal of this module was to use Google - but not really doable with their AJAX API. There were rumors that they were going to bring back something similar to their SOAP API that allowed developers like myself to create server based apps such as the authenticate module. Luckily my client (The NY Times) has a pretty good relationship with Google and a reasonable amount of clout. We were able to get a special API "key" to their new server based API (while i waited for those details to get sorted out - i did a plugin for Yahoo).

About the time we were completing testing of the Google module - the Google developer i was working with, sent me a notice saying that they were releasing their new API to the public. SO, it should be available. I can see if i can dig up that email and possibly provide some further info regarding this. At the time this was coming out; we decided to not post any of this with the module since i didn't want to get into any legal issues if Google was not making this API public - we decided to leave this to the module users.

As for the admin settings for Google - again not sure i am allowed to post these and not sure if i should have included them with the module (as defaults for instance), BUT...

the URL we use is: http://ajax.googleapis.com/ajax/services/search/web

and the referrer is simply our site URL, since Google wanted us to include this initially so they could keep track of who was using it (but not sure they require this now).

If i can find out more - i'll post it here tomorrow.

liquidcms’s picture

Couldn't find link to details on new Google API - but i think you want to look for "RESTful".

rkdesantos’s picture

The suggested info in #24 works for Google: the Google URL and your local (site) http address. Great module, thanks for all the work and support.

liquidcms’s picture

Title: Error while enabling the 'authenticate' module. » Causes errors when used with Actions 2.0.
Status: Active » Closed (fixed)

title change,

set to closed - fix to not throw errors with Actions 2.0 is in dev branch; will go in to 5.x-1.3

PS - doesn't work with Actions 2.0; just doesn't cause errors with it