Guy Verville

Editing own's profile and own's content

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

Share this post


Link to post
Share on other sites

I can add this. Even the super user I am can't see directly the profile page...

post-1691-0-39785800-1416250508_thumb.pn

But I can  by going here

post-1691-0-09254000-1416250588_thumb.pn

I'm lost!

Share this post


Link to post
Share on other sites

Works fine here. Nor sure, any custom modules messing with it?

Share this post


Link to post
Share on other sites

Nothing fancy...

  • InlineEditor
  • ImportPagesCSV
  • Thumbnails
  • ProcessRedirects
  • FormBuilder
  • InputfieldCKEditor

I did however tried the Blog module, but removed it. Had it corrupted some process? I hope not...  

The site is bilingual.

Share this post


Link to post
Share on other sites

Nothing is shown... as described above. Just a blank page showing a purple band with no message. Nothing in the page source either...

post-1691-0-83836900-1416253159_thumb.pn

Share this post


Link to post
Share on other sites

Why is there no error message? In the error log? Debug true turned on.


Deinstalled custom modules one by one? PW Versions? etc...

Share this post


Link to post
Share on other sites

Thank you to have reminded me of turning on the debug mode... But it doesn't help understand the problem in my point of view. It seems to be template related.

post-1691-0-83948500-1416253733_thumb.pn

Share this post


Link to post
Share on other sites

I have found the culprit, an image field associated to the user template. I don't know what is going wrong with this field. I will try to recreate it to see what happens.

Share this post


Link to post
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).

Share this post


Link to post
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

Share this post


Link to post
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. ....

What was the name of the image field?

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thank you for the info. The images field, already found in the PW installation has been set also to the CropImage settings, and it does not throw any error. But I will test again to be sure.

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MarcoPLY
      HI.
      I don't understand how I can customize the user-login profile. Some one can help me?
      I use the login/registration module. At moment user can only change password and email. I don't understand how add this other fields: I would like the user make the registration can edit their name, surname, city and other information.  If possible, the best things would be to use the same classes of Padloper in the way that during the checkout process the fields is are already filled out.
      Thank you!
    • By jacmaes
      I'm sure it's been asked before on the forums, but I haven't found a relevant answer after multiple searches.  I have a form on the frontend that mirrors the user profile on the backend. After logging in, I want the user to be able to edit multiple fields on his or her profile. For simple text entries (e.g. First Name, Street Address, Phone Number or Email), and single options (e.g. radio buttons for Gender: male or female or select dropdowns for a Country list), I have no issue and everything works fine: the user first fills out the form then can go back and update whichever field they want. That's standard profile editing stuff from the frontend.
      But I hit a roadblock when I want to offer multiple choices. For example, I have a Select Options field set up to show multiple checkboxes for choosing various types of driver's licences. With the following code (edited for brevity):
      $licence_types = array('B1', 'B', 'A1', 'C1', 'D1'); // same options as defined in my select options field foreach($licence_types as $licence) { $content .= "<label><input type='checkbox' name='licences[]' value='$product'> $licence</label>"; } .... $user->of(false); $user->licences = $licences; $user->save(); $user->of(true); the user can successfully submit this info from the frontend form:

      But now how do I show them the result  of what they submitted when they go back and want to update their profile from the same form? In other words, how do I insert the checked='checked' (or simply 'checked') HTML in the previously selected checkboxes?  For example, if they selected the first two options –B1 and B– in the example above, how do I make these two checkboxes ticked?
      With the following loop, I can show the previously selected checkboxes:
      foreach($user->licences as $licence) { $content .= "<label for='$licence->id'> <input name='licences[]' type='checkbox' id='$licence->id' value='$licence->id' checked>$licence->title</label>"; }  
      How do I merge the two loops so that they see this, as expected:

       
      Maybe with in_array()? Any help would be greatly appreciated.
       
       
    • By Mustafa-Online
      Hi Everyone, It's Been a While Since i Started Working With The "Super Lovely ProcessWire" & I Absolutely In Love With It .
      But, sometimes i feel lost, because the lack of tutorials "Specifically Videos" - i wish  there will be more tuts made by the community & from the ones who have
      The Experience.
      1- Regarding to the user profile, is there any way to show fields in Tabs ?? or if there in way to attach pages to user will be fine
      2- Markup-Regions : Where i can find the Docs that are Related to them ??
       
      Thanx
    • By mrkhan
      Hello,
      i have managed to login and logout and change password for user from PW front end with the help of 
      https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/
      many thanks to @ryan
      but now i need it little advance
      1. i want to have option for login users to save some pages as FAV and can see in their profile.
      how exactly i can do that ?
      do i need to create some fields in users Template , how login users can press button on page to put as FAV & if he is not logged in it goto LOGIN Page.
      2. and User Name and Phone Number and Pic in user profile.
      Thanks