I have installed Advanced Poll [v 7.x-2.x] and can now neither configure this module nor even create a Poll! I disabled the core Poll module because Advanced Poll documentation describes it as a replacement for the Drupal Core module, so that is what I thought I should do.

I believe that I have enabled all of the correct Permissions.

When I try to run update.php i get three messages: (1) "Some of the updates cannot be applied because their dependencies were not met" (2) "No Pending Updates", and (3) "The website encountered an unexpected error. Please try again later".

The reason I'm trying 7.x-2.x is that when I tried 7.x-3.x I got a message that said that there was not enough schema information in the 7.x-3.x release.

All of my Advanced Poll code is 7.x-2.x. The Voting API module version is 7.x-2.11

Wyckham

Comments

wdseelig’s picture

Just re-ran update.php and got a different message:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'GOPV7Revert.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 896 of /var/www/WCGOP/sites/all/modules/contrib/advpoll/advpoll.module).

This is saying that the table field_data_advpoll_dates doesn't exist, and this is correct. Three tables that do seem to be associated with Advanced Poll: advpoll, advpoll_electoral_list, and advpoll_choices ARE in my db. The first two are empty, the third has some entries that look like they came from an old poll.

wdseelig’s picture

I just ran another experiment. I disabled all 4 of the Advanced Poll modules, then manually dropped the three tables that were in my db. I then re-enabled the Advanced Poll modules and ran update.php. I got the same PDOException error message as before, and this time none of the three tables listed above: advpoll, advpoll_electoral_list and advpoll_choices is in my db.

wdseelig’s picture

I keep getting this message when running update.php after downloading versions of votingapi:

votingapi module votingapi module can not be updated. Its schema version is 9. Updates up to and including 6101 have been removed in this release. In order to update votingapi module, you will first need to upgrade to the last version in which these updates were available.

I have gone all the way back to version votingapi-7.x-2.x-dev and I still get this message.

Is there a version that will work??

vako’s picture

I am using the following versions and don't have any issues:
Drupal 7.26
Advanced Poll 7.x-3.x-dev
Voting API 7.x-2.11

wdseelig’s picture

Thank you for this! I had tried all of these EXCEPT Drupal 7.26 [I am on 7.22]. I will try the Drupal upgrade and see if that helps.

wdseelig’s picture

It DIDN'T help!

I have upgraded my site to Drupal 7.26, and am using Advanced Poll 7.x-3.x-dev and Voting API 7.x-2.11.

This time I left the core's Poll module in, so I can see [and presumably create] Polls.

However, i cannot anywhere see a link to configure an Advanced Poll, establish a list of electors, or use any of the other nifty features that are available in Advanced Poll.

I should add two things:

1) Whenever I try to enable or disable any of the Advanced Poll modules I invariably get a message that says something like "Website encountered an unexpected error -- please try again later." When I re-run the "save configuration" [sometimes more than once] it eventually goes through

2) I've noticed that in my Permissions page, the Poll module does not have any boxes to be checked to allow me to set permissions for it. [Both Advanced Poll, and Voting API modules DO have boxes in which to set permissions.

Any help gratefully received!

Wyckham

wdseelig’s picture

I noticed that my Status Report said that I should update my database by running update.php. I did so and got the following error
message [again]. Also, my site now says that it is in maintenance mode, so I may be losing the site again.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'GOPV7Revert.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 /var/www/WCGOP/sites/all/modules/contrib/advpoll/advpoll.module).

Wyckham

wdseelig’s picture

The errors that I'm getting say that advpoll is failing to install because a table: field_data_advpoll_dates does not exist. When I check my db, I find that this is true; that table isn't in my db.

I have looked at all of the install files for the drupal 7 version of Advpoll, and that table is not instantiated in ANY of them. Is there an earlier version of advpoll that I have to install first before the Drupal 7 version??

Wyckham

brandonratz’s picture

I'm getting similar errors. However, running multisite (sites are running from identical codebase), I'm able to get Advanced Poll operating correctly on a fresh install.

Neither site will allow Decisions module to work correctly, or uninstall. I have already tried a complete uninstall/reinstall of AdvPoll with no luck.

I was able to get some functionality from AdvPoll at one point and the Content type was excluding all custom fields AdvPoll is suppose to supply. I simply had a content type called 'Advanced Poll' with title/body fields.

My errors are as follows:

WD php: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ifcs14_dev.field_data_advpoll_dates' doesn't exist: SELECT n.title, n.nid FROM {node} n [error]
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 ...sites/all/modules/contrib/advpoll/advpoll.module).
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ifcs14_dev.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 ...sites/all/modules/contrib/advpoll/advpoll.module).
Drush command terminated abnormally due to an unrecoverable error.

brandonratz’s picture

Confirmed a fresh install of Drupal and AdvPoll required modules does in fact create the field_data_* tables necessary for this to work.
field_data_advpoll_behavior
field_data_advpoll_choice
field_data_advpoll_closed
field_data_advpoll_cookie_duration
field_data_advpoll_dates
field_data_advpoll_max_choices
field_data_advpoll_mode
field_data_advpoll_options
field_data_advpoll_results

brandonratz’s picture

I exported the tables from working installation to the non-working installation. I no longer receive errors (considering the tables now exist). However, no functionality of AdvPoll is available.

Here is the SQL if you're interested:

-- phpMyAdmin SQL Dump
-- version 3.4.10.1deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 12, 2014 at 11:33 AM
-- Server version: 5.5.24
-- PHP Version: 5.3.10-1ubuntu3.9

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `ccdemo_dev`
--

-- --------------------------------------------------------

--
-- Table structure for table `field_data_advpoll_behavior`
--

CREATE TABLE IF NOT EXISTS `field_data_advpoll_behavior` (
  `entity_type` varchar(128) NOT NULL DEFAULT '' COMMENT 'The entity type this data is attached to',
  `bundle` varchar(128) NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
  `deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
  `revision_id` int(10) unsigned DEFAULT NULL COMMENT 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
  `language` varchar(32) NOT NULL DEFAULT '' COMMENT 'The language for this data item.',
  `delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
  `advpoll_behavior_value` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`entity_type`,`entity_id`,`deleted`,`delta`,`language`),
  KEY `entity_type` (`entity_type`),
  KEY `bundle` (`bundle`),
  KEY `deleted` (`deleted`),
  KEY `entity_id` (`entity_id`),
  KEY `revision_id` (`revision_id`),
  KEY `language` (`language`),
  KEY `advpoll_behavior_value` (`advpoll_behavior_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data storage for field 7 (advpoll_behavior)';

--
-- Dumping data for table `field_data_advpoll_behavior`
--

INSERT INTO `field_data_advpoll_behavior` (`entity_type`, `bundle`, `deleted`, `entity_id`, `revision_id`, `language`, `delta`, `advpoll_behavior_value`) VALUES
('node', 'advpoll', 0, 3, 3, 'und', 0, 'approval');

-- --------------------------------------------------------

--
-- Table structure for table `field_data_advpoll_choice`
--

CREATE TABLE IF NOT EXISTS `field_data_advpoll_choice` (
  `entity_type` varchar(128) NOT NULL DEFAULT '' COMMENT 'The entity type this data is attached to',
  `bundle` varchar(128) NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
  `deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
  `revision_id` int(10) unsigned DEFAULT NULL COMMENT 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
  `language` varchar(32) NOT NULL DEFAULT '' COMMENT 'The language for this data item.',
  `delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
  `advpoll_choice_choice_id` varchar(10) NOT NULL,
  `advpoll_choice_choice` varchar(500) NOT NULL,
  `advpoll_choice_write_in` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`entity_type`,`entity_id`,`deleted`,`delta`,`language`),
  KEY `entity_type` (`entity_type`),
  KEY `bundle` (`bundle`),
  KEY `deleted` (`deleted`),
  KEY `entity_id` (`entity_id`),
  KEY `revision_id` (`revision_id`),
  KEY `language` (`language`),
  KEY `advpoll_choice_choice` (`advpoll_choice_choice`(255))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data storage for field 5 (advpoll_choice)';

--
-- Dumping data for table `field_data_advpoll_choice`
--

INSERT INTO `field_data_advpoll_choice` (`entity_type`, `bundle`, `deleted`, `entity_id`, `revision_id`, `language`, `delta`, `advpoll_choice_choice_id`, `advpoll_choice_choice`, `advpoll_choice_write_in`) VALUES
('node', 'advpoll', 0, 3, 3, 'und', 0, '4346bf38', 'Choice 1', 0),
('node', 'advpoll', 0, 3, 3, 'und', 1, 'd5b43826', 'Choice 2', 0);

-- --------------------------------------------------------

--
-- Table structure for table `field_data_advpoll_closed`
--

CREATE TABLE IF NOT EXISTS `field_data_advpoll_closed` (
  `entity_type` varchar(128) NOT NULL DEFAULT '' COMMENT 'The entity type this data is attached to',
  `bundle` varchar(128) NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
  `deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
  `revision_id` int(10) unsigned DEFAULT NULL COMMENT 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
  `language` varchar(32) NOT NULL DEFAULT '' COMMENT 'The language for this data item.',
  `delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
  `advpoll_closed_value` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`entity_type`,`entity_id`,`deleted`,`delta`,`language`),
  KEY `entity_type` (`entity_type`),
  KEY `bundle` (`bundle`),
  KEY `deleted` (`deleted`),
  KEY `entity_id` (`entity_id`),
  KEY `revision_id` (`revision_id`),
  KEY `language` (`language`),
  KEY `advpoll_closed_value` (`advpoll_closed_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data storage for field 8 (advpoll_closed)';

--
-- Dumping data for table `field_data_advpoll_closed`
--

INSERT INTO `field_data_advpoll_closed` (`entity_type`, `bundle`, `deleted`, `entity_id`, `revision_id`, `language`, `delta`, `advpoll_closed_value`) VALUES
('node', 'advpoll', 0, 3, 3, 'und', 0, 'open');

-- --------------------------------------------------------

--
-- Table structure for table `field_data_advpoll_cookie_duration`
--

CREATE TABLE IF NOT EXISTS `field_data_advpoll_cookie_duration` (
  `entity_type` varchar(128) NOT NULL DEFAULT '' COMMENT 'The entity type this data is attached to',
  `bundle` varchar(128) NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
  `deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
  `revision_id` int(10) unsigned DEFAULT NULL COMMENT 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
  `language` varchar(32) NOT NULL DEFAULT '' COMMENT 'The language for this data item.',
  `delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
  `advpoll_cookie_duration_value` int(11) DEFAULT NULL,
  PRIMARY KEY (`entity_type`,`entity_id`,`deleted`,`delta`,`language`),
  KEY `entity_type` (`entity_type`),
  KEY `bundle` (`bundle`),
  KEY `deleted` (`deleted`),
  KEY `entity_id` (`entity_id`),
  KEY `revision_id` (`revision_id`),
  KEY `language` (`language`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data storage for field 9 (advpoll_cookie_duration)';

--
-- Dumping data for table `field_data_advpoll_cookie_duration`
--

INSERT INTO `field_data_advpoll_cookie_duration` (`entity_type`, `bundle`, `deleted`, `entity_id`, `revision_id`, `language`, `delta`, `advpoll_cookie_duration_value`) VALUES
('node', 'advpoll', 0, 3, 3, 'und', 0, 60);

-- --------------------------------------------------------

--
-- Table structure for table `field_data_advpoll_dates`
--

CREATE TABLE IF NOT EXISTS `field_data_advpoll_dates` (
  `entity_type` varchar(128) NOT NULL DEFAULT '' COMMENT 'The entity type this data is attached to',
  `bundle` varchar(128) NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
  `deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
  `revision_id` int(10) unsigned DEFAULT NULL COMMENT 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
  `language` varchar(32) NOT NULL DEFAULT '' COMMENT 'The language for this data item.',
  `delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
  `advpoll_dates_value` datetime DEFAULT NULL,
  `advpoll_dates_value2` datetime DEFAULT NULL,
  PRIMARY KEY (`entity_type`,`entity_id`,`deleted`,`delta`,`language`),
  KEY `entity_type` (`entity_type`),
  KEY `bundle` (`bundle`),
  KEY `deleted` (`deleted`),
  KEY `entity_id` (`entity_id`),
  KEY `revision_id` (`revision_id`),
  KEY `language` (`language`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data storage for field 10 (advpoll_dates)';

--
-- Dumping data for table `field_data_advpoll_dates`
--

INSERT INTO `field_data_advpoll_dates` (`entity_type`, `bundle`, `deleted`, `entity_id`, `revision_id`, `language`, `delta`, `advpoll_dates_value`, `advpoll_dates_value2`) VALUES
('node', 'advpoll', 0, 3, 3, 'und', 0, '2014-02-12 00:00:00', '2014-03-14 00:00:00');

-- --------------------------------------------------------

--
-- Table structure for table `field_data_advpoll_max_choices`
--

CREATE TABLE IF NOT EXISTS `field_data_advpoll_max_choices` (
  `entity_type` varchar(128) NOT NULL DEFAULT '' COMMENT 'The entity type this data is attached to',
  `bundle` varchar(128) NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
  `deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
  `revision_id` int(10) unsigned DEFAULT NULL COMMENT 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
  `language` varchar(32) NOT NULL DEFAULT '' COMMENT 'The language for this data item.',
  `delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
  `advpoll_max_choices_value` int(11) DEFAULT NULL,
  PRIMARY KEY (`entity_type`,`entity_id`,`deleted`,`delta`,`language`),
  KEY `entity_type` (`entity_type`),
  KEY `bundle` (`bundle`),
  KEY `deleted` (`deleted`),
  KEY `entity_id` (`entity_id`),
  KEY `revision_id` (`revision_id`),
  KEY `language` (`language`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data storage for field 6 (advpoll_max_choices)';

--
-- Dumping data for table `field_data_advpoll_max_choices`
--

INSERT INTO `field_data_advpoll_max_choices` (`entity_type`, `bundle`, `deleted`, `entity_id`, `revision_id`, `language`, `delta`, `advpoll_max_choices_value`) VALUES
('node', 'advpoll', 0, 3, 3, 'und', 0, 1);

-- --------------------------------------------------------

--
-- Table structure for table `field_data_advpoll_mode`
--

CREATE TABLE IF NOT EXISTS `field_data_advpoll_mode` (
  `entity_type` varchar(128) NOT NULL DEFAULT '' COMMENT 'The entity type this data is attached to',
  `bundle` varchar(128) NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
  `deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
  `revision_id` int(10) unsigned DEFAULT NULL COMMENT 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
  `language` varchar(32) NOT NULL DEFAULT '' COMMENT 'The language for this data item.',
  `delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
  `advpoll_mode_value` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`entity_type`,`entity_id`,`deleted`,`delta`,`language`),
  KEY `entity_type` (`entity_type`),
  KEY `bundle` (`bundle`),
  KEY `deleted` (`deleted`),
  KEY `entity_id` (`entity_id`),
  KEY `revision_id` (`revision_id`),
  KEY `language` (`language`),
  KEY `advpoll_mode_value` (`advpoll_mode_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data storage for field 11 (advpoll_mode)';

--
-- Dumping data for table `field_data_advpoll_mode`
--

INSERT INTO `field_data_advpoll_mode` (`entity_type`, `bundle`, `deleted`, `entity_id`, `revision_id`, `language`, `delta`, `advpoll_mode_value`) VALUES
('node', 'advpoll', 0, 3, 3, 'und', 0, 'normal');

-- --------------------------------------------------------

--
-- Table structure for table `field_data_advpoll_options`
--

CREATE TABLE IF NOT EXISTS `field_data_advpoll_options` (
  `entity_type` varchar(128) NOT NULL DEFAULT '' COMMENT 'The entity type this data is attached to',
  `bundle` varchar(128) NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
  `deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
  `revision_id` int(10) unsigned DEFAULT NULL COMMENT 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
  `language` varchar(32) NOT NULL DEFAULT '' COMMENT 'The language for this data item.',
  `delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
  `advpoll_options_value` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`entity_type`,`entity_id`,`deleted`,`delta`,`language`),
  KEY `entity_type` (`entity_type`),
  KEY `bundle` (`bundle`),
  KEY `deleted` (`deleted`),
  KEY `entity_id` (`entity_id`),
  KEY `revision_id` (`revision_id`),
  KEY `language` (`language`),
  KEY `advpoll_options_value` (`advpoll_options_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data storage for field 12 (advpoll_options)';

--
-- Dumping data for table `field_data_advpoll_options`
--

INSERT INTO `field_data_advpoll_options` (`entity_type`, `bundle`, `deleted`, `entity_id`, `revision_id`, `language`, `delta`, `advpoll_options_value`) VALUES
('node', 'advpoll', 0, 3, 3, 'und', 0, 'showvotes');

-- --------------------------------------------------------

--
-- Table structure for table `field_data_advpoll_results`
--

CREATE TABLE IF NOT EXISTS `field_data_advpoll_results` (
  `entity_type` varchar(128) NOT NULL DEFAULT '' COMMENT 'The entity type this data is attached to',
  `bundle` varchar(128) NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
  `deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
  `revision_id` int(10) unsigned DEFAULT NULL COMMENT 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
  `language` varchar(32) NOT NULL DEFAULT '' COMMENT 'The language for this data item.',
  `delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
  `advpoll_results_value` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`entity_type`,`entity_id`,`deleted`,`delta`,`language`),
  KEY `entity_type` (`entity_type`),
  KEY `bundle` (`bundle`),
  KEY `deleted` (`deleted`),
  KEY `entity_id` (`entity_id`),
  KEY `revision_id` (`revision_id`),
  KEY `language` (`language`),
  KEY `advpoll_results_value` (`advpoll_results_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data storage for field 13 (advpoll_results)';

--
-- Dumping data for table `field_data_advpoll_results`
--

INSERT INTO `field_data_advpoll_results` (`entity_type`, `bundle`, `deleted`, `entity_id`, `revision_id`, `language`, `delta`, `advpoll_results_value`) VALUES
('node', 'advpoll', 0, 3, 3, 'und', 0, 'aftervote');

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
wdseelig’s picture

Thank you for this!

This sounds like I would (1) Create a fresh Drupal installation [complete with its own new database], (2) Install advpoll in that new Drupal installation, (3) Export the tables that I need for advpoll to work, and then (4) Import those new tables to my original Drupal site. When I finished this [which wouldn't take very long], though, I would have a non-working version of advpoll.

Alternatively, of course, I could just cut/paste your SQL into a file and then import that file into my existing Drupal DB.

Also not sure why a fresh Drupal installation will create the necessary tables, but an updated version [I went from 7.22 to 7.26 yesterday] will not.

Anybody have any ideas why a fresh Drupal version will create the necessary tables, but an existing installation [even if recently updated] will not?

wdseelig’s picture

OK. I did the cut/paste with the SQL posted in #11 above. The tables in that sql were created, but when I tried to update the advanced poll by running update.php I got a new error message:

advpoll module
Update #7000

Failed: FieldException: Attempt to update a non-existent field. in field_update_field() (line 224 of /mysite/modules/field/field.crud.inc).

Also, and probably because of this failure, the table advpoll_electoral_list, which is supposed to be created in advpoll.install, wasn't.

***SIGH***

brandonratz’s picture

Possible Solution
I was able to do a removal all advpoll tables, remove field bundles advpoll setup, reset the schema_version of all advpoll modules in the system table (-1) to get Drupal to see the module as uninstalled. Once I re-enabled the module it installed correctly.

wdseelig’s picture

Cannot find "field bundles advpoll setup"? Can you say what this is?

wdseelig’s picture

OK. I went all the way back to square 1.

  • I deleted all references to both advpoll and voting api from my database [including the field_data_advpoll_* tables that I had put in using the SQL from #11 above.
  • I removed all of the code [via unix rm -rf commands] associated with both votinapi and advpoll from my codebase.

After doing this, I confirmed that my modules listing page didn't show either votingapi or advpoll.

I then downloaded advpoll [version 7.x-3.x-dev], and votingapi [version 7.x-2.11].

I then enabled first votingapi [no problem] and the various advpoll modules. As I was enabling the advpoll modules I got the "Website encountered unexpected error" message mentioned in #8 above. This happened twice, then the enabling went through.

When I then inspected my database, I found that I DID have the advpoll_electoral_list table, but did NOT have any of the field_data_advpoll_* fields mentioned in #10 above. Also, when I looked at my system table, the schema version for advpoll showed as -1 [shouldn't it be 7000]?

When I then went to my site, I found that I now had an Advanced Poll content type, but I could not create an instance of this type: When I tried to do so, the module kept asking me to enter at least two choices. I added two "choice" fields to the content type that I was creating, but this didn't help.

Also, I could not find an Advanced Poll configuration page, and could not see a way to utilize the electoral list.

Would be grateful for any help.

Wyckham

P.S. This is, as indicated, now version 7.x-3.x-dev, so I suppose I should repost it?

brandonratz’s picture

What I meant was that I removed all rows in the 'field_config' and 'field_config_instance' tables where advpoll was set in the 'bundle' column.

brandonratz’s picture

The goal is to get the module completely uninstalled and reinstalled. I had errors uninstalling as the module wouldn't complete the uninstall because of database errors. The schema version shouldn't be set if the module is uninstalled. The schema version being set imply that the tables exist in the first place.

wdseelig’s picture

Thanks very much for this.

I'm running out of time to try to redo all of this, but if I can get back to it today, I'll let you know what happens.

Wyckham

BTW: There is no "bundle" column in my field_config page, but for two rows advpoll is entered in the "type" column and advpoll_field is in the "module" column.

vako’s picture

Since I have this module working ok for me, let me know if you need any DB or other information from me for troubleshooting or comparison purposes.
I am using the Zeropoint theme, not sure if that matters.

What I would also suggest to isolate the issue is to get a new domain with Drupal installed with the default theme and no other modules. If it works, then start adding the other modules one-by-one until you find which one of them might be causing the issue.

Unfortunately we aren't getting any help from the maintainer or other users of this module. It seems neglected.

vako’s picture

Actually the best response you will get if you post this topic in the Post Installation area: https://drupal.org/forum/22 where it will be exposed to all and not only Advanced Poll users. Since it is a DB issue, you might get a solution.

wdseelig’s picture

Thank you Brandon! Deleting those entries from the field_config and field_config_instance tables apparently did the trick. I am now able to create advanced polls, vote in those polls, use the Electoral List, etc.

Hooray!

wdseelig’s picture

Thank you Vako. As you'll see from #22 above, I eventually got this to work. It appears that the issue all along was a [silently] bad installation. I can't, for the life of me, figure out what I did wrong the first time I installed this, but have to conclude that this was mostly MY BAD.

One thing I clearly don't understand, and would like to read about, would be "How to remove a module using unix commands and a database access program". Who knew, for example, that I had to delete entries in the fields_config and fields_config instances tables?

hjulien’s picture

I had the same PDOException as above regarding advpoll_dates not existing. I upgraded from 6.x-1.x-dev to 7.x.3.x-dev. This isn't an issue to do with dev versions is it?

Here's the message I got when I ran update.php:

dvpoll module
Update #7000

Failed: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xxxx_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 /home/xxxxxxxxxx/public_html/sites/all/modules/advpoll/advpoll.install).

dimmie’s picture

Similar problems here, after an upgrade from 6.35 to 7.36.
I had been using advpoll before the upgrade.After (re-)enabling advpoll, I found no way to put my Drupal 7 system in a state which did not require an (impossible) update.

The only way for me to get a functional system was to reload the upgraded data base and, using phpmyadmin, manually remove all entries relating to my (one and only !) ranking poll before dropping the advpoll tables. That cleanup done, I was pretty glad to have only to do it for one poll.

Now that I have a DB free of adv-poll entries or tables, I could try to install advpoll-7.x-3.x-dev, if it helps.

-rg-

jomarocas’s picture

hi, the solutions is, install this patch to core https://www.drupal.org/node/1812056 or install drupal core 7.37 this patch is commit in the next release, later install adv_poll and working.

dont forget uninstall advpoll before apply patch, and later install

dimmie’s picture

It first looked very bad.

Started with a clean DB, no advpoll in sites/all/modules, Drupal @ 7.37.
Unpacked advpoll-7.x-3.x-dev.tar.gz; ran update.php - which ends with an error message. Sorry, message lost.

Tried to enable Advanced Poll itself - Date Popup was automatically enabled too.

Ran update.php, results in error message
==================================
PDOException : SQLSTATE[42S02]: Base table or view not found: 1146 Table 'edusatorg001.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 ( ) dans advpoll_get_poll_info_blocks() (ligne 969 dans /ligo/www/edu7xx/sites/all/modules/advpoll/advpoll.module).
==================================
and site gone off-line !!!

Time for a clean-up, now. Site off-line.

Successively disabling both modules. Attempting to de-install Advanced Poll, then Advanced Poll Field. Ah ! This works, now !
Running update.php - no nasties, *NO* update pending, this time.

Cannot install, but can now deinstall without hammer and wrench. Great !
Assuming the DB cleanup wasn't perhaps thorough enough, and the clean deinstallation had remedied that ...
Restarted the two-step module installation. Ran update.php without a hitch.

Truely, it worked ! Thanks a lot !

cb’s picture

Status: Active » Needs review
StatusFileSize
new801 bytes

For me, this was all happening because the install hook failed.

It failed when creating a table "advpoll_choice_Array" which is obviously not the correct name. After lots of digging and hacking, I discovered the problem was occurring when the fields were being created and this one particular field 'advpoll_choice' was failing.

Rather than install the tables manually, as tempting as that was, I fixed the field definition in the install hook.

Simple, small issue but this has fixed the install process for me. Patch attached.

Status: Needs review » Needs work

The last submitted patch, 28: advpoll-fix-install-errors-2193131-28.diff, failed testing.

cb’s picture

StatusFileSize
new2.37 KB

While my last patch *may* help some of you, its not a silver bullet.

It will get you past the field creation bug but you may run into another error;

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

This is because the indexes combined in that table are greater that the limit imposed by MySQL (In this case 767 bytes.) (Note advpoll_choice_choice is a varchar(500), bundle is varchar(128), entity_type is varchar(128), language is varchar(32) which equals 788. (Please correct me if I'm wrong here as I believe this is how the limit is applied.)

http://mechanics.flite.com/blog/2014/07/29/using-innodb-large-prefix-to-... writes;

The 767 byte limit is per column, so you can include multiple columns (each 767 bytes or smaller) up to 3072 total bytes per index, but no column longer than 767 bytes

I was able to run the install locally but it fell over on dev. After some research I discovered that there is a variable in MySQL allowing larger limits for these indexes and that it was enabled on my local machine (MAMP default perhaps) and not enabled on dev & prod;

mysql> show variables like 'innodb_large_prefix';
+---------------------+-------+
| Variable_name       | Value |
+---------------------+-------+
| innodb_large_prefix | OFF   |
+---------------------+-------+
1 row in set (0.00 sec)

So, we could try to have fewer indexes with smaller sizes or we just increase this variable.

Also cleaned the patch and made sure all indexes were uniform in format.

cb’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 30: advpoll-fix-install-errors-2193131-29.diff, failed testing.

cb’s picture

My patch is against 7.x-3.x not 7.x-2.x hence it is failing.

tripper54’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Needs work » Needs review

ok, let's try that again shall we?

cb’s picture

Considering this issue was about 7.x-2.x I didnt want to change the version merely for testing my patch, discussion was still regarding 2.x.

cb’s picture

New patch.

I had to remove the 'choice' key entirely so I could install this across different instances. Changing the key length limit for me is just not a viable option.

cb’s picture

StatusFileSize
new3.09 KB

Patch

tripper54’s picture

Title: Cannot use Advanced Poll » Advanced Poll fails to install properly depending on DB config
Category: Support request » Bug report
tripper54’s picture

The patch applies cleanly and does what it says. I'm reluctant to mark RTBC though as installation works fine for me with or without this patch.

Interestingly I'm using MAMP, and innodb_large_prefix is OFF.

Another user reported install errors at #2505491: Error at installation! and I have pointed them here. If the patch works for them, I'll RTBC it.

tripper54’s picture

Status: Needs review » Fixed

..and this patch fixed #2505491: Error at installation!. Committed.

  • tripper54 committed 2309f36 on 7.x-3.x authored by cbiggins
    Issue #2193131 by cbiggins: Advanced Poll fails to install properly...

Status: Fixed » Closed (fixed)

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