XF 2.1 hasPermission integer giving double value

hemant_bhardwaj

Well-known member
when using Permission integer it work under 1 to 4 but when i put value of 6 or more it's give value 66

input
1568208033873.png
output

1568208078456.png

any idea why ?
 
I don't particularly know why, but I will say now it's very unlikely to be a bug so I will move this to Dev discussions for further support.
 
I don't particularly know why, but I will say now it's very unlikely to be a bug so I will move this to Dev discussions for further support.
thanks for moving it but its strange to see the output

this is what i am doing

$updates_time = $visitor->hasPermission('resource', 'updateinaday');
echo $updates_time;

set value is 6 and getting 66 :(
 
I can only assume that wherever you're echoing it is echoing it twice, for some reason. Perhaps that code is being executed twice or you have it echoing out somewhere else.

I don't have a lot of time today so hopefully someone else will provide more assistance if it is required.
 
The permission is being called twice. To prove it, try this:

$updates_time = $visitor->hasPermission('resource', 'updateinaday');
echo $updates_time . 'hello_world';
 
Back
Top Bottom