I am trying to upgrade from D6 to D7. I followed the upgrade instructions and all modules seem to be upgrading fine, but when I enable Advanced Poll (after I successfully enabled Voting API and Advanced Poll Field) I get the following error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'avdev.d1_field_data_advpoll_dates' doesn't exist: SELECT n.title, n.nid FROM {node} n LEFT JOIN {field_data_advpoll_dates} d ON d.entity_id = n.nid LEFT JOIN {field_data_advpoll_closed} c ON c.entity_id = n.nid LEFT JOIN {field_data_advpoll_options} o ON o.entity_id = n.nid WHERE n.type LIKE '%advpoll%' AND o.advpoll_options_value <> 'electoral' AND o.advpoll_options_value = 'block' AND n.status = 1 AND c.advpoll_closed_value = 'open' AND d.advpoll_dates_value < NOW() AND d.advpoll_dates_value2 > NOW() GROUP BY n.nid ORDER BY n.created DESC; Array ( ) in advpoll_get_poll_info_blocks() (line 894 of C:\WAMP\www\avdev\sites\all\modules\advpoll\advpoll.module).

Notice I am using table prefixing (d1_). Is that an issue?
I checked the database and the table is indeed missing.

Comments

Michele Wickham’s picture

Assigned: Unassigned » Michele Wickham

Interesting - I'll work on this over the weekend and keep you posted.

Michele Wickham’s picture

Status: Active » Needs review

Regrettably, I was not able to reproduce this. I created two installs in one database, each with their own prefix. In both cases, the poll module worked and I saw the 9 required fields with their prefixes existed in both cases. So yes, it should be fine with a table prefix. It looks like the fields never got created during install.

Are there any other details you can think of that may have triggered the fields not to install properly? Did you use Drush to install? Do you see any errors in your watchdog or other logs that are triggered during install?

If you have a local/sandboxed version of the build, would you be willing to try installing the fields example module that is included in the collection here? http://drupal.org/project/examples I would be curious to see if its field tables installed properly or not with prefixes since I pretty much used the method shown there to build the install script. It's quite alright if it's too much of a pain to do this but it could help me pinpoint where a problem may be arising.

Thank you!
Michele

Michele Wickham’s picture

So, embarrassingly, it turns out that one of the SQL select statements in the module for generating blocks did not have tables wrapped in {}.

It's quite possible that this is the source of the error (I'm almost 100% certain actually).

The below patch is being pushed into the main build on the project page - the patch rectifies that oversight as well as fixes a major flaw in the way blocks were being managed.

Thanks for your patience and hopefully this will remedy the issue.

frank.dev’s picture

Status: Needs review » Active

Hello,

the same problem with 7.x-3.x-dev - 2012-Jun-29:

Update #7000
Failed: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db421823651.drupal_field_data_advpoll_options' doesn't exist: DELETE FROM {field_data_advpoll_options} WHERE (advpoll_options_value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => showvotes ) in advpoll_update_7000() (line 816 of /htdocs/drupal/sites/all/modules/advpoll/advpoll.install).

Whats wrong?

Greetings
Frank

frank.dev’s picture

Status: Active » Needs work

Please, ignores my comment. I have been wrong in the subject. I will open a new inquiry.

Sorry for this. ;-)
Frank

kappaluppa’s picture

Using 7.x-3.x-dev and getting this error upon enable:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'fiteos_prod.field_data_advpoll_dates' doesn't exist: SELECT n.title, n.nid FROM {node} n LEFT JOIN {field_data_advpoll_dates} d ON d.revision_id = n.vid LEFT JOIN {field_data_advpoll_closed} c ON c.revision_id = n.vid LEFT JOIN {field_data_advpoll_options} o ON o.revision_id = n.vid WHERE n.type = 'advpoll' AND o.advpoll_options_value = 'block' AND n.status = 1 AND c.advpoll_closed_value = 'open' AND d.advpoll_dates_value < NOW() AND d.advpoll_dates_value2 > NOW() ORDER BY n.created DESC; Array ( ) in advpoll_get_poll_info_blocks() (line 969 of /home/fiteos/public_html/sites/all/modules/advpoll/advpoll.module).

any suggestions?

UPDATE:
I'm updating this with steps I took that resulted in the installation working. I'm not sure why I got the error in the first place.

I had also tried Poll Improvement - pollim - module. I tested, then decided it was not for me and deleted the module, or tried, rather. I could not delete it because fields associated with the module were still hanging around. But the poll associated with the fields was gone, so I couldn't really delete the fields any more. They were showing up in the fields list not associated with any node type or module. I had to manually delete the fields from the data base and also from field_config and field_config_instance. I used this as reference. http://drupalor.com/2012/07/31/remove-field_deleted_data-drupal-database. I cleared cache tables. I was then able to successfully delete the module.

Clearing up the database must have helped. I disabled the Advanced Poll module, and Advanced Poll field. Then I went to the uninstall tab in modules and deleted them both from there as well. I then deleted the module from the server, downloaded again just to be sure, manually uploaded it instead of using the install from a URL option. Laid hands on my computer, and went to modules and enabled Advanced Poll and boom. It worked! And now the poll is working on my site.

coranda’s picture

Hi,

I'm having this problem too. I successfully installed advpoll on my production server and all is well. However, I decided I wanted to try adding some functionality to it so I installed it on a local server I use for development and it doesn't create the required fields in the database.

I have tried installing and uninstalling several times but with no luck.

Has anyone worked out what's causing this yet?

Peter

coranda’s picture

Issue summary: View changes

One more thing that might be relevant. My production server is running MySQL 5.0 but the development machine is MySQL 5.6.

tripper54’s picture

Status: Needs work » Closed (duplicate)

Upgrading from 6 to 7 is not currently supported. See #1579744: Upgrade from 6.x-3.x to 7.x-3.x