Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 558821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:10:19+00:00 2026-05-13T12:10:19+00:00

I’m getting duplicate nodes in a a view I’ve created in Drupal. It appears

  • 0

I’m getting duplicate nodes in a a view I’ve created in Drupal. It appears the issue is related to the way the join is done in views for the node_access table.

Using devel, I see the following query:

    SELECT node.nid AS nid,
           node.language AS node_language,
           node_data_field_weekend.field_weekend_value AS node_data_field_weekend_field_weekend_value,
           node_data_field_weekend.field_weekend_value2 AS node_data_field_weekend_field_weekend_value2,
           node.type AS node_type,
           node.vid AS node_vid,
           node_data_field_weekend.field_weekend_loc_nid AS node_data_field_weekend_field_weekend_loc_nid
      FROM node node
 LEFT JOIN content_type_wwme_weekends node_data_field_weekend ON node.vid = node_data_field_weekend.vid
INNER JOIN node_access na                                     ON na.nid = node.nid
     WHERE (na.grant_view >= 1 AND
           (
           (na.gid = 0 AND na.realm = 'all') OR
           (na.gid = 0 AND na.realm = 'domain_site') OR
           (na.gid = 0 AND na.realm = 'domain_id'))) AND
           (
           (
           (node.type IN ('wwme_weekends')) AND
           (node.status <> 0 OR
           (node.uid = 0 AND 0 <> 0) OR 0 = 1)) AND
           (DATE_FORMAT(STR_TO_DATE(node_data_field_weekend.field_weekend_value, '%Y-%m-%dT%T'), '%Y-%m-%d') > '2010-01-10') )
  ORDER BY node_data_field_weekend_field_weekend_value ASC LIMIT 0, 5

The join to the node_access table is causing the other records to duplicate because there are multiple node_access records to a node, one with the realm of domain_site and one record with the realm of domain_id.

The data sort of looks like this (with some columns cut for brevity):

nid     gid    realm        grant_view  grant_update    grant_delete
73      0      domain_id    1           1               1
73      0      domain_site  1           0               0
988     0      domain_id    1           1               1
988     0      domain_site  1           0               0
90      0      domain_id    1           1               1

What purpose does the realm fit? How are these records populated, and most importantly, how can I fix this? Is the SQL right?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:10:20+00:00Added an answer on May 13, 2026 at 12:10 pm

    The answer apparently was a lot more mundane than I was thinking:

    Use the “distinct node” configuration option under views, this takes out dupes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 379k
  • Answers 379k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Ok, I was wrong. When I ran it the first… May 14, 2026 at 9:42 pm
  • Editorial Team
    Editorial Team added an answer I suspect that you've included the JPA API jar in… May 14, 2026 at 9:42 pm
  • Editorial Team
    Editorial Team added an answer Set the project ToolsVersion to 4.0 in your msbuild file… May 14, 2026 at 9:42 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.