Back to the index page  
LiveChat! (0 online)   FAQ   Search   Memberlist   Usergroups   Register   Profile   Log in to check your private messages   Log in 
Error in 'contact_id' when loggin in V 2.0

 
Post new topic   Reply to topic    web2Project Forum Index » Install and Setup View previous topic :: View next topic  
Error in 'contact_id' when loggin in V 2.0
 PostPosted: Wed Jul 21, 2010 4:00 am Reply with quote  
Message
  Fran
I am in love now!

Joined: 21 Dec 2009
Posts: 10
Hi there... I guess this is not solved out there already... but...

every time I tried to log in after a fresh instal of version 2.0 I get this error

ERROR:

.../classes/w2p/Database/Query.class.php(1115) : query failed

(SELECT

user_id,
contact_first_name as user_first_name,
contact_last_name as user_last_name,
contact_company as user_company,
contact_department as user_department,
user_type,cm.method_value AS user_email

FROM ((`users` AS users))

INNER JOIN `contacts` AS con ON contact_id = user_contact
LEFT JOIN `contacts_methods` AS cm ON cm.contact_id = con.contact_id WHERE cm.method_name = 'email_primary' AND user_id = 1
AND user_username = 'admin')

- error was: Column 'contact_id' in on clause is ambiguous

Backtrace:

0
.../classes/w2p/Database/Query.class.php:1115 dprint()

1
.../classes/w2p/Database/Query.class.php:1262 exec()

2
.../classes/ui.class.php:855 loadObject()

3
.../index.php:127 login()

Column 'contact_id' in on clause is ambiguous

I installed locally with no problem and both locally and remotely, only showed LDAP Authentication issue

Any help would be appreciated.

Thanks
View user's profile Send private message
 PostPosted: Wed Jul 21, 2010 2:25 pm Reply with quote  
Message
  caseydk
Administrator

Joined: 07 Nov 2007
Posts: 1334
Location: Austin, TX
If you look at ui.class.php around line 835, you should find this line:

Code:
$q->addJoin('contacts', 'con', 'contact_id = user_contact', 'inner');


just update it to this:

Code:
$q->addJoin('contacts', 'con', 'con.contact_id = user_contact', 'inner');


Further, this is resolved in r1239.

_________________
D. Keith Casey, Jr.
Blog: http://CaseySoftware.com/blog
Company: http://BlueParabola.com/

Core web2project contributor
Maintainer: Microsoft Project Importer and TodoList Module
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
 PostPosted: Thu Jul 22, 2010 7:40 am Reply with quote  
Message
  Fran
I am in love now!

Joined: 21 Dec 2009
Posts: 10
Hi caseydk

Nice to know that you are still around w2p and thanks for the help.

I tried to find the r1239, but I'm a little bit rusty with w2p; I checked in bug tracking, and couldn't find it.

Besides I don't remember if this r1239 was a revission or a resolved issue.... sorry for being annoying Razz I tried though...

Now I can log in but I get this error

ERROR:

.../classes/w2p/Database/Query.class.php(1115) : query failed(SELECT DISTINCT(user_id), user_username, contact_last_name, contact_first_name,
company_name, contact_company, dept_id, dept_name,

CONCAT(contact_first_name,' ',contact_last_name) contact_name, user_type,cm.method_value AS contact_email FROM ((`users` AS users))

INNER JOIN `contacts` AS con ON contact_id = user_contact
LEFT JOIN `contacts_methods` AS cm ON cm.contact_id = con.contact_id
LEFT JOIN `companies` AS com ON company_id = contact_company
LEFT JOIN `departments` AS dep ON dept_id = contact_department WHERE cm.method_name = 'email_primary'
GROUP BY user_id
ORDER BY user_username)

- error was: Column 'contact_id' in on clause is ambiguous

Backtrace:
0 .../classes/w2p/Database/Query.class.php:1115 dprint()
1 .../classes/w2p/Database/Query.class.php:1152 exec()
2 .../includes/main_functions.php:368 loadList()
3 .../modules/admin/vw_active_usr.php:8 w2PgetUsersList()
4 .../style/web2project/overrides.php:101 require()
5 .../modules/admin/index.php:86 show()
6 .../index.php:363 require()

If all this is solved in the r1239, please point where it is and I'll try to follow that

Thanks again!!

Cheers
View user's profile Send private message
 PostPosted: Thu Jul 22, 2010 9:04 pm Reply with quote  
Message
  caseydk
Administrator

Joined: 07 Nov 2007
Posts: 1334
Location: Austin, TX
No problem. The r1239 note was to let people know that this is fixed going forward. In your case, here's the change to apply:

Quote:
If you look at ui.class.php around line 835, you should find this line:

Code:
$q->addJoin('contacts', 'con', 'contact_id = user_contact', 'inner');


just update it to this:

Code:
$q->addJoin('contacts', 'con', 'con.contact_id = user_contact', 'inner');

_________________
D. Keith Casey, Jr.
Blog: http://CaseySoftware.com/blog
Company: http://BlueParabola.com/

Core web2project contributor
Maintainer: Microsoft Project Importer and TodoList Module
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
 PostPosted: Thu Jul 22, 2010 9:59 pm Reply with quote  
Message
  Fran
I am in love now!

Joined: 21 Dec 2009
Posts: 10
Hi again caseydk...

I applied your tweak and could log in with no problem but now I get som other erros of the same type and can not administrate users from the "gui".

I tried the r1239 and the problem persists... so before checking the forum I reported a bug...

Sometimes don't know the criteria to report in mantis or here... I apologize if I do wrong.

But yes I applied straight away your previous tweak as I said in my second post and solve my login problem but since then and now still, I have a different one. Is weird though, isn't it? Because locally I installed v2.0 perfectly at the first attempt but have tried several times in a remote server and always get this error.

Thanks again.
View user's profile Send private message
 PostPosted: Fri Jul 23, 2010 10:27 pm Reply with quote  
Message
  caseydk
Administrator

Joined: 07 Nov 2007
Posts: 1334
Location: Austin, TX
That is weird... are there different versions of PHP or MYSQL involved?
_________________
D. Keith Casey, Jr.
Blog: http://CaseySoftware.com/blog
Company: http://BlueParabola.com/

Core web2project contributor
Maintainer: Microsoft Project Importer and TodoList Module
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
 PostPosted: Tue Jul 27, 2010 9:50 pm Reply with quote  
Message
  Fran
I am in love now!

Joined: 21 Dec 2009
Posts: 10
Hi caseydk..sorry for the delay.

In the remote server

PHP: 5.2.13
MySQL: 4.1.22-standard

I did a fresh install...

Local installation

PHP: 5.2.11
MySQL: 5.1.37

Thanks again.
View user's profile Send private message
 PostPosted: Sat Jul 31, 2010 2:32 am Reply with quote  
Message
  caseydk
Administrator

Joined: 07 Nov 2007
Posts: 1334
Location: Austin, TX
Mysql 4.1 is a bit dated.. almost 5 years old now. I don't know that anyone has done any testing with it.
_________________
D. Keith Casey, Jr.
Blog: http://CaseySoftware.com/blog
Company: http://BlueParabola.com/

Core web2project contributor
Maintainer: Microsoft Project Importer and TodoList Module
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
 PostPosted: Sun Aug 01, 2010 10:14 pm Reply with quote  
Message
  Fran
I am in love now!

Joined: 21 Dec 2009
Posts: 10
Hi caseydk... is a remote hosted solution, so I don't know if I can help with the MySQL version...

Thanks anyway for solving the problem... though after tweaking with the code, now there is an error message of the same nature in Tasks... contact_id ambiguous... not letting me to create,edit or whatever in tasks

Solution for the "users" issue can be found here as caseydk resolved this one in r1274.

Here's the specific change:

http://web2project.svn.sourceforge.net/viewvc/web2project/trunk/includes/main_functions.php?revision=1274&view=markup&pathrev=1274


The change needs to be applied in the file main_punctions.php inside the "includes" folder. Simply replace the whole code of the file for the code caseydk fixed here... or download it as a file and replace the other.. the way you want, but change that file for the updated in the link.

My today's vote for "help a friend to get a piece of heaven in the afterlife" goes for you caseydk.

Thanks a lot...
View user's profile Send private message
 PostPosted: Sun Aug 01, 2010 11:23 pm Reply with quote  
Message
  caseydk
Administrator

Joined: 07 Nov 2007
Posts: 1334
Location: Austin, TX
I suspect this is due to your older version of mysql, but I've patched it a bit more in r1275. You can grab the update just as you did before:

http://web2project.svn.sourceforge.net/viewvc/web2project/trunk/includes/main_functions.php?revision=1275&view=markup&pathrev=1275

Please let me know the result *asap* so I can close this if applicable. Thanks.

_________________
D. Keith Casey, Jr.
Blog: http://CaseySoftware.com/blog
Company: http://BlueParabola.com/

Core web2project contributor
Maintainer: Microsoft Project Importer and TodoList Module
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Post new topic   Reply to topic    web2Project Forum Index » Install and Setup

Page 1 of 1
All times are GMT

Display posts from previous:

  

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2002 phpBB Group
Macinscott 2 by Scott Stubblefield

Get web2Project at SourceForge.net. Fast, secure and Free Open Source software downloads