The {election_ballot} table should be exposed to Views.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Liam Morland created an issue. See original summary.

Liam Morland’s picture

Assigned: Liam Morland » Unassigned
Status: Active » Needs review
FileSize
4.12 KB
pjcdawkins’s picture

Status: Needs review » Needs work

Agreed on the feature and thanks for the patch... I have a few comments.

  1. +++ b/election_vote/election_vote.views.inc
    @@ -39,6 +39,125 @@ function election_vote_views_data() {
    +      'title' => 'Ballot Id',
    

    I think the title and help values should be wrapped in t()

  2. +++ b/election_vote/election_vote.views.inc
    @@ -39,6 +39,125 @@ function election_vote_views_data() {
    +        'click sortable' => FALSE,
    

    I don't see a specific reason to disable click sorting on this or most of the other fields. Makes sense for the MD5 hash, but for the other fields click sorting seems like a reasonable thing to do.

  3. +++ b/election_vote/election_vote.views.inc
    @@ -39,6 +39,125 @@ function election_vote_views_data() {
    +        'handler' => 'views_handler_field_numeric',
    

    This (abstain) should probably be views_handler_field_boolean.

Liam Morland’s picture

Status: Needs work » Needs review
FileSize
3.87 KB

Thanks.

pjcdawkins’s picture

Status: Needs review » Fixed

Committed. I tweaked the wording of some things, hope you don't mind.

OpsTao’s picture

I am trying to get the advantage of the latest Dev version to get the patch changes, but unable to get the module to update properly, it appears. After using the usual method I used for all other module updates, and finding there were several DB updates to be applied and were applied, the site's module list is still reporting version 7.x-1.0-beta27+9-dev and I don't find new options in Watchdog Views. (I assume I should be seeing them there?) Suggestions?
--Thanks--

Liam Morland’s picture

I've never used Watchdog Views, so I don't know what it ought to display. The change in this issue just makes election_ballot data available in Views, so one can make a View showing who voted.

pjcdawkins’s picture

@OpsTao beta27+9-dev is the latest version, that's fine. It's not taking data from Watchdog, it's getting it directly from the ballot table. Create a new View (in Admin -> Structure -> Views) which shows "Election ballots".

OpsTao’s picture

OK, I am partly there now, but stuck on this: from what I see, the View can only show the User ID and Post ID by the value known by the site's code. In order for the list to be useful to the client, I am hoping to substitute the Username for User ID, and listed Post Name for Post ID in a table view. Possible, and if so, hints on how to get there?

--UPDATE--
Never mind, I think I see it now: Add the needed relationships to the View, then those fields become available to add in the Fields section of the View.

Status: Fixed » Closed (fixed)

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