processwire-issues icon indicating copy to clipboard operation
processwire-issues copied to clipboard

Argument #1 ($page) must be of type ProcessWire\User, ProcessWire\Page given

Open adrianbj opened this issue 3 years ago • 0 comments

Short description of the issue

If you try to visit: /access/users/edit/?id=xxxx where the ID is that of a valid page, rather than a user, then you get this error in ProcessUser.module on line 352

Expected behavior

I would expect to see the "Unknown Page" error like you do when the ID is for a page that doesn't exist at all.

Actual behavior

The error noted in the title

Also, just wondering - if you try to edit a page via page/edit/?id=xxxx but the ID is for a user then it redirects to /access/users/edit/?id=xxxx. Should it also work in reverse?

adrianbj avatar May 18 '22 15:05 adrianbj