user 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 '=1 AND n.status = 1' at line 1 query: SELECT n.nid, n.title FROM node n INNER JOIN content_ f ON n.vid = f.vid WHERE f.=1 AND n.status = 1 in /usr/home/froginab/domains/rochambeaurecords.com/public_html/modules/station/schedule/station_schedule.module on line 506.

Comes in on a clean install of Drupal.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wickedradio’s picture

Priority: Normal » Critical

I am also having the exact same issue. I get the same error using either the unstable or dev release for drupal 6.x. I am using drupal 6.8. Would be awesome to get this module working again, I loved it when I was using drupal 5.x but now we upgraded to 6.x to be able to utilise some other modules. here is my specific error for reference.

user 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 '=1 AND n.status = 1' at line 1 query: SELECT n.nid, n.title FROM node n INNER JOIN content_ f ON n.vid = f.vid WHERE f.=1 AND n.status = 1 in /usr/local/www/echotangoradio/sites/all/modules/station/schedule/station_schedule.module on line 506.

drewish’s picture

what functionality do you have enabled? which of the station modules etc. i'm not seeing that error.

refreshingapathy’s picture

I've got Station, Catalog, Playlist, Program, and Schedule with the associated dependencies. I'll try another fresh install and see if its something that hung around from an older install...

refreshingapathy’s picture

Tried another fresh install - error is still there.

refreshingapathy’s picture

I just installed the "unstable" version - same error...

mrosas’s picture

I also discovered this issue and was able to correct it with an edit to the DJs field for the program content type as follows:

Edit content type:
"Content Management > content types > edit program > manage fields > DJs"

Under Global Settings | User roles that can be referenced:"
check "authenticated user"

Save Field Settings

And Voila -- error is resolved because query is now valid.

drewish’s picture

okay, that's good to know but what pages are you viewing to get the error? i'd like to replicate it.

refreshingapathy’s picture

Pops up on the top of every single page on my site.

Tried to do mrosas' quick-fix and I can't say that I follow it.... there aren't any fields defined, and possibly that is the problem.

drewish’s picture

i really need to look into this. marked #373738: User Error on fresh install as a duplicate.

synistics’s picture

I just did the install and I am getting the same error. MYSQL V 5.0.67-community.

I am also getting archive incompatible with Drupal 6.9 core.

I tried the work around with the DJ setting, but no success.

I commented it out for the time being and went ahead working through. Created one test DJ and loaded one song.

This error popped up.

* user 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 'WHERE sp. = 1 AND n.status = 1' at line 1 query: SELECT COUNT(n.nid) FROM node n INNER JOIN content_ sp ON n.nid = sp. WHERE sp. = 1 AND n.status = 1 in /home/thefolk1/public_html/mywicast.com/modules/station/playlist/station_playlist.module on line 91.
* user 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 'WHERE sp. = 1 AND n.status = 1' at line 1 query: SELECT COUNT(n.nid) FROM node n INNER JOIN content_ sp ON n.nid = sp. WHERE sp. = 1 AND n.status = 1 in /home/thefolk1/public_html/mywicast.com/modules/station/playlist/station_playlist.module on line 91.

I will try un-commenting the other.

Nothing commented out this is what comes back:

* user 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 'WHERE sp. = 1 AND n.status = 1' at line 1 query: SELECT COUNT(n.nid) FROM node n INNER JOIN content_ sp ON n.nid = sp. WHERE sp. = 1 AND n.status = 1 in /home/thefolk1/public_html/mywicast.com/modules/station/playlist/station_playlist.module on line 92.
* user 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 '=1 AND n.status = 1' at line 1 query: SELECT n.nid, n.title FROM node n INNER JOIN content_ f ON n.vid = f.vid WHERE f.=1 AND n.status = 1 in /home/thefolk1/public_html/mywicast.com/modules/station/schedule/station_schedule.module on line 507.

bigkevmcd’s picture

I got this error too...

ou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=1 AND n.status = 1' at line 1 query: SELECT n.nid, n.title FROM node n INNER JOIN content_ f ON n.vid = f.vid WHERE f.=1 AND n.status = 1 in /srv/www/testbed/drupal/sites/all/modules/station/schedule/station_schedule.module on line 509.

But, using the devel module to install and reinstall the station_schedule module worked...

I noted that the djs field hadn't been created on the schedule, this was installed on a clean install, that had no modules previously installed, I selected the station modules, and allowed it to bring in the dependencies.

refreshingapathy’s picture

I read bigkevmcd's comment and installed the Devel module to try to reinstall - I had to reinstall schedule and program and now my errors are miraculously gone.

drewish’s picture

Title: New SQL error on installation » SQL error: SELECT n.nid, n.title FROM node n INNER JOIN content_ f ON n.vid = f.vid WHERE f.=1 AND n.status = 1

http://groups.drupal.org/node/22627 looks like a duplicate of this.

drewish’s picture

Starting with a clean installation and selecting station_schedule.module and letting the dependencies be selected automatically I was able to replicate this error.

sounds’s picture

Yes sorry about that,
Didn't see this group at first,
Don't know how to fix it
Gonna try your recommendations

Here's my post, someone lead me to this group,
http://groups.drupal.org/node/22627#comment-78315

It seems to be when i enable the station schedule that i see this error,
Also i looked today and its warning me about the database being out of date

Maybe someone could show me how to use these modules on my site if i get them fixed?
Would greatly appreciate,

i don't have a crew or anything to start a station yet but i have the streams and my own autodj stream
Would love to get this setup on my site and maybe attract some potential broadcasters/djs

Is there any docs on setting up and using these mods properly?

EDIT

I'm after trying the above solution 4 times with no luck
First i installed the unstable version recommended for 6.X
When i enable to station schedule it asks to enable tohe other dependencies so i click continue
Then get the same error messege, so i tryed uninstalling the schedule folder and installing it again using the dev version
No luck

What upsets me is i don't know how to use any of these yet and i can't get them working to try them out

Error when i enable the station module:

user 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 '=1 AND n.status = 1' at line 1 query: SELECT n.nid, n.title FROM node n INNER JOIN content_ f ON n.vid = f.vid WHERE f.=1 AND n.status = 1 in /home/xxx/public_html/main/sites/all/modules/station/schedule/station_schedule.module on line 525.

drewish’s picture

So the problem boils down to not having CCK and User Reference installed before enabling the Station Schedule module. As a work around you should be able to disable, then un-install the Schedule, then re-install it.

sounds’s picture

Hi,

The user reference is one of the modules listed in the cck section, there's several others in that section
Maybe i'll wait till there's a stable version of the station mod, still trying to figure all these other mods out

drewish’s picture

Priority: Critical » Normal

sounds, it's frustrating that you'd ask for help and then not want to even try the workaround i suggest. the only time this error occurs is when you don't have user reference enabled before enabling the schedule.

so just uninstall then reinstall the schedule and it'll work fine.

lowering the priority since it's easy enough to work around.

sounds’s picture

Priority: Normal » Critical

Hi,

I allready tryed the 6.2.x dev version and the unstable version,
I even uninstalled the dev station schedule modile and reinstalled that into the unstable version, etc
Also i tryed this by disabeling the user reference modules but the station schedules asks you to run that so,

* You must enable the User Reference module to install Station Schedule.

Would you like to continue with enabling the above?

When i click continue the error is back
When i turn off the schedule mod the error messege is gone.

Next i disable the schedule mod and then delete that folder from the station folder
Then i upload the schedule mod from the dev version and enable it
The error is back

drewish’s picture

Priority: Critical » Normal

sounds, could of things:

  • enable User Reference and leave it alone. it must be enabled before Station Schedule, it can't be enabled at the same time.
  • when i say uninstalling it means: disabling the module by unchecking the "Station Schedule" checkbox on admin/build/modules and submitting the form. then going to the uninstall tab (admin/build/modules/uninstall) checking the schedule module and submitting that form. if you're just removing the module files that's not enough, you need to use the uninstall procedure.
sounds’s picture

That's what i was doing wrong, using ftp to uninstall it,
When i enabled it, it works fine, now to learn how to use them

Thanks for explaining

kelizabeth’s picture

This part seems to be working fine for me now, but I've gotten a few other errors. Nothing that seems to be too critical. But I will mention them in another issue thread as I come across them.

cookiesunshinex’s picture

I just performed a 5.18 to 6.12 upgrade.

I downloaded the 6.x version of all of my previous modules, and the new ones required for the 6.x version of station.

I enabled all of the modules one by one and ran update.

I saved station as the last module to enable.

I received the above error message even though I had user reference enabled. However, I only received the error message 7 times when I enabled the last module. Station.Schedule - which I enabled after Station.Program and Station.

* user 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 '=1 AND n.status = 1' at line 1 query: SELECT n.nid, n.title FROM node n INNER JOIN content_ f ON n.vid = f.vid WHERE f.=1 AND n.status = 1 in /home/wonder/public_html/modules/station/schedule/station_schedule.module on line 525.
* user 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 '=10 AND n.status = 1' at line 1 query: SELECT n.nid, n.title FROM node n INNER JOIN content_ f ON n.vid = f.vid WHERE f.=10 AND n.status = 1 in /home/wonder/public_html/modules/station/schedule/station_schedule.module on line 525.
* user 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 '=10 AND n.status = 1' at line 1 query: SELECT n.nid, n.title FROM node n INNER JOIN content_ f ON n.vid = f.vid WHERE f.=10 AND n.status = 1 in /home/wonder/public_html/modules/station/schedule/station_schedule.module on line 525.
* user 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 '=19 AND n.status = 1' at line 1 query: SELECT n.nid, n.title FROM node n INNER JOIN content_ f ON n.vid = f.vid WHERE f.=19 AND n.status = 1 in /home/wonder/public_html/modules/station/schedule/station_schedule.module on line 525.
* user 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 '=19 AND n.status = 1' at line 1 query: SELECT n.nid, n.title FROM node n INNER JOIN content_ f ON n.vid = f.vid WHERE f.=19 AND n.status = 1 in /home/wonder/public_html/modules/station/schedule/station_schedule.module on line 525.
* user 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 '=18 AND n.status = 1' at line 1 query: SELECT n.nid, n.title FROM node n INNER JOIN content_ f ON n.vid = f.vid WHERE f.=18 AND n.status = 1 in /home/wonder/public_html/modules/station/schedule/station_schedule.module on line 525.
* user 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 '=18 AND n.status = 1' at line 1 query: SELECT n.nid, n.title FROM node n INNER JOIN content_ f ON n.vid = f.vid WHERE f.=18 AND n.status = 1 in /home/wonder/public_html/modules/station/schedule/station_schedule.module on line 525.

To fix it, I took Drewish's advice and disabled and uninstalled the station module (even though I already have the CCK user reference module enabled).

When I re-enabled station, the errors did not appear and I was able to run update.php without any failures.

It is almost as if there really isn't a way to upgrade the station module from 5.x to 6.x.

drewish’s picture

cookiesunshinex, i believe that the official upgrade instructions suggest disabling all your contrib modules before upgrading core. then once that's upgraded start enabling contrib modules.

cookiesunshinex’s picture

What I did was disable all modules prior to the upgrade. However, I uploaded all of the newer contrib modules code for 6.x into the proper directories before running the update.php to upgrade core from 5.x to 6.x.

I got several sql failures when update.php ran the first time.

After core upgraded I began systematically enabling modules, each time running update.php which also reported failures until I got to the last module.

Perhaps, I should not have uploaded the contrib module 6.x code before upgrading core??

drewish’s picture

cookiesunshinex, humm, that actually sounds correct. did you record any of the errors you got? or are they all on issues you've posted on?

cookiesunshinex’s picture

I reported all of the issues I had.

I knew that some of the error messages were minor because I had not enabled station.playlist or any of the other station modules and some of the sql error messages on the initial and a few subsequent update.php runs was that station.playlist couldn't be updated without cck link and cck user reference. and I had not yet enabled the CCK link and CCK User Reference modules either.

As I slowly started enabling modules, the sql errors started to diminish when update.php was run.

I don't use station.playlist module, so I had to go in manually and choose Select Versions\station_playlist module and select no updates available one time. This was because each time I would run update.php, I would get a sql error about some dependency (sorry didn't record the message).

After I did that, station_playlist module doesn't show up in the list when selecting versions and I don't receive the sql errors.

I do have a good backup of my 5.x setup and this is a test server, so I can run through this again. I will do it within the next 2 days.

One question, should I disable and uninstall the station module before the core 5.x to 6.x upgrade? Or should I postpone uploading the station module code until after the core upgrade??

drewish’s picture

FileSize
2.88 KB

okay so here's a hack-ish patch to avoid this. ideally we'd be able to enable both modules at the same time but it seems like a problem with the ordering of the modules. since station_schedule sorts ahead userreference.

drewish’s picture

Status: Active » Fixed

went ahead and committed that to head.

drewish’s picture

Component: Schedule » Other
Status: Fixed » Needs review
FileSize
8.64 KB

turns out that program and playlist also were afflicted by this problem. after something like 6 hours of tracing my way through the module dependency and installation system i came up with a very simple solution. just call module_enable(array('content', 'userreference')); in hook_install() and it'll get the modules fully enabled before we create the fields.

drewish’s picture

FileSize
10.3 KB

fixing a couple more .install things while i'm in here.

drewish’s picture

Status: Needs review » Fixed
FileSize
11.1 KB

committed the attached to HEAD and documented the process at http://drewish.com/node/134

cookiesunshinex’s picture

Thanks so much for doing all the brain busting, head scratching, aggravating work in debugging this issue.

It really is much appreciated.

cookiesunshinex’s picture

I ran through the upgrade (update.php) from core 5.18 to 6.12 again with all of the 6 contributed modules (including the latest Dev version of station as of 18:00 GMT +8 June 6, 2009) in the modules directory. I deleted all of the 5 modules and uploaded all new 6 modules.

Here are the SQL errors I received when running update.php the first time.

station_program module
Update #6000

* Failed: Station Program now requires CCK, Text and Link modules. Some updates are still pending.
Please re-run the update script.

station_schedule module
Update #6000

* ALTER TABLE {station_schedule_item} CHANGE iid `iid` INT unsigned NOT NULL auto_increment

Update #6001

* Failed: Station Playlist now requires CCK and User Reference modules. Some updates are still pending.
Please re-run the update script.

Update #6003

* Failed: ALTER TABLE {views_view} ADD UNIQUE KEY name (name)

Update #6004

* ALTER TABLE {views_object_cache} DROP data
* ALTER TABLE {views_object_cache} ADD `data` LONGTEXT DEFAULT NULL

content module
Update #6000

* Failed: content.module has updates and is available in the modules folder but is not enabled.
If and when it is enabled, you will need to re-run the update script. You will continue to see this message until the module is enabled and updates are run.

text module
Update #6000

* Failed: text.module has updates and is available in the modules folder but is not enabled.
If and when it is enabled, you will need to re-run the update script. You will continue to see this message until the module is enabled and updates are run.

cookiesunshinex’s picture

I got this after enabling CCK Link and Text and running update.php

user warning: Duplicate entry '48-0' for key 1 query: INSERT INTO content_field_station_program_dj (nid, vid) SELECT n.nid, n.vid FROM station_dj f INNER JOIN node n ON f.program_nid = n.nid WHERE NOT EXISTS ( SELECT * FROM content_field_station_program_dj t WHERE f.program_nid = t.nid) in /home/jungle/public_html/modules/station/schedule/station_schedule.install on line 522.

THIS THE FAILURE. THE OTHER STATION UPDATE RAN FINE.

station_schedule module
Update #6001

* Failed: INSERT INTO {content_field_station_program_dj} (nid, vid) SELECT n.nid, n.vid FROM {station_dj} f INNER JOIN {node} n ON f.program_nid = n.nid WHERE NOT EXISTS ( SELECT * FROM {content_field_station_program_dj} t WHERE f.program_nid = t.nid)
* UPDATE {content_field_station_program_dj} t INNER JOIN {station_dj} f ON t.nid = f.program_nid SET t.field_station_program_dj_uid = f.uid

tim.plunkett’s picture

that sounds exactly like the error i had here: #471866: Failed Station Schedule Update
it's when one program has multiple DJs.
come to think of it, the patch never addressed the presence of the delta field in that table, which is how i manually fixed it.

i guess that's my fault, i never tested the patch on an older copy of my database.

cookiesunshinex’s picture

Ahh, Yes, I have a few programs with multiple DJs and now come to think of it, after the upgrade, only 1 of the Djs was on them.

drewish’s picture

Okay, then lets take this discussion over to #471866: Failed Station Schedule Update.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

drewish’s picture

marked #497670: user warning: You have an error in your SQL syntax as a duplicate. not sure which version they were using though.