User attribute: image ... user can't edit on profile page

Permalink
I've added an image attribute for Users, and it works fine... except when I try to make it editable on the user profile page.

What I see is the spinner graphic, and the "Choose Image" never loads.
I tried different permutations of permissions on the File Manager > Access page, with no success.
The image chooser appears as expected if Registered Users have Write permissions on the Profile page, but obviously that is not an option.

How can I make it so the User can edit their image attribute (NOT avatar)?

kirkroberts
 
zoinks replied on at Permalink Reply 1 Attachment
well, maybe you figured this out. Any idea how to get rid of everything on the sidebar? I managed to remove the members search form, but the rest of this stuff on the sidebar, I want to delete except "Client since...". (attached file)
garrycl replied on at Permalink Reply
garrycl
I am having exactly the same problem - image file upload from the Profile Edit page.

Have been trying to add as much Javascript and CSS from the Dashboard as possible. However, will keep trying that process.
kirkroberts replied on at Permalink Reply 2 Attachments
kirkroberts
I got it working more or less. It was kind of complex and it's possible I did it in a non-efficient way, but I'll attach the files and maybe you can parse it for your own use.

Note that both files are named "edit.php".
The file with "class ProfileEditController" goes into /controllers/profile/edit.php
The other file goes into /singe_pages/profile/edit.php

The attribute for the profile image was handled "image" (as you'll see in the files).

Good luck!
garrycl replied on at Permalink Reply
garrycl
Thanks Kirk :)

Just posted to the other thread before visiting here.

Thank you. I will check it out.

All the best.

Garry
garrycl replied on at Permalink Reply
garrycl
My problem was that I was not giving Registered Users "write" permission on the "Profile" page. After which, of course, the Dashboard tool bar appeared. I was able to hide it with:
$(document).ready(function() { $("#ccm-page-controls-wrapper").hide();});
placed in the "/single_pages/profile/edit.php" and "/single_pages/profile/view.php" scripts.

All the best.

Garry
kirkroberts replied on at Permalink Reply
kirkroberts
Glad you got it working!
Curious: did you need to use the code I attached or did it work "out of the box" after you updated the permissions?

EDIT:
I assume also that this means that *everyone* does not have a site toolbar when on the edit page (even those who really are supposed to be able to use it, like the superuser). That's acceptable collateral damage if your solution is as simple as it sounds!
garrycl replied on at Permalink Reply
garrycl
Kirk,

It did work "out-of-the-box" once I changed the permissions. However, the bottom "Save" button still needs to be clicked to record the uploaded images to the User Attributes. Hence, some additional code may be worthwhile to "automatically" update the relevant User Attributes.

The Profile/edit page will be highly stylised from within the "edit.php" script. So, having the Dashboard bar will not be a problem for this application (I hope).

All the best.

Garry
kirkroberts replied on at Permalink Reply
kirkroberts
Very glad to know this is an option. Thanks for following up!

I faced a similar problem with image selection not equaling image saving and opted to simply put a message like "you must click the Save button to save your profile changes".