Access denied backtrace use to work very well on my site, but now when I look at it, there is nothing in the Backtrace field.

I use Workbench and Nodeaccess to control who can edit various pages. Is there some compatibility issue with one of those that might be causing this problem?

Comments

thim’s picture

Same issue.

New Drupal 7 setup, with ADB enable and configured but no backtrace in the access denied logs

rar’s picture

Got the same issue -

Code looks for $log_entry['type'] = "access denied" but Drupal 7 generates

$log_entry['type'] => page not found

Look in function adb_watchdog($log_entry) to change

bendiy’s picture

The documentation is outdated. You cannot see this from '/admin/reports/dblog'. It's now at: '/admin/reports/access-denied/backtrace'.

ikeigenwijs’s picture

Still no dat ain the backtrace.not on
/admin/reports/access-denied/backtrace

or in the reports

drupalmoff’s picture

The link to the backtrace is actually there, just has no text between the a tags to let the user click on it. If you inspect the table within your browser, you can get to the link.

EDIT: I don't have much time to discuss this, but the problem lies within _ddebug_backtrace not returning anything, as

variable_get('error_level', 1) >= 1

seems to always be false. A quick solution for me was to return $backtrace just before the function closes.

I also believe that

    $user_role_permissions = (isset($role_permissions[$log_entry['uid']])?$role_permissions[$log_entry['uid']]:array());

should be

    $user_role_permissions = (isset($role_permissions)?$role_permissions:array());

although I could be wrong. Just my quick thoughts.

msypes’s picture

Thanks bendiy & drupalmoff!
That worked. Knowing where the info should be was helpful of course.
I don't have "error_level" in my database, at least not on dev, so it's no wonder that conditional returned false. I just removed the if altogether.

truyenle’s picture

Did you commit it. I still see no access denied backtrace stuff.

unqunq’s picture

@truyenle you need to enable "Errors and warnings" at /admin/config/development/logging
then visit /admin/reports/access-denied/backtrace

RAWDESK’s picture

It is indeed /admin/reports/access-denied/backtrace you have to visit.
Should be added to project's documentation.

kmonty’s picture

Title: No data in backtrace » Access Denied Backtrace Documention is Badly Outdated and Could Use Updating
Component: Miscellaneous » Documentation
Assigned: ncarty97 » Unassigned
Category: Bug report » Task
Priority: Normal » Major