Hi dormasta,
I looked through the
respective video from Llewellyn and found the related situation. I had created the site view from antoher working view, but I forgot in the joomla configuration settings to allow this respective site view to open for public access. As you my see in below screenshot, I went to Joonmla Configuration page and chose my component and activated the permission tab. You may see in the screenshot below that I did enable the public access at this point from where it is inherited.
When I had cloned my second site view, it was actually a copy but a new entry in the permissions which is by default disabled. After I had switched the cloned site view as well to enable it all worked fine. In the video it's explaind that this is Joomla behaviour by default. It could be automated by a post install script (which I will not need in my app).
However all above applies when you get the error message that access to the view in general is not allowed. When you get the error message you stated above "Not found or access denied", the reason may be a different one as it was in my case. My dynamic get which feeds into the site view is based on a base main table another table joined by an outer join. As it was an outer join, I didn't expect to have any problems here. But I had activated a filter to search for records with published = 1 not only in th emain tables but as well in the joined table. This was causing that the query would somtimes not pull any data - actually in these cases when there was no match in the outer joined table.
My solution was to apply a null value subsitution. I chnaged the original clause
"where b.published = 1"
into
"where IFNULL(b.published,1) = 1"
so that this filter is still appplied for matching records which solved the problem on my end.
Now my query returns valid records in all cases and the mentioned error message doesn't appear anymore.
Cheers,
Oliver