| Project: | Addresses |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Software:
- drupal-6.6
- addresses 6.x-1-0-alpha3
- token-6.x-1.11
Fresh install - the only other module present is the image module.
Errors:
user warning: Unknown column 'is_primary' in 'where clause' query: UPDATE addresses_user SET is_primary = 0 WHERE is_primary = 1 AND eid = 0 in /media/disk/www/e-werk/sites/all/modules/addresses/addresses_user/addresses_user.inc on line 37.
user warning: Unknown column 'is_primary' in 'where clause' query: UPDATE addresses_user SET is_primary = 0 WHERE is_primary = 1 AND eid = 0 in /media/disk/www/e-werk/sites/all/modules/addresses/addresses_user/addresses_user.inc on line 71.
And further:
When enabling the address-book function and entering multiple addresses (i.e. Private address, Bussiness address) no adress is shown, not even one. I've been at this for two days and I am not getting anywhere. I searched the forums but couldn't find any fixes that worked (i.e. changing the table name "addresses" to "addresses_user" ...)
A note about me: I am new to linux. I have been a Windows and MAC user for almost 20 years, so I lear fast. But when pointing out things to change in SQL and PHP I need it a little more detailed (like full name of files and paths).
Comments
#1
Paul,
thanks for your report and welcome to Linux (but note that Linux is not required in order to use Drupal)!
I will work on this bug. Follow this issue for further information.
About the address book feature. Note that it WONT show on the normal User page. It creates a tab when only the user might see and add new addresses. If you know that and still dont see the addresses on that page, i will check that too.
regards,
massa
#2
Hi Massa,
thank you for replying so fast.
As for the address book, this is what I did for testing so far.
Logged in as an administrator (with all permissions) I activated the address book in the config page of "Addresses" by putting a mark in the little checkbox on the bottom of the page.
I then went to the user administration and edited my own user account, frist entering in my private address, then entering my business address. After saving these addresses none were visible (not even for admin on his own account). I also tried this for a testuser - same result: no addreses in the address book.
The only time I see an address is when disabling the address book function and then entering one address.
I hope this helps.
Have a nice friday,
Paul.
#3
I've also experienced this. The database does not have the addresses_user table.
user warning: Table 'drupal.addresses_user' doesn't exist query: SELECT * FROM addresses_user WHERE eid = 1 ORDER BY is_primary DESC in /path/to/drupal/sites/default/modules/addresses/addresses_user/addresses_user.inc on line 37.
Where in the module code is addresses_user_install() called? I can't find it anywhere :)
Is it called from elsewhere? I see the code there that needs to create the table, but I'm not sure what's supposed to execute it.
#4
1st sorry 4 my bad english. I will write in english and german 4 those who got some probs with a non-german-forum ;)
ENGLISH:
One of my member gave me a hint, coz he got the same error, if he opened his 'user-Profil', listed in this tread above.
... user warning: Table 'pageaow_db01.addresses_user' doesn't exist
... query: SELECT * FROM addresses_user WHERE eid = 3 ORDER BY is_primary DESC
... in XXX/modules/addresses/addresses_user/addresses_user.inc on line 37.
means:
... the table in database was not found (not existing / wrong written?)
... we got no table in database called addresses_user but there is a table called addresses
... magical 'line 37' ;) ... full command starts line 35 and ... omfg ... someone is mayB searching a wrong table :D
ok, stoping little jokes, going back to the facts:
addresses_user.inc,v 1.22 2008/10/22 21:45:20
old code
34 if (empty($addresses[$id])) {35 $adr = db_query("SELECT * FROM {addresses_user}
36 WHERE %s = %d
37 ORDER BY is_primary DESC", $id_type, $id);
new code
34 if (empty($addresses[$id])) {35 $adr = db_query("SELECT * FROM {addresses}
36 WHERE %s = %d
37 ORDER BY is_primary DESC", $id_type, $id);
U only need 2 replace line 35 from 'new code' - works perfect.
BUT: I got no idea if this produce errorcode on other 'pages' or 'pageparts' ! ! !
I'm really busy and I will do some testing next yeahr ... aermmm is only 5 weeks ;)
If some1 can realize a test or something like this, plz leave a comment or message here - thx a lot.
GERMAN:
Einer meiner Member hatte mir einen Hinweis gegeben, da er die gleiche Fehlermeldung wie oben angezeigt erhielt, als er auf sein User-Profil gegangen ist.
... user warning: Table 'pageaow_db01.addresses_user' doesn't exist
... query: SELECT * FROM addresses_user WHERE eid = 3 ORDER BY is_primary DESC
... in XXX/modules/addresses/addresses_user/addresses_user.inc on line 37.
bedeutet:
... die benoetigte Tabelle in der Datenbank konnte nicht gefunden werden (existiert nicht / falsch geschrieben?)
... wir haben keine Tabelle in der Datenbank mit dem Namen addresses_user jedoch eine Tabelle, die sich addresses nennt
... 'line 37' ... das eigentliche 'command' startet bereits ab Zeile 35 !
addresses_user.inc,v 1.22 2008/10/22 21:45:20
old code
34 if (empty($addresses[$id])) {35 $adr = db_query("SELECT * FROM {addresses_user}
36 WHERE %s = %d
37 ORDER BY is_primary DESC", $id_type, $id);
new code
34 if (empty($addresses[$id])) {35 $adr = db_query("SELECT * FROM {addresses}
36 WHERE %s = %d
37 ORDER BY is_primary DESC", $id_type, $id);
Einfach die Zeile 35 vom 'new code' ersetzen - works perfect.
Achtung: Ich habe immo keine Zeit, zu testen, ob sich die Aenderung auch auf andere Bereiche des Scripts auswirkt.
Werde vor 2009 nicht daran kommen dies zu testen, sollte jedoch jemand einen Test gemacht haben, dann bitte ne Info oder nen Comment - danköööh
GL&HF, PZY-Q
#5
Dear PZY-Q,
that did not work out for me. At first the error message disapeared, then it reappeared when I activated the addrressbook in the addresses config. At the same time only the default address was displayed.
I then checked my SQL database and found out that all addresses I ever entered where stored there. The name in the SQL database by the way is "addresses_user".
So I changed the code back.
I will probably deinstall the addresses module now and try something else.
But thank you for the idea.
Paul.
#6
It seems that there are two problems:
I ran into the second issue because I manually created addresses_user based on the schema def.
Question: is is_primary meant to be in addresses_user, or is there a query that is mistakenly querying addresses_user instead of addresses?
#7
Guys,
im happy to say that i think i managed to fix it! i will release a new version of the module soon.
regards,
massa
#8
Automatically closed -- issue fixed for 2 weeks with no activity.
#9
http://localhost/mysite/user/1 = my account
user warning: Unknown column 'is_primary' in 'order clause' query: SELECT * FROM addresses_user WHERE eid = 1 ORDER BY is_primary DESC in \sites\all\modules\addresses\addresses_user\addresses_user.inc on line 40.
Drupal 6.9
modules Installed:
admin_menu-6.x-1.3
cck-6.x-2.1
birthdays-6,x-1.0
token-6.x-1.11
location-6.x-3.0
adresses-6.x1.05
Thank you.
#10
Any update on either what the correct fix is, or when an updated release will have the fix?
Thanks,
jdl
#11
When Drupal performs the installation of multiple modules, it first installs and then enables all modules. This becomes a problem when installing multiple modules that have hook dependencies on one another (see #472684 for more information). Attached is a patch with the best known work around to date. When Drupal core is patched, this patch can be removed.
Cheers,
Antoine
#12
Patch looks good to me.
#13
I just attempted this from a fresh install with Drupal 6.15 and Addresses from HEAD and did not need the patch for the addresses_user install - when installing addresses_user at the same time as addresses.
Please re-open if you can reproduce the old issue with the latest dev release and Drupal 6.15.
#14
Automatically closed -- issue fixed for 2 weeks with no activity.