Jump to content

Images in User Profile.


schafdog27
 Share

Recommended Posts

Hey guys, new user here. Loving everything about processwire so far (It has come my new obsession)! Anyway, I'm having a small issue when I try to add an image field to User Profile. The field shows up in the list but I can't seem to successfully add a photo. It shows up as successfully uploaded on the top of the screen afterwards, but doesn't show up as an added image in the field. Also the "drag and drop" option seems to be missing too.

Now, if I go to Admin->Access->Users->admin and add the photo everything acts normally and I can see it on the user profile page... I just can't modify or add more photos.

I hope I explained that well.

I'm currently running version 2.4 

Any suggestions? I just tested this out in version 2.3.1 on my local computer and it works on that. 

Thanks in advance,

-Mike

Link to comment
Share on other sites

Hi Mike,

Welcome to PW and the forums! In a hurry, so, maybe missing something - maybe the image field is set to accept only 1 image? Change that to "0" to accept multiple. I'm curious, why do you want to add more than one image to a user field? .....

You'll get a better answer soon...:-)

Link to comment
Share on other sites

Hi Mike,

Welcome to PW and the forums! In a hurry, so, maybe missing something - maybe the image field is set to accept only 1 image? Change that to "0" to accept multiple. I'm curious, why do you want to add more than one image to a user field? .....

You'll get a better answer soon... :-)

Thank You! Tried it both ways and neither works when trying to upload to the profile page. The interesting thing is that they are showing up in the assets/files folder on the server just not in the field after I upload. 

Link to comment
Share on other sites

OK, I think I get what you are saying...somewhat...

1. You've edited the admin template (admin/setup/template/admin

2. You've added an image field to the admin template

3. You've gone to admin/page/profile page and added an image there?

Is that it? or is #1 = admin/setup/template/user ? What I am not getting is "user profile". Do you mean the user page?

Also

The field shows up in the list 

What list is this?

Also the "drag and drop" option seems to be missing too.

What does this mean? The text is not visible or it is not working?

I just can't modify or add more photos.

What does modify mean? Delete it?

assets/files folder on the server just not in the field after I upload. 

What do you mean by server? Remote or Local install?

Sorry, just trying to understand exactly what's happening. I have tried adding an image field in my "user" template, then uploaded an image in that field when editing the "superuser" page and it works fine. PW 2.4...

Link to comment
Share on other sites

 

OK, I think I get what you are saying...somewhat...

1. You've edited the admin template (admin/setup/template/admin

2. You've added an image field to the admin template

3. You've gone to admin/page/profile page and added an image there?

Is that it? or is #1 = admin/setup/template/user ? What I am not getting is "user profile". Do you mean the user page?

The image field was added to admin/setup/template/user template and then accessed by the built in 'User Profile' module (Sorry I guess I forgot to mention what user profile meant). After I added the image field to the template I went into the 'user profile' module settings and checked the image field I just added.

What list is this?

I was talking about the fields I added to the profile page by using the User profile module. I had to make the profile page visible to see it in the top nav bar.

What does this mean? The text is not visible or it is not working?

Both, the text is not there and it doesn't upload when you drag an image into the box. The button to browse for a photo is still there, but when I use it and save the page the images don't show up under the images field.

What does modify mean? Delete it?

Yes. I was able to finally upload a photo through admin/access/users/admin which has all the same fields as the profile page. After that it showed up under the image field on the profile page, but I couldn't delete it or add a description (even though the description box did show up under the photo.)

 What do you mean by server? Remote or Local install?

It's a remote server, not local. I think I'm actually going to try to install v2.4 on my local computer and see if I have the same issue.

 Sorry, just trying to understand exactly what's happening. I have tried adding an image field in my "user" template, then uploaded an image in

that field when editing the "superuser" page and it works fine.

Are you talking about admin > access > users > admin(or whatever the superuser is)? If so that worked for me too, I just can't get it to work using the 'user profile' module.

I hope that all makes more sense :).

Thanks again for taking the time to help me.

Link to comment
Share on other sites

Ah...I see you are using this module? http://processwire.com/talk/topic/2567-user-profiles-for-pw/, no?

OK, that's a third party module but hopefully you can get answers here, although it would have been better to post in the modules support forum (it looks quiet over there though...)

EDIT

Ignore above - I got confused :-)

Troubleshooting:

Are you getting any errors? When testing on your local install change config->debug to true. Also check for errors in /site/assets/logs/errors.txt..

  • Like 1
Link to comment
Share on other sites

I now see what you mean...I'll edit this post in a minute :-)

EDIT

1. There are two CORE user modules

a. "Users"

b. "User Profile"

"Users" module has a module settings page that "allows" adding fields. It says "What fields should be displayed in the page listing?". By default, there are three fields - name; email, roles. You can add extra fields here.

"User Profile" has no such settings

OK, so we are dealing with the core module "Users"

You add your field "images" to the module "Users" and press submit. You then go to /setup/access/ "your user name" but you don't see the field you just added, right? Well, I don't know why that is so. I haven't checked the logic behind it, or whether it's a bug...Plus, the user (e.g. "your name" is a page, and it is connected to its template (i.e. "user"). So, fields added to the template show up when editing a page using that template....However....

You can still add an image to a user by adding an image field to the "user" template, i.e. Allow display of system templates, then add your image field to the "user" template. This will then appear for each user when you go to /setup/access/ "your user name". Adding images this way works fine....Which brings me to the question; why not use this route? :-)

  • Like 1
Link to comment
Share on other sites

So I think I "fixed" the issue I was having. Basically, what i did was compare versions 100 and 101 of the User Profile module and found that the processInput functions were different. So I did some testing and copied the entire 101 file into a new module, but changed the processInput function to the one used in the version 100. I then changed the process field on pages -> home -> admin -> profile from ProcessProfile to the new module I just made (called ProcessProfileFix). Now I'm able to upload files directly to the Profile page controlled by the User Profile module.

So I guess there is an issue with the processInput function inside the User Profile module?

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Uploading images to the user profile page had been working for quite some time. Just had a report from a user that they couldn't upload images, and discovered this same issue. 

There are no JS errors, but it acts like a JS issue because ui-state-hover isn't being added when you attempt to drop an image.

I tried the solution schafdog27 mentioned (swapping processInput), but that didn't solve the issue.

The same field works correctly when accessed from the user page. The issue seems isolated to the profile page.

Anyone else able to confirm this before I open a github issue?

Link to comment
Share on other sites

Same behavior on the latest dev (2.4.1) here.

Adrian, just to verify, the issue is only on the user profile page /processwire/profile/

If you add an image(s) field to the user template and then allow it to be edited on the profile page it works as expected?

Link to comment
Share on other sites

Sorry about that - I didn't read properly.

Although testing it on the profile page, the only thing I see that doesn't work is the html5 uploader preview. You can still upload multiple images at once and after page save I can still reorder the images. Anyway, obviously something not quite right!

Link to comment
Share on other sites

Uploading images to the user profile page had been working for quite some time. Just had a report from a user that they couldn't upload images, and discovered this same issue. 

There are no JS errors, but it acts like a JS issue because ui-state-hover isn't being added when you attempt to drop an image.

I tried the solution schafdog27 mentioned (swapping processInput), but that didn't solve the issue.

The same field works correctly when accessed from the user page. The issue seems isolated to the profile page.

Anyone else able to confirm this before I open a github issue?

After swapping the processInut the only way it would upload for me was to choose the files manually and save the page. Dropping the image was still screwed up.

Link to comment
Share on other sites

While uploading should work form the user profile, the Ajax/HTML5 uploader isn't intended to work on the user profile page. Note that it lacks the "drop files in here" label. I'd consider the non ajax upload a little more secure for a user profile, which may be accessible to someone that doesn't have page-edit access.  So ajax/HTML5 upload isn't enabled on the profile editor. On the more technical side, the ajax field capability is a function of ProcessPageEdit, and ProcessProfile isn't built around ProcessPageEdit (since it's intended to be more locked down), so it doesn't inherit that capability.

In testing here, image uploading seems to work (without HTML5/ajax uploader of course). I'm testing on the latest dev branch. Are there any other conditions necessary to reproduce the issue?

Link to comment
Share on other sites

Thanks Ryan. Image uploading is now working on the latest dev (without ajax uploader). So I guess my users (faculty in this case) were always using the upload button. When they reported it wasn't working, I just assumed they meant the drag/drop feature — I never edit my own information from the profile page, so I never realized how it worked. 

Link to comment
Share on other sites

  • 3 months later...

I'm hitting this issue as well, running 2.4.0.  I'm just a couple of weeks away from publishing my site, so I'm a little concerned about upgrading to 2.4.1 dev (not stable) to fix this.  Going into production with a dev version doesn't seem like a good idea.

Any comments on how stable or unstable 2.4.1 dev is?  Are people running it in production?

Alternatively I could go hunting for the fix and patch my version.

Thanks,

  --Sharon

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...