suntrop

Members
  • Content Count

    256
  • Joined

  • Last visited

Community Reputation

41 Excellent

1 Follower

About suntrop

  • Rank
    Sr. Member

Profile Information

  • Gender
    Not Telling
  • Location
    Germany, Cologne

Recent Profile Visitors

3,425 profile views
  1. Sometimes I see a server error 500, instead of a PHP/PW error message. I don't know why and it makes it hard to figure out what is wrong. Here is an example from today. try { $return = wireRenderFile('partials/confirm', $vars); } catch (\Exception $e) { throw new WireException('Render Partial failed: ' . $e->getMessage()); } Error: I was using an old/missing function in the file partial/confirm.php. But why do I see a server error (500) and not a PHP error message or the exception? Is this something particular to my server config?
  2. suntrop

    Thanks! That sounds good and is what I was hoping for . I wasn't sure if there are any limits when it comes to the API features if I skip the module and just create a class. BTW … what do you mean by installability? Just being able to install something isn't worth anything on its own, is it? Do I miss something here?
  3. I need some extra functions to work with user's data, implement PayPal and Stripe and some other. Now I am wondering if there is any benefit using PW modules instead of just using a plain class and extending WireData? I do not need configurable modules and definitely not reuse them on another site … but perhaps later I need to hook into some methods. What do you think? Module or a simple class?
  4. suntrop

    Thanks! Helped and solved the problem
  5. Hi all I am using PW Markup Regions and perhaps have a problem related to that. The $_POST data exists double. When I put in /site/templates/_init.php at the top: var_dump($_POST); it prints out as array(0) { } array(0) { } Here is how my template/layout file looks like (removed everything non relating): <?php namespace ProcessWire; // board.php layout file // This is a layout file to render a specific page layout with given partial (content block) ?><!doctype html> <html class="no-js" lang="de"> <head> <meta charset="utf-8" /> </head> <body> <div class="project-title" data-pw-id="project-title"> <?php if ($page->template == 'board' || $page->template == 'group'): ?> <?= $board->get('title') ?> <?php else: ?> <?= $page->get('title') ?> <?php endif; ?> </div> <div class="board-control" data-pw-id="board-control">BOARD CONTROL</div> <div class="board-content" data-pw-id="board-content">BOARD CONTENT</div> </body> </html> When I remove all code there is just one $_POST left. Very strange: when I remove one or all of those three data-pw-id DIVs I get array(0) { } array(0) { }array(0) { }array(0) { } I have no idea why.
  6. suntrop

    Oh cool, this look quite different to what I had before I am using 3.0.98. I just copied the module and seems to work fine. Thanks for that!
  7. suntrop

    At the moment I just hacked inside the module directly to change from user name to useremail. There is useremail input field (in PHP comments) what I am using. Works fine, email was sent. However, I need to move this module to my sites directory, so it won't be overwritten the next update. Perhaps I can code something and PR to Ryan to update the module
  8. suntrop

    I am currently looking at the module's code and realised the same. I configured the Login/Register module to use an email rather than a username to login. It seems this function is not compatible to the forgot password module. Is it possible to copy the module from wire/modules to site/modules and edit the module's code? I would add a reset by email before coding a new, own reset function,.
  9. suntrop

    Thanks, I put in a hook.
  10. I am using the Login/Register module and have enabled the forgot password feature and the ProcessForgotPassword module is installed as well. When I enter an email to reset the password, no email is sent. I noticed there is a 'process_forgot_password' table in the DB … with no rows. Other emails are working well, just the forgot email is not working.
  11. I want a field to be required only if the page is published. I tried published=1 published=true and status=published but seems to be not working like that. Any way I can bind the 'required if' on the page status?
  12. Well, that makes sense I thought there is something wrong, but if that’s right it is ok thanks
  13. I am wondering why I need to add check_access to filter user roles // $page->members is a Page reference field to users $members = $page->members('roles=staff, check_access=0'); // output: 4 (for none superusers) $members = $page->members('roles=staff'); // output: 0 (for none superusers, but 4 for superusers) The members field is just a list of people belonging to a certain group. The group is split into users with the role 'staff' and those with just a 'member' role. I want to get only those with the staff role (and later those without that role).
  14. So, if I create hooks with the pure purpose of passing $event to other private methods, "it is ok"? On my current example above the tricky part is, almost everything builds up from the tierprice, wich in return builds up the unit price, wich builds the price, … Sometimes I need the total, sometimes I need to get the unit price and sometimes I need the with or without VAT. Like a pyramid. On my very first draft I had a couple functions in _function.php, then I moved on to create all sorts of different/independent hook methods but a lot of methods did the same thing, just with some slightly other output. At the end I thought, what I nice idea to just pass always the $event around
  15. Thanks a lot! The first point took me some time, but it is really obvious now The second one though isn't that clear to me. I have code more or less like your example but thought passing the $event always is better, because I can use those methods on its own. While it isn't necessary in the code section above, I have quite a couple of methods I need/want to use directly. I could create a hook for tierprice() as well, and call it $page->tierprice($page, 3) — but this seems wrong to me too. You would create a new method like getTierprice() which in return calls the private method tierprice()?