Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/13/2025 in Posts

  1. This week I’ve bumped the dev branch version number to 3.0.249. This includes a little under 20 commits with various small updates, also including several to the new AdminThemeUikit default theme. This will likely continue for a couple more minor versions on the dev branch as we continue to optimize and improve it. See dev branch commit log for more details. I’m currently developing a portal application in ProcessWire for a client, and also working to finish up the ProcessWire.com website with the new design. We’re getting very close to having it technically ready, leaving just some writing for the homepage and features sections of the site. So the new site could be online in as soon as the end of the month. Stay tuned! Thanks for reading and have a great weekend!
    9 points
  2. ...that's the title of this video that I found recently and it had some useful tips & tricks that I didn't know:
    6 points
  3. Thanks @Tiberium I can reproduce if I try to load Tracy's settings page when it's not enabled and the logs file doesn't exist, but this is not something that will ever happen with a regular usage which I suppose is why no-one has ever reported it. Anyway, new version should sort things out for you.
    1 point
  4. I have solved this with following hook (after manually creating the page-add-created permission). Note that this only applies to the artist template and the permission name is actually a bit misleading since it's not applied to all addable checks. In my case, the result will be the same since artists would never be the creator of anything other than their profile tree. <?php $wire->addHook('Page(template=artist)::addable', function ($event) { /** @var Page $page */ $page = $event->object; /** @var Wire $wire */ $wire = $event->wire; $user = $wire->user; // only continue checks if user has page-add since just like page-edit-created, we want to reduce the permission scope. // At this point, PagePermissions will have checked for addable already, so use its result to check if (!$event->return) return; if ($wire->permissions->has('page-add-created') && $user->hasPermission('page-add-created', $page)) { $event->return = $page->created_users_id == $user->id; } }, [ 'priority' => 999, ]);
    1 point
  5. I absolutely love URL hooks and have used them extensively since they were introduced. I don't know if I'm alone in this, but the only thing that bugs me about how they work is when they conflict with URL segments in templates (especially if you have URL segments enabled on the home page, e.g in an SPA type scenario). IMO it would be great if URL hooks could have an extra bool parameter to set whether or not they take precedence over URL segments. E.g. $wire->addHook('/stripe/{route}', function($event) { switch ($event->route) { //CASES GO HERE default: throw new Wire404Exception(); return; } }, true); //<------ option here A number of times I've run into scenarios that require workarounds (or manually naming URL segments) to avoid conflict with home pages with URL segments which wouldn't be necessary if we could just instruct the hook to kick in before URL segments. Obviously this would need to be opt-in and at developer risk. I hate to be that guy that's always tagging you into threads @ryan.... but I'm guessing I may be overlooking a logical reason why this is a bad idea or that this doesn't exist?!
    1 point
×
×
  • Create New...