6

I'm creating a new drupal commerce site and I wanted to create a view of all my products.

I didn't want to use Format: content but Format: fields instead. Of course then I needed to add a relationship to get the right fields like price (which are not part of the product display but rather the product itself) in to my view.

All of this worked rather well, I can see my view and it lists the products nicely.

The problem is that only I, the admin, can see the view. Authenticated users and anonymous users are not able to see anything.

As far as I can tell, the query does not display a result for them... (I added a string in the no results behavior section)

I checked all of the permissions needed for this view and made sure that all the content is published and that the view shows published content.

I did notice however that when I remove the relationship, the view does have a result.

I find this rather strange and I cannot find the answer so I turn to you. Is there anyone here who knows what I'm missing?

Thanks in advance

2 Answers 2

5

This is an issue listed in the Drupal Commerce issues queue. http://drupal.org/node/1276450 Its happens when your view has a relationship to a commerce product. I came across this earlier today when I was doing the same thing as you.

Two different solutions are suggested at comments 5 and 6 on the issues page. The first is to disable SQL rewriting under the Advanced > SQL Settings section of the view. This can have security implications if your using contextual or exposed filters. The other suggestion is give all user roles the 'View any product of any type' permission under permissions. This is what worked for me.

1
  • 1
    Thank you for your reply. It worked. I did choose to use the 'disable sql rewriting' option because I'm not using any contextual or exposed filters. It seems to me that might be a little more secure?
    – Mike
    May 1, 2012 at 17:42
3

I have the same problem with views in Drupal commerce. One thing that helped me was to go to the view and go to Query Settings and Disable SQL rewriting. You can see more information about this problem in this link. I like #55 explanation. If this works be sure to figure it out what are the implications of turning off the query rewriting for your case.

http://drupal.org/node/1276450

[updated]

According to the link in #98 that the right solution is to grant users the "view any product of any type privilege" permission. And also says and I quote:

"It has a security warning, which is a mistake on our part, and the warning should be removed." from bojanz

I change my setting to the recommendation of bojanz and it worked perfectly

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.