This error occurs when trying to load the "Not in database" report, if the Restrict By IP module is also enabled:
Argument 6 passed to Drupal\auditfiles\ServiceAuditFilesNotInDatabase::__construct() must be an instance of Drupal\Core\Session\AccountProxy, instance of Drupal\restrict_by_ip\Session\AccountProxy given
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3261115-7.patch | 1.88 KB | victoria-marina |
| #3 | 3261115-3.patch | 2.41 KB | victoria-marina |
Issue fork auditfiles-3261115
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
victoria-marina commentedI'll work on this.
Comment #3
victoria-marina commentedHere is a patch, please review it.
I've also fixed the error below that was showing on tests.
Comment #4
wrd-oaitsd commentedWith the patch, I can now load the report successfully. Thanks for the quick fix!
Comment #5
gaurav.kapoor commentedThe patch doesn't apply to the latest development release 8.x.3.x as class 'ServiceAuditFilesUsedNotReferenced' already has a use statement added for 'EntityTypeManagerInterface'. So only changes related to changing 'AccountProxy' to 'AccountProxyInterface' in 'ServiceAuditFilesNotInDatabase' should be fine here.
Marking it as needs work, so that patch can be rerolled to work with 8.x-3.x branch. Website using stable releases can use the patch provided in #3 to get rid of this error.
Comment #6
gaurav.kapoor commentedThe patch does apply cleanly only on 8.x-2.x though, so it will require application as well as fixing code conflicts among various releases.
Comment #7
victoria-marina commentedHi @gaurav.kapoor
Here is a patch for the 8.x-3.x branch.
Comment #8
gaurav.kapoor commentedComment #9
dpiComment #12
dpiFixed in #3313394: Audit Files should typehint interfaces rather than a specific implementation for 4.x branch.
I've updated and merged the patch here for 3.x.
The 2.x branch is deprecated.