Jump to content

gebeer

Members
  • Content Count

    1,027
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by gebeer

  1. Hi, On a 2.5 install I try to add a second super user. After adding and saving it with password assigned, It gets displayed with a strike through in the user list. When I then edit and save it again, I get this error: Missing required value Required password was not specified. But the password was entered already when I added the user. This is happening only on a clone of an install on my dev server. When I add the same user on my local environment, everything is working as expected. The install on the dev server is the same where I get the persistent httpHost error described in my other thread. Also the httpHost error message gets displayed twice, above the user list and on the very top: I have other PW installs on that server which are all running smoothly. Any pointers to a solution would be great. Thank you.
  2. Hi all, after moving a new 2.5 install to a different server, I always get this error message in the backend: Unrecognized HTTP host: 'subdomain.mydomain.tld' - Please update your $config->httpHosts setting in /site/config.php The entry in config.php contained the new domain when I installed. Then I set the entry to an empty array. $config->httpHosts = array(''); But the error still displays in the backend. How can I get rid of it?
  3. @quickjeff yes exactly. Frontend users should be totally ignorant of the admin in my usecase. @adrian great, thank you for that module! "Again what learned", like Lothar Matthäus, a german football player, once said
  4. It is logical. The PW API supplies method which we can use to render forms through the API. There are predefined input field types that we can use. @netcarver You're right. I added an issue on github.
  5. I just doublechecked. The label is not hardcoded in the __render() method. It says $this->label = $this->_('Set Password'); Where _('Set Password') is a translatable string. So if I add a translation for it, I should be able to change it. Only where would I translate it?
  6. you posted while I was still writing. For normal input fields like InputfieldText and InputfieldEmail the label override works just fine. It seems to be only the password field. So it seems not that big of an issue to me and I can live with it. But I will add it as an issue to see what the reason behind hardcoding in the render method is.
  7. Thanks netcarver! I'm creating a form where users can change their password. So I need 2 fields to be able to check for typos. That's why I initially wanted to use the built in password field because it provides the validation field out of the box. But I'm thinking of switching to 2 custom inputs and doing the validation logic myself. Just thought it would be easier to reuse something that's already there....
  8. Awesome, thank you blad! Would be better to not require js for the task. So the hook after render is something I will investigate further. Cheers Gerhard
  9. Hello, I'm using the API to populate a form in the frontend with PW 2.5 My code for appending password field // create password inputs $field = $modules->get("InputfieldPassword"); $field->label = "Set new Password"; $field->attr("id+name","pass"); $field->required = 1; $form->append($field); Whatever string I set $field->label to, I always get "Set Password" as label. Is it possible at all to change the label on InputfieldPassword?
  10. I'm using redirects to a profile page, too and also the custom backend login. I am just wondering if there is a way to create user roles that only have access permissions for the frontend (like the guest role). If I log my frontend role user in to the backend, they are presented with a barebones admin where they can't do anything but logout. But still, they can login to the admin.
  11. SiNNuT says I tried this setup. My user only has the guest role and a custom role "frontend". The role "frontend" has permissions page-view and the custom one "frontend-edit". I can login with the user into the admin. How can I avoid that and effectively ban users from the backend?
  12. Thank you Soma, now I know how to get around the throttle. I took some code from renobird if($session->login($user, $pass)) { // login successful $session->redirect($page->path); } else { $session->login_error = 'Login Failed. Please try again, or use the forgot password link below.'; } It is working fine. Any advantage of storing the error in $session over your example with $error? Or is this just personal preference?
  13. Running 2.5 stable, I tried Soma's code for error handling but the catch statement seems to be ignored when I enter a wrong username or password. Is this normal behaviour or am I missing something?
  14. @SteveB would you mind sharing your code as is (github/zip file/PM)? That would be awesome. I've been digging through the forum to accomplish the same thing and am halfway into some working code. It would be great to have some additional example code. Cheers Gerhard
  15. In the console I see this error: NetworkError: 404 Page Not Found - http://www.birthfactdeathcalendar.net/wire/modules/FieldtypeMapMarker/InputfieldMapMarker.js?v=203?%3E" Is that page published?
  16. Of course you're right. This was just a leftover from when I was working with the page names instead of IDs.
  17. SOLVED When I use the page id as the selector value together with the negative search operator, it is working $page->children("tags!={$foodid}")
  18. Thanks for the enlightenment. Didn't find this info in the api. It is working fine so far with my multi page select field. Both tags*="food" and tags.title*="food" are working as positive selectors. Might be because my tag template contains only the title field. Unfortunately not :-( I tried using the page id for "food" as a selector value. It is working for positive selectors only. Butf I do $page->children("!tags={$foodid}") it lists all children again. What would be a workaround to achieve $pages->get("/places")->children("tags*=food, !tags*=accomodation") ?
  19. Hello all, I read carefully through https://processwire.com/api/selectors/ but can't seem to get negative selector to work on a 2.4.11 install. My setup: -places with tags. -"tags" field is a multi page select field. When I do $pages->get("/places")->children("tags*=food") I get all children with tag "food". But when I do $pages->get("/places")->children("!tags*=food") I get all children. But it should only return all children that do not have the tag "food". The selector api states about negative selectors So what am I doing wrong here? Might it be related to my tags field being a multi page select field? What I'm ultimately trying to achieve is $pages->get("/places")->children("tags*=food, !tags*=accomodation") Cheers Gerhard
  20. Hello Ryan, thank you for this function! I'm using it with PW2.4.11 and get a PHP Notice: Notice: Undefined property: Page::$templates_id in /var/www/pwbootstrap3/wire/core/Page.php on line 604 When I uncomment the line 'templates_id' => $page->templates_id, the notice is gone. Has anything regarding $templates_id changed in the current dev version? Cheers Gerhard
  21. @adrian Thanks for pointing that out. When I pass it like $child->render(array("useMain" => false)) and then check in the child template $useMain = ($options['useMain'] === false) ? false : true; I get the same results as passing it like $child->render($useMain = false) Which renders a blank page. So the problem is not passing the value for $useMain in the right manner. Rather it is the delegate approach that I'm struggling with. My places.php is calling the child template (place.php) multiple times for rendering each child page. Everytime the child page template is being called for rendering, _main.php gets included. Result is multiple rendering of the complete html from _main.php. Now when I set $useMain to false for the child page template I'd expect to just get the markup from that template. But instead I get an empty string. That's what is confusing me.
  22. Thanks for the quick reply. I adapted my code following your suggestions. My places.php <?php //template places foreach ($page->children as $child) { $child->rendered = true; $content .= $child->render(); }; ?> and place.php <?php //template place $tags = ''; foreach ($page->tags as $tag) { $tags .= "<li><a href='#'>{$tag->title}</a></li>\n"; } if ($page->rendered) { echo "<article class='article'>\n"; echo "<ul class='nav nav-pills'>\n$tags</ul>\n"; echo "<h2>{$page->title}</h2>\n"; echo "{$page->body}"; echo "</article>"; return; } else { $content = "<article class='article'>\n"; $content .= "<ul class='nav nav-pills'>\n$tags</ul>\n"; $content .= "<h2>{$page->title}</h2>\n"; $content .= "{$page->body}"; $content .= "</article>"; } ?> But still the same result. For each child page the whole _main.php gets rendered. I also tried in places.php foreach ($page->children as $child) { $content .= $child->render($useMain = false); }; with my original code in places.php But this gives a blank page again.
  23. Hello, I'm using PW 2.4.11 with its delegate template approach. I have a page "places" with template places.php to list all its sub pages <?php //template places foreach ($page->children as $child) { $content .= $child->render(); }; ?> All sub-pages of "places" have the place.php template <?php //template place $tags = ''; foreach ($page->tags as $tag) { $tags .= "<li><a href='#'>{$tag->title}</a></li>\n"; } $content = "<article class='article'>\n"; $content .= "<ul class='nav nav-pills'>\n$tags</ul>\n"; $content .= "<h2>{$page->title}</h2>\n"; $content .= "{$page->body}"; $content .= "</article>"; ?> Problem is that for every sub page the whole _main.php gets rendered. I guess this happens because of $useMain = true; in _init.php. How can I tell the place.php template to only include _main.php when it is not called through the render() method? If I add $useMain = false; to place.php, I get a blank page. I'm sure the solution must be really simple. But for me not being a coder, I just can't seem to get my head around it.
  24. Hi zwergo, great project. Thank you for sharing. A lot to learn from your code. I'm really happy that I could convince you to take another look at PW as the right tool for your project. Cheers Gerhard
  25. To answer my own question: I had to install the module first (stupid me had forgotten that). After that I could select it as a Process. Simple as that
×
×
  • Create New...