Developer forum

Forum » Development » Using Repository.SelectByAreaId from proces

Using Repository.SelectByAreaId from proces

Remi Muller
Reply

The following code is reflected from "Dynamicweb.Content.Items.Queries"

"public virtual IEnumerable SelectByAreaId(int areaId, Query query, bool includeParagraphs)"

............

if (!PageView.Current().Security.IsPageProtect(page))"

 

With dw version 8.2.2.7 i was using the method SelectByAreaID to get all itemtypes from a custom background process.
Since dw version 8.2.3.3 this is not working anymore because it assumes the code is executed on a pageview.
At least this is one of the problems. I am not able to debug the dw code.

Shouldn't it be possible to use the items api from a proces instead of asuming the code is run on a pageview in the dw process?
Can dw fix and support this kind use of the api?
It would be a shame if i had to fallback to direct database access.


Replies

 
Vladimir
Reply
This post has been marked as an answer

Hi Remi,

I sorry for the inconvenience,
I see now, this code requires some refactoring.

But you shouldn't fallback to direct database access endeed!,
try to use overloaded function SelectByAreaId(int areaId, Query query, bool includeParagraphs, bool checkPermissions) with parameter checkPermissions = false

 

Best regards,

Vladimir

 

Votes for this answer: 1
 
Remi Muller
Reply

Sounds like a plan. Unfortunately i do not see the overloaded method with checkPermissions. I checked this with dw 8.2.3.8

Which version should i use, is this something from 8.3?

 
Vladimir
Reply
This post has been marked as an answer

indeed.. it is exists only in 8.3, I will add the same in 8.2.3 with nearest hotfix

Best regards,
Vladimir

 

Votes for this answer: 1

 

You must be logged in to post in the forum