Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. If we pay 5$ every time there someone was/has this issue we could buy a skyscraper. Or take all the time spent with this particular PW problem, we could free off the rest of the year. ; p
  2. I used if(trim(page->field)) while waiting to get fixed. But it must be 1 or 2 years since then and was reported I thought or known.
  3. To get the ID of the module you need to $id = $modules->getModuleID("ProcessPageEdit"); echo $pages->get("process=$id")->title;
  4. login() returns null if login failed so a test like $u->id would give a warning or error that $u is not an object. if($u) would also work here.
  5. You don't need to check if user is logged in, cause you log him in just before and test if it's working with if($u) which should be if($u->id) $u = $session->login($username, $pass); if($u && $u->id) { // user is logged in, get rid of tmp_pass $u->of(false); $u->tmp_pass = ''; $u->save(); // redirect here } Apart from that $user->isLoggedin() wouldn't work anyway cause you have $u which is the logged in user. The template var $user at that moment isn't updated.
  6. Since you turned of all session tests, I'm not sure. If there is a session issue, you won't be able to debug much via PW, A hook into "Session::isValidSession" would give you true or false, so still no idea why session is not valid, if it is that at all.
  7. Not sure about logs. There's seems to be no error happening, it just logs you out (?) Which is not triggered by PW it seems, so maybe your server php, apache logs help?
  8. The missing trailing slash would NOT result in 404 but a redirect. The "result in 404" is more a indication that /quote/ doesn't exits.
  9. Maybe session is filled and there's a problem cause it's not unlimited. Yes there's a input var limit. Maybe also there's some security mod on server that causes issues. Doesn't look like PW is the issue.
  10. There's nothing special to it, it just works. But It may should be with trailing slash my-domain.com/quote/?pack_id=xxx where /quote/ is a real page.
  11. RT @verde_andrea: Every Processwire Weekly i read it just confirm how fast @processwire is growing and how much i like it. If you haven’t t…

  12. I don't think you need to place your data into admin branch. Why? It's meant for admin stuff and it would be no problem to put them in the root of home. If you don't have a template file they are not viewable or you could protect them by removing guest view access. I can't agree with that the page tree and editing sorting deleting or crud if you will is confusing. Quite the opposite. And this is from a experience in about dozen different projects with no technical savvy users. Often we don't even need to explain them. While you of course can easily build custom crud and stuff I thonk you do too much for thinga already there. You don't have to build that really. Edit. Don't get me wrong I don't mean it's all completely wrong. Just scratching my head and you must be hating me already To me it sounds like. Ok I want only data, no frontend so I pllace them in admin/ .. but then users can't access them or edit them so I create my rails mvc crud to let them do edit them. While you can easily place them outside admin/ and let PW handle all this jus fine. But maybe I don't get what really is the reason. Also you can render part of the tree in your module and have them edit using pw edit screen and sort or delete them with a fee lines of code.
  13. Why all this complicated like moving and hooking and redirecting. I think it's as simple as only display news to a certain date time expired, and have a link to older news will just show all from a certain date time backward. This could be done with a urlSegment or a physical page "older-news" that only lists, well older news. No need to go fancy complicated. News pages stay where they are, chronologically.
  14. @teppo he obviously said he turned that off.
  15. Me too. What I thought this thread would be about updateing the module pages for 2.5 compatibility info (which is more important). I did mine some time ago.
  16. There's a nice tuto by Ryan https://processwire.com/talk/topic/4834-simple-hooks-tutorial-turn-a-pagearray-into-a-list-of-links/
  17. Simple logic issue of your code. 1. User logged in? ... redirect 2. Form submitted, check and login 2. User not logged in show login After sending the form, he's not yet logged in... you log them in later (but still show the form as if not logged in), but don't redirect after the login. So you get what you have.
  18. If you access the field you get a WireArray of image objects, and each has a method url (I think), it's not a property or a field. $imgs = $pg_settings->get("banners_slideshow"); $imgs->first()->url; // the first $imgs[0]->url; $img->eq(0)->url; // etc foreach($imgs as $img) echo $img->url; Forget about print_r() on arrays and object, you won't get useful infos most of the time it's overkill. Maybe have a deep read here http://processwire.com/api/fieldtypes/images/
  19. I had similar issue from 2.3 something to 2.4 something where editor could not edit pages anymore. I had to open roles and save to get it working again. Nobody knows why. I filed an issue back then but Ryan doesn't know why. Which scares me a little. Cause theres also some other things that are happening that nobody can explain why. Sometimes it's hard to tell and not able to reproduce. I had similar issue from 2.3 something to 2.4 something where editor could not edit pages anymore. I had to open roles and save to get it working again. Nobody knows why. I filed an issue back then but Ryan doesn't know why. Which scares me a little. Cause theres also some other things that are happening that nobody can explain why. Sometimes it's hard to tell and not able to reproduce.
  20. I'd go for birds or rockets. The sky is the limit.
  21. I would ask Ryan to make the method hookah Le. So no need for extendingm I think it can be useful in cases like this.
  22. Maybe a check to see if the checkbox has changed? $changed = $page->isChanged("mycheckbox"); Or there's a ___saved() hook ___saved(Page $page, array $changes = array(), $values = array()) Untested example wire()->addHookAfter('Pages::saved', function(HookEvent $event) { $page = $event->arguments("page"); if($page->template != "mytemplate") return; $changes = $event->arguments("changes"); // array of changed fields if(in_array("myfield", $changes){ // do stuff } });
  23. I tried to reproduce here and no luck. I fix error and everything works fine. I'm working with lots of modules since a long time and also got errors and stuff, but never actually something that would stop PW working after fixing it. Edit: usually when something strange, deleting /assets/cache/ files does clean things, or a module "refresh" which does the same. I think $config->dbCache isn't something that has to do with module and other caches, it's for queries. PW has introduced (2.5 or earlier) some sort of cache I think as there's a table "cache", I think that get's cleaned on a module refresh but not sure. Anyway nothing to do with dbCache setting (but could be wrong)
×
×
  • Create New...