Setting up the module in god mode works fine but once I try to add the address field into my content as a standard user, the State dropdown does not populate and Preview or Submit of the group of fields that Address is accompanied by produce the following error:

user warning: Table 'admin_drupal.content_field_address_1' doesn't exist query: SELECT COUNT(*) FROM content_field_address_1 WHERE vid = 30 AND nid = 30 in /home/content/s/e/a/seanimler/html/includes/database.mysql.inc on line 172.

user warning: Table 'admin_drupal.content_field_address_1' doesn't exist query: INSERT INTO content_field_address_1 (field_address_1_street1, field_address_1_street2, field_address_1_apt, field_address_1_city, field_address_1_state, field_address_1_zip, field_address_1_country, field_address_1_other, vid, nid) VALUES ('', NULL, NULL, '', '', '', '', NULL, 30, 30) in
/home/content/s/e/a/seanimler/html/includes/database.mysql.inc on line 172.

user warning: Table 'admin_drupal.content_field_address_1' doesn't exist query: SELECT field_address_1_street1 AS street1, field_address_1_street2 AS street2, field_address_1_apt AS apt, field_address_1_city AS city, field_address_1_state AS state, field_address_1_zip AS zip, field_address_1_country AS country, field_address_1_other AS other FROM content_field_address_1 WHERE vid = 30 in /home/content/s/e/a/seanimler/html/includes/database.mysql.inc on line 172.

CommentFileSizeAuthor
#14 Devel.png58.43 KBrconstantine

Comments

rconstantine’s picture

but once I try to add the address field into my content as a standard user

Do you mean that you let users create content types? Or do you mean it breaks when simply creating content?

Does the specified table actually exist? (admin_drupal.content_field_address_1???) That's a funny name for a table.

earthcub’s picture

I have two custom content types and I let users create content using those types.

I agree, this is a funny name and I don't understand how the error message is composed.
admin_drupal.content_field_address_1
admin_drupal is the name of my database and the user name of the admin. This is godaddy hosting procedure to create the admin user name the same as the database name being created using their shared hosting environment.
content_field_address_1 does not exist. I think this is the crux of the error. The user definately has "administer databases" checked in the Access interface.

I'm happy to help you debug this in any way. The dev version of the module is nice and I'd like to use it. If you'd like to we'd could set up an IM meeting and explore testing in realtime should it turn out that you can't reproduce the problem.

Cheers,
-sean

rconstantine’s picture

One more thing you can do is install the dev module and enable SQL backtracing so that when you get errors, we can figure out which function called what and with what variables. That would be the most helpful and is how I solve such problems on my machine.

earthcub’s picture

I enabled backtrace but when I went to edit the content, the State dropdown did not populate and no error was reported. The only thing that's reporting is the previous error written to the screen when I submit. I wonder if the error isn't being reported because of the permissions of this particular user but if I change those permissions, then it would be an admin which doesn't have the problem with the States being populated. A bit of a catch 22. Any other ideas?

rconstantine’s picture

Um, devel has its own permissions, so make sure that user has them. It wouldn't be an admin really.

earthcub’s picture

The role that the content creator is assigned to has all Devel permissions.

rconstantine’s picture

Oh, wait a minute. You said godaddy? There are semi-known issues with godaddy. I'm not sure if it's AJAX related or what. I actually moved hosts from godaddy for the same problem! I can't believe I didn't see that you mentioned them. I should read these messages a little closer. A while ago, I was using my godaddy hosting account (which I use for personal stuff - Gallery mostly) as a testbed for a Drupal project. All I wanted to do was set everything up there and then move it over. Well, when it came time to setup the CCK_Address module (using that crazy other-users-probably-will-never-use-it feature of selecting addresses from known database entries) I could not get the table columns to populate the child drop downs, nor the state to populate either. I think I tried for 5 hours until, for no apparent reason, it worked one time. As I only needed to set that one address up that way once, I didn't think about it and after I moved the project over, users didn't have any problems with the AJAX stuff.

A quick search at google for drupal web hosts will turn up several articles worth reading. Godaddy does not make the cut. In fact, another problem I had with them was "The SQL server has gone away". I'd get that message (50-100 times on one page) after the MySQL server would take a dump. Reloading the page (once or twice or more) would bring it back. Not something you'd want users to have to do. This would really only happen on particularly heavy pages, but still - not a good thing. Drupal is notorious for its heavy database usage. It's not uncommon for a regular page, viewed by an authenticated user (not cached), to use over 200 queries.

So for now, I'm leaning toward host issues. And from my experience, they aren't too willing to help out - at least with shared hosting accounts. I couldn't say how their more expensive offerings are.

earthcub’s picture

Well, I installed a new database on godaddy the other day and noticed that they're offering mysql5.0 now. So, I'm hoping that upgrading from 4.0.27 will solve the problem and I'm escalating a process with their tech support to migrate my data over to 5.0. I'll let you know if that solves the problem. Thanks for the insight.

rconstantine’s picture

By the way, due to the number of queries Drupal makes, it can be processor intensive and has been known to get accounts turned off so as not to short-change the other accounts on the same machine. I think godaddy is offering drupal now in their applications section, but that shouldn't be mistaken for catering to drupal users' needs.

I'm pretty sure the change you're making won't make a difference, but let me know anyway.

earthcub’s picture

Okay, well that wasn't too terribly long of a process and they were pretty accommodating, but... it didn't solve the problem, like you said. It really doesn't make sense too me that this should happen. I'm using another module that's doing a very similar thing. http://blue.live4all.co.il/~mooffie/cms/node/15. Ajax driven dropdowns that work flawlessly. I don't know enough about Drupal to diagnose this problem but maybe the above would help you. I made a feeble attempt to merge your non-dev version and mooffie's modules, but it turned into a time sink being that I really need to read the developers guide because are some mysteries about Drupal that I don't understand.

rconstantine’s picture

I read the first page of that article. I'll read the rest when I get the chance. If it proves to be a better option than Activeselect (the way I use it solves the problems mentioned on that page), then I guess I'll rewrite my module! Thanks for the link.

As for now, I'm still sticking with the idea that SOMETHING related to how godaddy is operating is the problem here, but I don't know what it could be. Have you had any other Activeselect-based modules work? I wonder if the implementation of AJAX in it isn't quite right, or fails in certain conditions.

Using Firebug in Firefox, I was able to see that the correct data was being returned from the AJAX query, but wasn't making it into the drop down fields. The AJAX spinner graphic would keep on spinning for hours (I left and ate lunch once). What was missing was the command to append the document with that data that was returned.

Like I said, no problem on any other setup I've used. So I'm not sure this is a bug - or something that can be debugged. Maybe a support request? What do you think? Do you have any other web space elsewhere you could try out? Or a friend with space you could borrow?

earthcub’s picture

No, I haven't tried using any other activeselect modules. I also saw that the data was coming back... you can tell because the dropdown actually changes size like it's going to populate but doesn't. I wonder, as an easy solution... is there a way to set up an option to not use ajax to populate the dropdown that can be added to the .module file and not be appended to the node's "Php code" field option. It's a workaround obviously and doesn't solve the problem. For now, I've implemented the free-text field for state. Props for providing that!

I think that escalating this to the activeselect maintainer would be a good idea. Would you mind doing that? You're in a much better position than I to start a dialogue. I have various other spaces on the web that I can use for testing if necessary.

rconstantine’s picture

The drop downs will work without AJAX if you disable the activeselect module.

rconstantine’s picture

StatusFileSize
new58.43 KB

Something else to try. On my godaddy account (still use it for personal, non-drupal stuff), I just tried this and had the same problem as before. Then I enabled the stuff in devel and it worked. See the screen shot.

rconstantine’s picture

I neglected to suggest that you try the same settings and let me know if it works.

rconstantine’s picture

For me, it looks like all I need are "collect query info" and "display query log" and everything works. That's strange. Have you tried uninstalling devel and seeing if it works then? Did you ever NOT have devel installed when you tried to use this module?

earthcub’s picture

When I first starting having this problem, I did not have devel installed on my live instance. I uninstalled activeselect and that made the problem go away which was good and I felt that solution was good enough for my users. However, I've continually gotten this type of error when submitting the CCK driven content type:

user warning: Table 'admin_drupal1.content_field_address_1' doesn't exist query: SELECT COUNT(*) FROM content_field_address_1 WHERE vid = 30 AND nid = 30 in /home/content/s/e/a/seanimler/html/includes/database.mysql.inc on line 172.
trigger_error /home/content/s/e/a/seanimler/html/includes/database.mysql.inc: 172 Table 'admin_drupal1.content_field_address_1' doesn't exist query: SELECT COUNT(*) FROM content_field_address_1 WHERE vid = 30 AND nid = 30, 512
_db_query /home/content/s/e/a/seanimler/html/includes/database.inc: 200 SELECT COUNT(*) FROM content_field_address_1 WHERE vid = 30 AND nid = 30
db_query /home/content/s/e/a/seanimler/html/sites/all/modules/cck/content.module: 474 SELECT COUNT(*) FROM {content_field_address_1} WHERE vid = %d AND nid = %d, 30, 30

rconstantine’s picture

That would suggest to me that a content type itself has become corrupted. You should try to delete that content type and then rebuild it. The CCK module itself is looking for a data field that does not exist. Most of the data field housekeeping is done by the content module. In fact, I can't think of any creation/maintenance/destroying that my module does directly. Is this the same content type that you started with and the one you tried to use drop down states with, or is it a new one? Have you inspected your database to make sure that the table exists?

rconstantine’s picture

Status: Active » Fixed

So I was finally able to figure something out I think. I realized that all of my own installations were screwed up like yours but I had some things in place preventing their detection.

Anyway, I compared the js file of the dev version of activeselect to the release version and there is one significant change which seems to solve the problem. As there are no other detrimental changes to the js file and no changes whatsoever to the module file, I'm advising the use of the dev version. Please see if that fixes things for you as well. Marking this as fixed unless you tell me otherwise.

Anonymous’s picture

Status: Fixed » Closed (fixed)