I created a view (block) that shows nodes of a certain type (seotag's) created by the logged in user.

It shows doubles though; every node is shown twice, except if logged in as Administrator. Standard 'Recent posts' also show double if not loggin in (anonymous).

If I give authenticated users the rights to 'administer nodes' in user rights/permissions, the doubles are gone when they re logged in, BUT the authenticated users are also allowed to create other content types (pages, stories, ...).

Right now in permissions, they only have rights to

- create seotag content
- delete own seotag content
- edit own seotag content

How do I alter the view or the permissions so the view doesn't show each seotag twice ???

I know the 'Distinct: Yes' explains it doesn't always work, but how do I solve it ?

Here's an export of the view:

<?php
$view = new view; 
$view->name = 'own_content'; 
$view->description = 'own seo-tags'; 
$view->tag = ''; 
$view->view_php = ''; 
$view->base_table = 'node'; 
$view->is_cacheable = FALSE; 
$view->api_version = 2; 
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ 
$handler = $view->new_display('default', 'Defaults', 'default'); 
$handler->override_option(
	'fields', array( 
		'title' => array( 
			'label' => 'Titel', 
			'alter' => array( 
				'alter_text' => 0, 
				'text' => '', 
				'make_link' => 0, 
				'path' => '', 
				'link_class' => '', 
				'alt' => '', 
				'prefix' => '', 
				'suffix' => '', 
				'target' => '', 
				'help' => '', 
				'trim' => 0, 
				'max_length' => '', 
				'word_boundary' => 1, 
				'ellipsis' => 1, 
				'strip_tags' => 0, 
				'html' => 0, ), 
				'empty' => '', 
				'hide_empty' => 0, 
				'empty_zero' => 0, 
				'link_to_node' => 1, 
				'exclude' => 0, 
				'id' => 'title', 
				'table' => 'node', 
				'field' => 'title', 
				'relationship' => 'none',
				),
			)
	); 
$handler->override_option(
	'arguments', array( 
		'uid' => array( 
			'default_action' => 'default', 
			'style_plugin' => 'default_summary', 
			'style_options' => array(), 
			'wildcard' => 'all', 
			'wildcard_substitution' => 'Alle', 
			'title' => '', 
			'breadcrumb' => '', 
			'default_argument_type' => 'current_user', 
			'default_argument' => '', 
			'validate_type' => 'user', 
			'validate_fail' => 'summary asc', 
			'break_phrase' => 0, 
			'not' => 0, 
			'id' => 'uid', 
			'table' => 'users', 
			'field' => 'uid', 
			'validate_user_argument_type' => 'either', 
			'validate_user_roles' => array( 
				'2' => 2, 
				'3' => 0, 
				'4' => 0, 
			), 
			'relationship' => 'none', 
			'default_options_div_prefix' => '', 
			'default_argument_user' => 0, 
			'default_argument_fixed' => '', 
			'default_argument_php' => '', 
			'validate_argument_node_type' => array( 
				'page' => 0, 
				'seotag' => 0, 
				'story' => 0, 
				), 
			'validate_argument_node_access' => 0, 
			'validate_argument_nid_type' => 'nid', 
			'validate_argument_vocabulary' => array(), 
			'validate_argument_type' => 'tid', 
			'validate_argument_transform' => 0, 
			'validate_user_restrict_roles' => 1, 
			'validate_argument_php' => '', 
			'override' => array( 
				'button' => 'Override',
			), 
		), 
	)); 
$handler->override_option(
	'filters', array( 
		'status' => array( 
			'operator' => '=', 
			'value' => '1', 
			'group' => '0', 
			'exposed' => FALSE, 
			'expose' => array( 
				'operator' => FALSE, 
				'label' => '',
			), 
		'id' => 'status', 
		'table' => 'node', 
		'field' => 'status', 
		'relationship' => 'none',
		), 
	)); 
$handler->override_option(
	'access', array( 
		'type' => 'domain', 
		'domains' => array( '0' => -1, ), 
		'domain_strict' => FALSE, 
		'domain_member' => FALSE, 
	)); 
$handler->override_option(
	'cache', array( 'type' => 'none', )); 
$handler->override_option('distinct', 1); 
$handler->override_option('exposed_block', TRUE); 
$handler = $view->new_display('block', 'Blok', 'block_1'); 
$handler->override_option(
	'arguments', array( 
		'uid' => array( 
			'default_action' => 'default', 
			'style_plugin' => 'default_summary', 
			'style_options' => array(), 
			'wildcard' => 'all', 
			'wildcard_substitution' => 'Alle', 
			'title' => '', 
			'breadcrumb' => '', 
			'default_argument_type' => 'current_user', 
			'default_argument' => '', 
			'validate_type' => 'user', 
			'validate_fail' => 'empty', 
			'break_phrase' => 0, 
			'not' => 0, 
			'id' => 'uid', 
			'table' => 'users', 
			'field' => 'uid', 
			'validate_user_argument_type' => 'uid', 
			'validate_user_roles' => array( 
				'2' => 2, 
				'3' => 0, 
				'4' => 0, 
				), 
			'relationship' => 'none', 
			'default_options_div_prefix' => '', 
			'default_argument_user' => 0, 
			'default_argument_fixed' => '', 
			'default_argument_php' => '', 
			'validate_argument_node_type' => array( 
				'page' => 0, 
				'seotag' => 0, 
				'story' => 0, 
				), 
			'validate_argument_node_access' => 0, 
			'validate_argument_nid_type' => 'nid', 
			'validate_argument_vocabulary' => array(), 
			'validate_argument_type' => 'tid', 
			'validate_argument_transform' => 0, 
			'validate_user_restrict_roles' => 0, 
			'validate_argument_php' => '', 
			'override' => array( 
				'button' => 'Use default', 
				), 
			), 
		)
	); 
$handler->override_option('items_per_page', 25); 
$handler->override_option('block_description', ''); 
$handler->override_option('block_caching', -1);
?>

Comments

ludo1960’s picture

Dont know if this helps, but try making a page display using distinct (Yes) to see if the problem persists. Then take it from there.

reizigertje’s picture

No, the page display doesn't change a thing.

I just found out in 'recent posts' users that have logged in get to see all posts double as well. Only changing the rights to 'Administer Nodes:Yes' results in single 'recent posts' and 'own seotags'.

How do I give users rights to administer nodes but only of one node type ?

Could it have anything to do with the domains and subdomains module that are installed ?

ludo1960’s picture

I remember having some issues with the subdomain module also, all I can suggest is you disable modules one by one and test (a drag I know!, but cant think of anything else to try)

reizigertje’s picture

when I disable the subdomains module, I only get single results both in recent posts and in 'own seotags', my view.

Thing is, users should only be able to create one node type, i.e. seotags, and those are taken as subdomains. So somebody creates 'test' as a seotag, the pathauto creates the path to this node as 'test.domain.com'.

Works as a charm, and in the database all nodes are single, but they all show twice in the views, both in recent posts (standard view of Drupal) and in my 'own seotags' view...

ludo1960’s picture

Anything in the issue queue for the subdomain module?

reizigertje’s picture

I posted the same question there, because I didn't find anything yet

http://drupal.org/node/714008

Lars Vandergraaf’s picture

I was having the same trouble, and when I gave the role permissions to Administer Nodes: Yes it fixed the problem. Anonymous and Admin did not see the problem. I do not use the sub domain module.

Thanks!

By the way, it was not all content in the view that was doubling, some of the events and some of the picture galleries. I create my own frontpage via view and some of the events and some of the galleries did this, I have recently added several modules so I dont know if this feature was a side effect from one of them.

reizigertje’s picture

I want to have node types that only the admin can create or edit, and if you allow authenticated users to administer nodes, they get rights to all node types, even if the separate node type permissions are off. How to solve that then ?

reizigertje’s picture

Creating a separate module for this did the job. That way you can write your own SQL, of course. Actually not a solution but a 'workaround' :-)