I marked it critical because I'm training a new volunteer webmaster for our group this month; plus, there are some major events occurring right now.

Drupal 5.12
SignUp 5.x-2.7
CCK 5.x-1.7
Date 5.x-1.8

It's the same issue that was discussed once before in relation to Event.module. I thought Karen's fix for Date was in the SignUp 5.x-2.7.

user warning: Not unique table/alias: 'content_field_event_date_time' query: 
SELECT n.nid, n.title, n.type, s.status AS signup_status, COUNT(s_l.nid) AS signup_total, 
s.close_signup_limit AS signup_close_signup_limit, 
field_event_date_time_value, 
field_event_date_time_value, 
field_event_date_time_value, 
field_event_date_time_value 
FROM node n 
INNER JOIN signup s ON s.nid = n.nid 
LEFT JOIN signup_log s_l ON s.nid = s_l.nid 
LEFT JOIN content_field_event_date_time ON content_field_event_date_time.vid = n.vid 
LEFT JOIN content_field_event_date_time ON content_field_event_date_time.vid = n.vid 
LEFT JOIN content_field_event_date_time ON content_field_event_date_time.vid = n.vid 
LEFT JOIN content_field_event_date_time ON content_field_event_date_time.vid = n.vid 
GROUP BY n.nid, n.title, signup_status, signup_close_signup_limit 

I am grateful for all of you open source developers. When I see the hours and hours and hours I spend just trying to get the modules to play nice together on our volunteer site, I can imagine what you must deal with trying to think of all the "what if's" that could possibly happen.

CommentFileSizeAuthor
#3 347234_cck_table_alias.3.patch1.51 KBdww

Comments

Ashford’s picture

Title: Not unique table/alias with v5.x-2.7 & CCK Date » Alter the date field name in current nodes?

I just ran a test on my localhost site.

I made the date field a different name for each content type.
date_event_volunteer
date_event_meeting
date_event_training

Admin>SignUp Administration handled it fine. Next step, I signed up for several different content types. There were no errors on the SignUp Admin screen.

The secret seems to be to not choose the same Date field for more than one content_type. I guess that's why everybody else's modules worked and mine didn't. It seemed like an orderly and economic way to handle the same field type. Reduce-Reuse-Recycle doesn't work for everything.

I know this may not be due to your module's code, but I wanted to maintain this same thread versus posting the same scenario elsewhere. Is there a way I can easily alter the date fields in my current CCK content_types and existing nodes without throwing the world into chaos?

dww’s picture

Title: Alter the date field name in current nodes? » Not unique table/alias with v5.x-2.7 & CCK Date
Assigned: Unassigned » dww
Category: support » bug

Ugh, I guess I never I tested multiple node types with the same date field -- duh. :( If it weren't for this bug (only on admin/content/signup), everything should otherwise work fine. You *need* to specify the signup date field for each node type if you want reminder emails and auto-close to work.

Anyway, I can easily reproduce the bug. I'll work on it later today.

dww’s picture

Status: Active » Needs review
StatusFileSize
new1.51 KB

Tested on DRUPAL-5--2 (5.x-2.x-dev). Patch applies (with minor offset) to DRUPAL-6--1 and HEAD, too.

dww’s picture

Title: Not unique table/alias with v5.x-2.7 & CCK Date » Not unique table/alias SQL error on admin/content/signup if you use the same CCK date field for multiple node types

(More precise title)

dww’s picture

Status: Needs review » Fixed

Had a chance to test this with D6 too, and as expected, the bug exists and this patch fixes it. Committed to HEAD, DRUPAL-6--1, and DRUPAL-5--2.

Ashford’s picture

Major thanks for that quick reply and solution. The patch fixed the admin section and I'm back on go.

I had previously selected the Date field for each node type. As stated, I used the same field for all the node types. I have my fingers, eyes, and toes crossed that it won't cause problems for the reminders and the closures.

Status: Fixed » Closed (fixed)

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