Problem with search conditions

Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
7 years ago
224 posts
Hi.
I have a problem to exclude items from a specific user.

{jrCore_list
module="jrYouTube"
order_by="_created desc"
search="profile_id != 1"
template="video_row.tpl"
pagebreak="25"
page=$_post.page
}

In this Example i want to exclude all youtube items from that Video List.
This works... but many hundreds of other Videos from other users are excluded too.

I tried different search conditions. It also doesn't work with search1="profile_id !=1" and search="profile_id > 1"

And i get different output for this list when i logged in as admin or as a normal user.


by the way, before you ask me, actually my cache is deactivated
updated by @bandwerkstatt: 04/26/17 02:33:21PM
michael
@michael
7 years ago
7,714 posts
not clear on the goal. You want all Youtube videos except if the video is from profile_id 1 correct?
michael
@michael
7 years ago
7,714 posts
Your jrCore_list call looks like it should be working fine to me.
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
7 years ago
224 posts
this ist correct.
what i exactly want to do, is to create two lists. One with the youtube videos from the users, and one list with videos from the admin.

The List with the Admin Videos is working.
{jrSeamless_list
modules="jrVimeo,jrYouTube"
order_by="_created desc"
template="video_row.tpl"
search="profile_id = 1"
pagebreak="25"
page=$_post.page
}


But the Video List with all other users is not working correctly
michael
@michael
7 years ago
7,714 posts
left hand column
{jrCore_list
module="jrYouTube"
order_by="_created desc"
search="profile_id != 1"
pagebreak="25"
page=$_post.page
} 
Right hand column
{jrCore_list
module="jrYouTube"
order_by="_created desc"
search="profile_id = 1"
pagebreak="25"
page=$_post.page
} 

Try taking out your row template and see what it returns when using the default. Could be an issue with your row template.

Also the admin user viewing the list WILL see any items from private profiles, whereas normal users will not, so that could be the difference you see in the lists.
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
7 years ago
224 posts
first i tried it with another checkbox form field that was only visible for the admin.
i called it "admin_tv"

i tried to exclude that with search="admin_tv != on" but the list output excluded all other items that not saved admin_tv to the database
michael
@michael
7 years ago
7,714 posts
Yeah that wont work for sure. There is no datastore with the prefix 'admin_' and even if there was, the modules datastore that you are searching on is the jrYouTube module, so its datastore is prefixed with 'youtube_'.

your search="...... must line up with a field on the datastore. maybe you called it 'youtube_admin_tv' perhaps if you added that field to the youtube modules form via the Form Designer.
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
7 years ago
224 posts
Now i have tried it with the default template


only videos from profile id 1 (admin): This is working fine "admin video.png"
{jrCore_list
module="jrYouTube"
order_by="_created desc"
search="profile_id = 1"
pagebreak="25"
page=$_post.page
}

exclude profile id: the last two videos are missed!!! "exclude profile_id 1.png"
{jrCore_list
module="jrYouTube"
order_by="_created desc"
search="profile_id != 1"
pagebreak="25"
page=$_post.page
}

without search conditions: All videos are visible!!! "without search.png"
{jrCore_list
module="jrYouTube"
order_by="_created desc"
pagebreak="25"
page=$_post.page
}
admin video.PNG.png
admin video.PNG.png  •  316KB


without search.PNG.png

Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
7 years ago
224 posts
I tried it again whith youtube_admin_tv, now this is working. But when i try to exclude a profile ID there are a lot videos from other users not been listed.
michael
@michael
7 years ago
7,714 posts
That sounds like its working as expected. What is the issue. What does "the last two videos are missed!!!" mean?
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
7 years ago
224 posts
the last two videos from the second image are not the videos that they had to be. These are old videos and there are round about 50 videos that are not listed
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
7 years ago
224 posts
i have solved my search condition over the youtube_admin_video search. But the other problem is not resolved. it does not work with profile_id != 0 . it excludes more as it should
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
7 years ago
224 posts
Now i see when i'm not logged in... the newest 8 or 9 videos are not listet und the next videos are roundabout 1 1/2 years old

I don't know what i can do. i know it must be working. but it doesn't
Its allways the problem when i use !=

from 126 items it shows only 56
updated by @bandwerkstatt: 01/17/17 03:38:59PM
michael
@michael
7 years ago
7,714 posts
If you can provide steps for me to check out what you believe to be an issue, I can follow those steps on my dev site and see if I can reproduce the issue.

There will be no profile_id 0 so adding search="profile_id != 0" has no purpose, might as well not put it there at all.
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
7 years ago
224 posts
sorry... my mistake... i mean ID 1 for admin...

All I have done is already in the post above. I do not get the results that should be

{jrCore_list
module="jrYouTube"
order_by="_created desc"
search="profile_id != 1"
pagebreak="25"
page=$_post.page
}

80 video results are missing
brian
@brian
7 years ago
10,148 posts
This needs to be:

search="_profile_id != 1"

Note the added underscore BEFORE "profile_id".


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
7 years ago
224 posts
brian:
This needs to be:

search="_profile_id != 1"

Note the added underscore BEFORE "profile_id".

Thank you Brian. since the last search update it is working better.
Now I can search for "_profile_id = 1"
i can say "_profile_id > 1"
But "_profile_id !=1" takes no effekt to the search. All Admin Items have been listed.

Greetings
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
7 years ago
224 posts
@brian

Hope you read it. Thanks :)
douglas
@douglas
7 years ago
2,790 posts
Give this a try:

{jrCore_list
module="jrYouTube"
order_by="_created desc"
search="profile_id not_like 1"
pagebreak="25"
page=$_post.page
} 

Hope this helps!

EDIT:
BTW You can find the search conditions here: https://www.jamroom.net/the-jamroom-network/documentation/jamroom-developers-guide/89/jrcore-list#search-conditions


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

updated by @douglas: 01/24/17 12:37:13PM
brian
@brian
7 years ago
10,148 posts
This SHOULD work:

_profile_id != 1

Make sure you have a SPACE between "!=" and "1".


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
michael
@michael
7 years ago
7,714 posts
brian:
This SHOULD work:

_profile_id != 1

Make sure you have a SPACE between "!=" and "1".

That is working for me here.

Tags