Recently Updated Topics

Showing topics posted in for the last 7 days.

This stream auto-updates     

  1. Yesterday
  2. Robin S

    Thanks for the info. Hooking ProcessPageView::execute and calling getPage() seems to have negligible effect on response times. The method only executes once per page view, and getting the page object with getPage() method took an average of 0.0015 seconds in my tests. So I'm not too worried about that aspect. I'm not sure what you mean here - it might return the page object for a different page? Or some aspect of the page can be different? This gave me the same ID each time: $wire->addHookBefore('ProcessPageView::execute', function(HookEvent $event) { /* @var ProcessPageView $ppv */ $ppv = $event->object; for($i = 0; $i < 50; $i++) { $page = $ppv->_callMethod('getPage', []); bd($page->id, 'page->id'); } });
  3. Roych

    Hello, Im back here. All is working nice on a simple site, but I'm working on a Multilanguage site and Page reference field won't show anything on different language, but works normal in default. Im using the <?php echo $single->categories->implode(' ', 'name') ?> for the name of the category (page reference field). Am I missing something or ... Thank you. R
  4. dragan

    You know, just because you have these settings in place, doesn't mean your host will actually allow / activate it. Most hosting providers have some sort of limits that you can't override. Do you have the same site installed locally? If so, do you see the same error 500? (with the same settings as in php.ini)
  5. sebr

    Hi I'm using this great module to display points from a page list. I added a leafletmap field on page template and all is good. That's work ! But now, how can I remove geolocalized informations on some pages ? For example: on a page I set a location to Paris in leafletmap field on the "france" page. Now I would like to delete this geographic information (lat, lng, address, zoom) to remove this point (location to Paris)... How can I do ? When a point is set, it seems to be impossible to delete it... Is there a solution ? Thks in advance
  6. SOLVED case 'FieldtypeFieldsetPage': $rdata = []; $rdata["label"] = $field->$label ? $field->$label : $field->label; foreach ($field->repeaterFields as $i) { $l = wire('fields')->get($i)->$label ? wire('fields')->get($i)->$label : wire('fields')->get($i)->label; $rdata[$l] = $p->$field->get($i); } $pdata[$field->name] = $rdata; break;
  7. @justb3a or @marcus, maybe a dump question, but when I want to upgrade an existing wire core installation with the latest dev-version, do I need to pass a sha-key to the command?
  8. benbyf

    there a video or tutorial with screens for this module? I feel like I'd love to use it but cant visualise how it works in my head.
  9. It's $this->halt() only for in templates. In modules you don't need to.
  10. DavidStewart

    Thanks for the detailed instructions in the original post and template file syntax in the above post. A must-have utility for me.
  11. I just encountered a weird problem with an installation. I have some sort of a poor man's mediapool, which consists of a template with fields of type files(and a second with images) to upload PDFs and images which will be linked to from other pages. This worked well for the last months. This morning an editor called me and sent me this screenshot: All files were gone in the backend but still accessable in the frontend and present in /assets/files/ True, there were no columns in the database table named filedata for the fields mediendateien and medienbilder: I created them manually and the files were back again and the error messages gone. But what happened? What is filedata used for? It is of type mediumtext.(I checked other image and file fields) All the other image fields didn't show the missing column. Only those two... I did an update from PW 3.0.62 to 3.0.98 last week. Edit: Just discovered that filedata is used for focus information: {"focus":{"top":33,"left":37.5,"zoom":0}} I kinda fixed it for now, but it makes me nervous... Anyone an idea?
  12. So, fieldgroups are only related to templates? And fieldgroup is only deleted when a template is deleted?
  13. teppo

    Every time this topic comes up I'm slightly worried about the relation between any community-led documentation project and the new(ish) API reference at This already gets (somewhat?) automatically populated based on the latest core release, and I seem to remember @ryan mentioning something along the lines of updating / releasing a new cheatsheet that would use same data. If that's really the plan, it could easily make any manually updated documentation obsolete. That being said, I'm not 100% sure that this actually was Ryan's plan – or even if it was, is that still true? Additionally it might take a long time before he gets there (he's a busy fellow, after all.) Would be great if the man himself could chime in and let us know what the current plan regarding the docs is, and if we can somehow help make that happen One problem with the current, auto-generated docs might be that (as far as I remember correctly) the code that generates it is also powering the (commercial) API Explorer module, which could make Ryan somewhat hesitant to share it with others – which is perfectly fine, of course, but could also mean that we can't do much to help him there. But anyway, this is mostly just guessing. I've been quite happy with the new API reference, with the main problem being that one can't switch between core versions. For us who manage and work on different ProcessWire versions (for me this means everything from 2.2 .to 3.0) that's a major downside: currently when I'm working on anything other than my own projects, where the core version is generally speaking always the latest one, it's much easier to forget the docs and dive into the codebase to see which methods were available at the time.
  14. bernhard

    I've never used this module yet (so I don't know if that is possible or not), but as you didn't get any answer yet, you might be interested in my forms module:
  15. Hello, I am trying to make a hook in ready.php. A user can create a new page wich will be a child of his user template. I want to check the amout of children before adding a new page. If the count is more than 3 do a redirect. $wire->addHookBefore('Pages::add', function(HookEvent $event) { // Get the object the event occurred on, if needed $pages = $event->object; // Get values of arguments sent to hook (and optionally modify them) $template = $event->arguments(0); $parent = $event->arguments(1); $name = $event->arguments(2); $values = $event->arguments(3); /* Your code here, perhaps modifying arguments */ $userCount = wire('pages')->get($this->user)->children->count(); if($template == 'animal' && $userCount > 3) $session->redirect('/subscribe/'); //also implement check of user role user = max 3, paid-user is unlimited // Populate back arguments (if you have modified them) $event->arguments(0, $template); $event->arguments(1, $parent); $event->arguments(2, $name); $event->arguments(3, $values); }); I have this code, but it seems not to do anything.
  16. Noel Boss

    Hi Kixe Great module, thanks! Saved my site this weekend I have two suggestions as I reviewed my settings. I noticed someting that would probably be easy to implement and at least for me usefull: – No maximum limit of backups (max): why would that option be limited to 100? If I want to store 6hours backups for 3 months, 100 is not enough. - More flexible remove option (deadline): Provide an integer 1-99 plus a intervall: Hours, days, weeks, months years. This way, one can tailor backups and removal very flexible. The current limitations seem very arbitrary for me. On last thought: If it is possible, it would be nice if one can specify a time at which the backup would start – I know, this would just be an indication but still, one could plan the backups for say during night.
  17. burning

    Yess thank you very much! I was in the assumption that repeaters where the same structure as pages, so i was confused why the selector didnt work..
  18. Robin S

    @pwFoo, if your page/template/file exists only to give some AJAX response then another approach you could consider is to hook ProcessPageView::pageNotFound. Then you don't need the page/template/file. In /site/init.php: $wire->addHookBefore('ProcessPageView::pageNotFound', function(HookEvent $event) { $url = $event->arguments(1); if($url === '/your-special-url/') { $event->replace = true; $event->return = 'your response'; } });
  19. Last week
  20. Thank you @netcarver. I'll have a look at your pull request.
  21. kongondo

    I have never gotten round to adding custom ignore ones.
  22. Exactly what I was looking for! It's just a back-end login, but I want it to look nice, just in case someone accidentaly finds the login page. Thanks for your help, problem solved! matsn0w
  23. ridgedale

    Hi Horst, Thank you for your reply. The sites are organised as one wire folder with multiple site folders each running site running off its own database following the guidelines for Option #1: Multiple Sites with Multiple Databases. I'm looking to update Processwire so therefore the intention was to simply replace the wire folder, but I'm unsure of is whether I should take all the sites offline while the sites are are updated and what the advisable procedure should be.
  24. Robin S

    The same code will work in a hook to Pages::delete. Adapted to keep it DRY: // Prevent the trashing/deleting of pages referenced by other pages $pages->addHookBefore('trash', null, 'protectReferencedPages'); $pages->addHookBefore('delete', null, 'protectReferencedPages'); function protectReferencedPages(HookEvent $event) { $page = $event->arguments(0); // Find non-system Page Reference fields $pr_fields = wire('fields')->find("type=FieldtypePage, flags=0"); // Implode for selector string $pr_fields_str = $pr_fields->implode('|', 'name'); // Find any referencing pages $referenced_on = wire('pages')->find("$pr_fields_str=$page->id, include=all"); if($referenced_on->count) { // Replace the trash/delete method $event->replace = true; // Link markup for referencing pages $referenced_on_str = $referenced_on->implode(', ', "<a href='{editUrl}'>{name}</a>"); $plural = $referenced_on->count > 1 ? 's' : ''; // Trigger an error message (using $session in case a superuser is trashing/deleting from ProcessPageList) wire('session')->error("You cannot $event->method page $page->name because it is referenced in a Page Reference field on page$plural $referenced_on_str.", Notice::allowMarkup); // Don't allow the trashing/deleting of this page $event->return = false; } }
  25. My question ist posted twice... Answered your question in the other topic.
  1. Load more activity