-
- 24,544 Posts
Sorry, I didn’t notice that the plugin was using $doc instead of $resource.
It should be this:
if ($doc->get('published') == false || $doc->get('deleted')) {
$modx->sendErrorPage();
}
-
- 9 Posts
It works. But now even the Administrator is not able to watch unpublished pages. Do you have any idea what could be the reason for this strange behavior when activating the plugin?
Many thanks
Inka
-
- 24,544 Posts
I don’t, but try this:
if ($doc->get('published') == false || $doc->get('deleted')) {
If (! $modx->user->hasPermission('view_unpublished') ){
$modx->sendErrorPage();
}
}
-
- 24,544 Posts
Quote from: Inka27 at May 22, 2011, 08:49 PM
Hi Bob,
thanks a lot. Just one thing: There seems to be a little mistake in this line:
if (! $modx->user->hasPermission('view_unpublished')) {
resulting in this error
Call to undefined method modUser_mysql::hasPermission()
Is there anything I still have to adapt?
Oops again. I posted that from my phone when I was half-awake. Try this instead:
if (! $modx->hasPermission('view_unpublished')) {
-
- 9 Posts
Thank you very much, Bob, you helped us a lot.
With this solution everything works very well now!!!
One last question: do you think that this error could be considered as a bug
and therefore should be reported - or is it rather an individual problem
which only occurs within our website?
Again: Thanks a lot, we appreciate your help very much!
Inka
-
- 24,544 Posts
I would say it’s a bug, but a bug in the plugin rather than MODX. You should report it to the author of the plugin, if possible.