Jump to content

adrian

PW-Moderators
  • Posts

    10,830
  • Joined

  • Last visited

  • Days Won

    348

Everything posted by adrian

  1. Sorry to go OT but I would love to know more about this - could you perhaps file a GH issue or post about it in the Tracy forum. Would definitely like to fix any issues you are having.
  2. Hi @virtualgadjo - I am glad unchecking the overwrite names option solved things for you. I dug into that section of code and discovered an issue with duplicate titles (when both set during a batch update) and fixed that in the latest version. I don't think this change will help what you were seeing - I think that is something ML that I haven't been able to reproduce, but at least I found and fixed something else :)
  3. I'm at a bit of a loss at the moment - I can't replicate the original error and I can't replicate any weirdness with hidden page behaving differently when publishing/unpublishing. I feel like it's due to something in here: https://github.com/adrianbj/BatchChildEditor/blob/9cdf3b7f317d9f8c07bc75faf150e5ba9490dfb6/BatchChildEditor.module.php#L1348-L1355 but not really sure why if page titles / names aren't being changed at the time you are unpublishing. Can you check to see if this section of code is being called and maybe dump the value of $name for all the child pages in the loop to see if there are indeed any duplicates at this point?
  4. @virtualgadjo - does that error happen every time you try to unpublish them all or did it only happen once like this? Is "weekendatbinnys-champagne-tasting" a field or child page name? Is ID 1019 a language page?
  5. https://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-copies-of-the-same-module
  6. Hey @bernhard - I think there's a bit of a problem with storing the enabled settings in wireCache. The cache can be manually cleared for a variety of reasons, and also really important is the fact that the default expiry is 24 hours which makes it pretty useless for this purpose :) Why can't these be stored in the module's config settings?
  7. You make some very good points - conditional loading of js/css in the php file does make things much easier for sure (like your superuser only example) and it would be painful to handle this any other way, so maybe keeping things as is will be fine. Sorry about the PRs to main - I didn't check if you have a dev branch. Are you OK handling the current ones as is so long as I modify the upcoming ones? I think an additional notes parameter could be useful. Perhaps also a link parameter that could automatically populate those info icons you added to a couple of tweaks within the description. Maybe also an author parameters (maybe GH username) so it's easy to keep track of who needs to be contacted for support going forward? Of course, the other approach to this would be something like what I did with AdminActions - see Robin's addon action maintained in his own repo (https://processwire.com/modules/admin-actions-replace-home/). I like the idea of separate maintenance without the need for PRs, but it would also be a pain for others to find all the tweaks, so probably a bad idea in reality.
  8. @bernhard - what do you think about compiling, minifying, and caching the css and js assets into one single file each? I just worry about how many extra requests all these tweaks will end up being. BTW - I have more AOS ones coming :)
  9. Thanks for the subfolders - much better for complex tweaks, especially those that require additional assets like the AOS column break I just ported over. I know about admin.less and I do use it. I guess I kinda of forgot in this context because I've been loading an admin.css via AOS for my standard tweak for so many years now.
  10. Sorry :) I'll leave @jploch to answer that, but I think the request for these arrows is in the spirit of making editing children easier in general from the main Content view.
  11. @ryan - the arrows after the page title in Bernhard's screenshot above is what is being referred to.
  12. Hey @bernhard - I am thinking of revisiting this module now that it seems to be getting some traction but have two questions before I start pulling out the key things from AOS that I need. 1) What about having subfolders for each tweak so that we don't end up with a mess of php, js, css files for multiple tweaks in the one categorizing parent folder? 2) I am also thinking about a replacement for AOS's Assets Paths > Admin CSS and Admin JS feature. Perhaps it's a simple matter of creating a custom local tweak that just calls loadCSS() and and loadJS() for all those random tiny tweaks that are small enough and don't need a specific hook (and therefore PHP file). Any thoughts? Thanks.
  13. @jploch - this is a feature that AOS has which I enable it on all sites - very handy indeed, as is of course BreadcrumbDropdowns.
  14. Then we could use the system "published" property, no? Regardless, even if there is a need for a custom date field of some sort on the post template, that could still drive that getRaw() example I posted. Not saying it's the right way to go - just highlighting some other options.
  15. You could also simply get the parent by using the parent property. Of course you don't need to use setAndSave() but I feel it's cleaner in a situation like this. I also like using $p rather than $p because even though the scope will prevent $page from overwriting the PW $page object, I still find it less confusing, but that's just a personal preference. $wire->addHookAfter("Pages::published(template=post)", function (HookEvent $event) { $p = $event->arguments(0); $blog = $p->parent; $blog->setAndSave('date_modified', $p->date_modified); }); Also, in case you don't know, there is a system "modified" property rather than adding a separate custom field for that. Another thought - if updating the modified date for the blog parent is just about using it to display on the website, perhaps you can just get the modified date of the most recently modified post, eg:
  16. @ryan - I wonder if PW might automatically include those gc tweaks when Debian is detected? Maybe via something like this. Perhaps it could be run at install, rather than runtime if you're concerned about performance although it is only about 1ms. if (strtolower(substr(PHP_OS, 0, 5)) === 'linux') { $vars = array(); $files = glob('/etc/*-release'); foreach ($files as $file) { $lines = array_filter(array_map(function($line) { // split value from key $parts = explode('=', $line); // makes sure that "useless" lines are ignored (together with array_filter) if (count($parts) !== 2) return false; // remove quotes and new lines $parts[1] = str_replace(array('"', "'", "\n"), '', $parts[1]); return $parts; }, file($file))); foreach ($lines as $line) { $vars[$line[0]] = $line[1]; } } d($vars['ID']); }
  17. If you're running Debian, try adding this to your config.php /** * Enable Session Garbage Collection * Garbage Collection is disabled in Debian as default (probability set to zero) * Enable session garbage collection with a 1% chance of running on each session_start(); * Chance calculated as gc_probability/gc_divisor * Session path is defined inside wire/core/Session.php and points to site/assets/sessions * Thanks to this modification session now takes into account gc_maxlifetime set in config */ ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 100);
  18. @ryan - I need it for coupon codes which are stored underneath categorizing branch parents, but which are accessed by end users via a urlsegment on the home template. I have been using a hook to ensure duplicates can't be accidentally created and that works fine so not critical that this is added for my needs but just wanted to see if you thought it was still something that should be added to the core.
  19. Lots more Adminer updates in the last couple of weeks, but the key things are: 1) Shift-click on the DB icon links will now open Adminer in full mode rather than with the Tracy panel 2) Page, template, field, etc ID within Adminer table views are now linked - note the page title (and path) and the link to edit that page - this comes from hovering on any of the id, parent_id, templates_id, created_users_id, modified_users_id, etc. These sorts of links are present throughout including linking to modules from the "modules" table, hanna_code, pages_meta, etc. It also works for all Page Reference field's page IDs in Profields Table "field_table" tables, Profields Combo, repeater, RM fields, etc. Hopefully you'll all find this as useful as I am.
  20. @ryan - just following up on the comment by @Denis Schultz - now 4 years on, are you still planning on adding that "Unique" checkbox for Text and Integer fields?
  21. Ryan has always done this (I really don't know why), but the tag on GH is added for the previous master version when the next master version is released and made available from the PW site's download page.
  22. Also another possibility - are you running Debian? If so, I find I have the same issue unless I add this to config.php /** * Enable Session Garbage Collection * Garbage Collection is disabled in Debian as default (probability set to zero) * Enable session garbage collection with a 1% chance of running on each session_start(); * Chance calculated as gc_probability/gc_divisor * Session path is defined inside wire/core/Session.php and points to site/assets/sessions * Thanks to this modification session now takes into account gc_maxlifetime set in config */ ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 100);
  23. Thanks for the explanations. I actually use strtr quite a lot for an array of substring replacements - works great. Sorry for the confusion about how it replaces - I wasn't thinking straight and was thinking about this difference: "strtr will not replace in parts of the string that already have been replaced - str_replace will replace inside replaces", rather than the replacing only the first occurrence - sorry I rushed without thinking it through - my bad :(
  24. @Michael Lenaghan - I am curious - did you find an issue with strtr or just went with Laravel's approach without looking into it? Not a criticism at all, just want it to be a learning experience for all of us if you did find an issue.
×
×
  • Create New...