-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Summary
Setting pagefileSecure seems to prevent a user from viewing images in their profile page, even though they have permissions to do so.
Expected behavior
A logged-in user, with correct permissions, should be able to view their profile image in AdminThemeReno when pagefileSecure is true.
Actual behavior
Setting the pagefileSecure flag to true in the config file and then logging in as a non-super-user stops their profile image from showing within their profile page, despite them having permissions that should allow this field to be editable (and even visible) by/to the user. In addition, if you have the option enabled, the Reno Theme fails to show the user avatar in the navigation bar.
Screenshots that demonstrate the issue
Super-user view of a non-super-user user page. All is normal.
The Photo field is setup to allow users to edit it in their own profile permissions...
Yet here is the same page's photo field as seen when the user visits their profile page with pagefileSecure set to true.
A look at the network inspector shows the request for the image is being greeted with a 404.
Suggestion for a possible fix
When following the link the inputfield is generating to fetch the image, I'm seeing the following notice...
Trying to get property of non-object in public_html/wire/modules/PagePermissions.module on line 254
Further investigation shows that this is generated by the following code in the conditional statement on line 254...
$this->wire('page')->process == 'ProcessProfile'
...removing this part of the conditional restores visibility when pagefileSecure is true - yet is probably unsafe as I'm totally ignorant of any side-effects of doing so.
Steps to reproduce the issue
- Add an image field to the user template.
- Set pagefileSecure = true in the config file.
- As super user add an image to a non-super-user's image field.
- Make sure the image field is added to the user's profile privilages.
- In an incognito session, log in on the non-super-user's account and visit the profile.
Setup/Environment
- ProcessWire version: 3.0.105
- PHP version: 7.2