Jump to content

Editing own's profile and own's content


Guy Verville
 Share

Recommended Posts

Hi,

This question is perhaps dumb. How can a user change his/her profile? I get this empty window when logged as un regular user.

post-1691-0-46639600-1416241733_thumb.pn

The fields are set to be vewable in the User template.

post-1691-0-98144200-1416242172_thumb.pn

There will be numerous users that will be able to write blog entries. What if I want to restrict tue editing to own's content?  In the following example, the user logged is not the author of the page. So he shouldn't be able to edit it.

post-1691-0-42308800-1416241893_thumb.pn

Link to comment
Share on other sites

I don't think so. Well, I don't remember if this image field was already set before I removed the module. I will certainly send a link to fetch the entire site to the Processwire team if they are interested of finding the cause of this mysterioius error. This is certainly an area to be looked at for improvement. I will anyway post something about the problem I see to have just one user template for two kind of operations (user admin and profile edit. There is only one context for both usages).

Link to comment
Share on other sites

From the error. Looks like you have a field dependency on a field using "role" field. First, "role" isn't a field but "roles". Second, roles aren't shown on when you view/edit your profile. It's not the same as editing a user.

  • Like 2
Link to comment
Share on other sites

Hello, Soma, you were right for the role which was set wrongly. However, the problem persists with my image field. I even checked the data (with the useful button found in the form) and PW saids it was ok. I compared my field with the already installed images field, and copied exactly the same settings for my image field, but to no avail. When I removed my field from the user template, everything went back to normal! So my solution will be to recreate the field since it seems definitively corrupted.

Kongondo, the field is called professionnel_photo

Link to comment
Share on other sites

I found by searching the forum for your image name "professionnel_photo" that it is a crop image (apeisa thumbnail) field. CropImage isn't compatible with user profile page editing.

I tried adding a cropimage to user template and make it editable on the profile. It works fine but after trying to add an image I get same error as your's and can't edit profil anymore.

  • Like 2
Link to comment
Share on other sites

Issue seems with InputfieldCropImage.module rendering and testing if user is allowed to edit the current page, which is not there. It's not on context of a page edit. User profile doesn't have a "page" editing with an url param "id". Even if, the user isn't allowed to edit "user” page.

ProcessProfile #67 fails

$inputfield->value = $this->user->get($field->name);

InputfieldCropImage.module in renderItem() fails and throws empty exception

$page = $this->pages->get((int) $this->input->get->id);
if(!$page->id || !$page->editable()) throw new WirePermissionException(); // empty
  • Like 1
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

×
×
  • Create New...