Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. @PWaddict - I have managed to solve the problem you are seeing, but there is another issue when using $file->mtime in the rename rule for images in repeaters that I am having trouble fixing. The problem is that when you save an image, the mtime changes and there is an order problem with the mtime changing before or after the renaming of the pagefile which is causing problems. I noticed though that it all works fine if you use $file->modified instead. Would that work ok for your needs instead of mtime?
  3. Yesterday
  4. Yep, I'm getting the same results with you.
  5. Ok, I think I have narrowed it down - if you don't have "overwrite" checked and you use $file->mtime it doesn't know how to name the file at the correct point it needs to. It's also necessary to have "Rename on Save" checked to have this problem. Let me see if I can fix.
  6. Does it help if you use $filePage instead of $page for the rule? What about "name" instead of "title"? What about if you don't have the $file->mtime component?
  7. Hm, after I checked the "Overwrite existing files?" on image field the problem is gone. So, the module to properly work needs that option checked?
  8. Tracy displays them in orange color as orphans.
  9. I am testing on a multi-language site and just changed to max files 1 and it's still all working as expected. Sorry, I am not sure what else to look at right now. I am curious what Tracy's PageFiles panel reports after the initial saving of the page.
  10. The structure on my template is in this order: various fields Image field Repeater field Repeater field various fields The image doesn't display on frontend because it seems that it doesn't get saved in database??? I'm checking if the image exists like this: if($page->image) etc. There is nothing wrong in the code on template cause if I save the page AGAIN then this time the image is properly getting saved and displayed on frontend. Image Maximum files allowed: 1 Formatted value: Automatic EDIT: It's a multi-language site.
  11. @PWaddict - I feel like I have replicated your described workflow and I am not seeing any problems so I will need more troubleshooting from you. Why doesn't the image display on the frontend - is the code trying to display an image with a non-existant path? What code are you using to display the image? What are the image settings - anything related to the max files or overwrite settings that are relevant? Anything you can do to narrow it down further would be very helpful.
  12. Hello @adrian Today I noticed a very strange behaviour with the module. If I upload an image on the Image or CroppableImage3 field and then add a new repeater item on a repeater field and publish / save the page, the image doesn't display on front-end. The image and its variations are visible on back-end and on the related folder in assets. If I first add a new repeater item on a repeater field and then upload an image on the Image or CroppableImage3 field then there is NO problem. WTF? I verified that this is caused by the module cause when I temporarily disable the rule there was NO problem. My rule is: {$page->title}_{$file->mtime} with Rename on Save checked. I'm using PW 3.0.135.
  13. Hello. Today I noticed a very strange behaviour. If I upload an image on the Image or CroppableImage3 field and then add a new repeater item on a repeater field and publish / save the page, the image doesn't display on front-end. The image and its variations are visible on back-end and on the related folder in assets. If I first add a new repeater item on a repeater field and then upload an image on the Image or CroppableImage3 field then there is NO problem. WTF? I'm using PW 3.0.135. Can PLEASE someone help me? EDIT: It seems the issue is caused by Custom Upload Names module. I will post on the related topic.
  14. I just noticed that the folders are deleted now. So maybe it's all fine now. Does anyone know how the deletion works? Does PW execute some cron jobs from time to time which runs over the temp directory?
  15. Olsa, thanks for Somas post. This might be a solution, if wireTempPath won't work. I still hope to get to work. The question is actually quite simple: How can I get wireTempPath to delete it's folders?
  16. @Robin S Thanks for reply! That's exactly what I did. But only the && operator, because I don't need to automatically send a notification. The administrator must know that he has notified the user. If he forgot to check the notify_user checkbox, then after saving the page I will not be able to track categories changes.. The notification describes which categories have been deleted, which have been added, etc. if ($template == 'member') { $old = clone($page); $old->uncache(); $changed = WireArray(); $fields = ['categories']; foreach($fields as $fieldname) { if ($page->isChanged($fieldname)) { $changed->set($fieldname, $old->$fieldname); } } if ($changed->has('categories')) { $categories = WireData(); $categories->set('current', PageArray()); $categories->set('added', PageArray()); $categories->set('removed', PageArray()); foreach ($old->categories as $category) { if (!$page->categories->has($category)) { $categories->removed->add($category); } else { if (!$categories->current->has($category)) $categories->current->add($category); } } foreach ($page->categories as $category) { if (!$old->categories->has($category)) { $categories->added->add($category); } else { if (!$categories->current->has($category)) $categories->current->add($category); } } bd($categories->current, 'current'); bd($categories->added, 'added'); bd($categories->removed, 'removed'); } } This code in Hook after Pages::saveReady..
  17. Did you develop that site or someone else? Maybe there are some hooks in place. Did you try connecting in an incognito window (without any cookies set)?
  18. I thought it always shows a bar at the top? I havent actually properly used it...I'll check it out...
  19. Hello for all, and for my friend @Leftfield Sorry, but I need to say that I agree with @wbmnfktr in your previous post ("... why do you want/need such a weird URL?")? Here is one solution (as option) with default Processwire (no hooks, custom modules or core hack): 1) template: product, fields: title, details (page table with auto name date format) 2) child template: details, fields: image, color, size, price # With that you will get paths (URL's): # Backend administration: # Page tree: There is always option to develope custom module with different UI (and Ajax processing) where user in one "container" write title (parent page), and in another product details (child page). For users all that can looks just like a single UI form that they don't know that are 2 pages. Right now, I see this as one option (or something in this direction) how to get that what you want, but also in all that respect PW core. But need to think is this all worth it (complexity in backend, and later in frontend..).
  20. Hi Gideon, thanks for your answer. Where can I check this ?
  21. Are you sure the Apache rewrite module loads properly? Gideon
  22. @Robin S Thanks, that's perfect. I can't believe it was that simple; I was definitely over-thinking it, trying things like append and add. Many thanks. - P
  23. *pops head up* I seem to be getting a few more ecommerce enquiries nowadays so happy to test when you're at that stage.
  24. New Release 0.6.3 – Codename »hehehe« The last release with a "fix" to the login screen actually broke stuff more than fixing it (thanks @johndoe for reporting this). So this is a fix for the fix… Sorry about that. And some improvements to the login screen on mobile devices. Support Forum ProcessWire Modules Repository Gitlab & Issues Added Fullscreen login screen on mobile 📲 Improved notifications on login screen Fixed Fixed Login screen design 🤯
  25. @CrazyEnimal, please insert your code inside a code block in forum posts. You can use SQL in ProcessWire when it suits you. That's what the $database API variable is for. Here is one way you could get a listing of manufacturers with the number of occurrences within a selection of cars. // Get the IDs of the cars $car_ids = $pages->findIDs("parent=$parent, template=page_car, dealer=$dealer_id"); // Get table for manufacturer Page Reference field $table = $fields->get('manufacturer')->getTable(); // Get manufacturers that are selected in the car pages $query = $database->query("SELECT data FROM $table WHERE pages_id IN (" . implode(',', $car_ids) . ")"); $manufacturer_ids = $query->fetchAll(\PDO::FETCH_COLUMN); // Count how many times each manufacturer occurs in the results $manufacturer_occurrences = array_count_values($manufacturer_ids); // Sort the results in order of occurrences, highest to lowest arsort($manufacturer_occurrences); // Get the manufacturer pages $manufacturers = $pages->getById(array_keys($manufacturer_occurrences)); // Output a list of manufacturer titles and the number of occurrences foreach($manufacturers as $manufacturer) { echo "<p>{$manufacturer->title} ({$manufacturer_occurrences[$manufacturers->id]})</p>"; }
  1. Load more activity
×
×
  • Create New...