Jump to content

schafdog27

Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by schafdog27

  1. Than my theory was wrong, never had to check where sorting is actually saved. What will always work is if you use this blueprint https://processwire-recipes.com/recipes/extending-page-save-process/ and add the code to clear the cache when specific pages are saved.

    Thanks, that got me on the right track. I was able to clear the cache by hooking after ProcessPageSort::execute.

    public function init() {
            $this->addHookAfter('ProcessPageSort::execute', $this, 'afterSort'); 
        }
    
    public function afterSort() {
            $homePage = wire("pages")->get("template=home");
            $pageRender = wire("modules")->get("PageRender");
    	$cacheFile = $pageRender->getCacheFile($homePage);
    	$cacheFile->expireAll();
            
        }
    
  2. If you mean sorting in the page-tree than it should work with clearing on page save. The new position has be be saved in some way, which should trigger the cache clear. It can only be, that it's only the parent page which is saved, as the children are sorted.

    Thanks for the reply. That's kind of what I thought, but unless I'm doing something wrong, it's not working.

    For example, I have 4 pages using a template called 'basic-page' which are direct children of the homepage. All of them show up in the top menu of the site. I set the homepage template cache to clear on save and rearrange the pages using the 'basic-page' template. When I reload the homepage, I cannot see the changes (in the top menu) until I go in and physically save the homepage.

  3. Hi all, quick question.

    Is there a way to clear the template cache when a page using a specific template is sorted with drag-and-drop? I see you can clear it when a page is saved, but there doesn't seem to be an option for when it is sorted.

    It's not a big deal if there is not, as I can just go in and save a page and the cache will be cleared. Just wondering if I'm missing something.

    Sorry if this has already been asked. I googled, but couldn't find anything. 

    • Like 1
  4. 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.

  5. 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
  6.  

    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.

  7. 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. 

  8. 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

×
×
  • Create New...