Jump to content

bernhard

Members
  • Posts

    6,671
  • Joined

  • Last visited

  • Days Won

    366

Everything posted by bernhard

  1. @Gideon So very interesting topic, maybe you want to share your learnings in a post in the tutorials board?
  2. @adrian thanks I was aware of that but I don't think it is of big help in my case. @SamC thanks, looks interesting I've always worked with PhpMyAdmin (on most hostings) and HeidiSQL (for local dev with laragon). The visual explain analyzer looks interesting though. Seems that HeidiSQL should also have this feature but it didn't work here on my first try... I'll play around with that in the future - for now I'm happy with my results since I decreased the time for the query from terrible 90s to 900ms (uncached) Thanks for all your input!
  3. Thanks! Didn't know about that. This worked to turn it off: SET GLOBAL query_cache_size = 0; No, never heard about such tools My experience with SQL is quite limited so I'd be very thankful for some helpful links in this regard, thanks Thank you both for your helpful answers!
  4. Great post @StanLindsey I had exactly the same thoughts... Regarding slack - I'm also not a fan, but it seems that many are... there was also one try to get a pw slack channel running two years ago: https://processwire.com/talk/topic/11475-processwire-slack-channel/
  5. Ok today I hit a very strange problem regarding those mentioned sql queries. I built a little processmodule that shows the result of my queries. The queries themselves are stored in a PHP file which makes it possible to create different VIEWS (just like DB views) and include them easily via php's include(). Simple example: // file allpages.php return "SELECT * FROM pages"; // file publishedpages.php $allpages = include(__DIR__ . '/allpages.php'); return "SELECT * FROM ($allpages) AS allpages WHERE allpages.status = 1"; This seemed to work great, so I continued to create some more complex queries like the ones mentioned above: SELECT effort.id AS id ,effort.status as status ,(SELECT data FROM field_rockprojecteffort_date WHERE pages_id = effort.id) AS date ,(SELECT pages_id FROM field_rockproject_efforts WHERE data = effort.id) AS projectid FROM pages AS effort WHERE templates_id = 95 Template id 95 is for "rockprojectefforts", thats items for all kind of actions related to a project. So far, so good. Now the strange part: I want to create a combined listing of all projects and all efforts ( project, firsteffortdate (=when the project started), lasteffortdate (=when it ends), etc )... <?php $projects = include(__DIR__ . '/allprojects.php'); $efforts = include(__DIR__ . '/allefforts-slow.php'); return "SELECT * ,(SELECT `date` FROM ($efforts) as `efforts` WHERE `projectid` = `projects`.`id` LIMIT 1) as `fromdate` FROM ($projects) as `projects` WHERE `projects`.`status` = 1 "; This works, but it is terribly slow (3,6 seconds)! The included SLOW file looks like this: <?php // old non-performant query return "SELECT `effort`.`id` AS `id` ,`effort`.`status` as `status` /* data for the effort */ ,(SELECT `data` FROM `field_title` WHERE `pages_id` = `effort`.`id`) AS `title` ,(SELECT `data` FROM `field_rockprojecteffort_date` WHERE `pages_id` = `effort`.`id`) AS `date` ,(SELECT `data` FROM `field_rockprojecteffort_price` WHERE `pages_id` = `effort`.`id`) AS `price` ,(SELECT `data` FROM `field_rockprojecteffort_vat` WHERE `pages_id` = `effort`.`id`) AS `vat` ,(SELECT `data` FROM `field_rockprojecteffort_amount` WHERE `pages_id` = `effort`.`id`) AS `amount` /* data for the corresponding project */ ,(SELECT `pages_id` FROM `field_rockproject_efforts` WHERE `data` = `effort`.`id`) AS `projectid` ,(SELECT `data` FROM `field_title` WHERE `pages_id` = `projectid`) AS `projecttitle` ,(SELECT `data` FROM `field_rockproject_status` WHERE `pages_id` = `projectid`) AS `projectstatus` /* we also need the clientid to search for the first effort of a client */ ,(SELECT `data` FROM `field_rockproject_client` WHERE `pages_id` = `projectid`) AS `clientid` FROM `pages` AS `effort` WHERE `templates_id` = 95 "; Whereas this file works just fine (0,03 seconds): <?php return "SELECT pages.id as id ,pages.status as status ,date.data as date ,efforts.pages_id as projectid ,title.data as title FROM pages JOIN field_rockprojecteffort_date AS date ON date.pages_id = pages.id JOIN field_rockproject_efforts AS efforts ON efforts.data = pages.id JOIN field_title AS title ON title.pages_id = pages.id WHERE templates_id = 95 "; another strange thing is that both queries as single queries work just fine (one needs 0,07 seconds, the slower one 0,11 seconds - but I don't think that is the issue): I can live with the JOIN even though it is a little less readable and more complicated to setup, but I would really love to know what is going on and why this is the case. BTW: On the second reload everything is even quicker so I guess there is some caching in the background. I did not find any options for disabling the cache in the WireDatabasePDO class - could this be a mysql internal cache? Thanks for your time!
  6. it will create a default name (database name). or are you talking about a configurable default name?
  7. Agree - I just redirected them where I needed If it is a custom logout template you don't even need the GET variable since all it does is logging out the user...
  8. I wanted to mention custom frontend logins... don't know why I didn't. Maybe because this would have answered my own question... Ok, that count is 0 here maybe that's why it took me a little long to get your point ^^ since the pw admin is so easy I've just not had the need to build a custom login/logout/admin for my users... Last time I did it was when I was using Joomla and this was fortunately long, long time ago
  9. This "might" be true. But since the user is already logged in he "might" already know the admin url - where else would he have logged himself in?! But you are right, if one wants to hide the admin url for whatever reason a dedicated template or a get variable as flydev posted would be a solution. usually? sounds like you need that often?! may i ask for which purposes? I've never needed that so I'm curious thanks
  10. I would not call it a hack if you found it in the official admintheme It's totally fine. What happens is that you execute the executeLogout() method in the ProcessLogin module: https://github.com/processwire/processwire/blob/master/wire/modules/Process/ProcessLogin/ProcessLogin.module#L195-L210 This is from the admin: echo "<li><a href='{$config->urls->admin}login/logout/'><i class='fa fa-fw fa-power-off'></i> " . $this->_('Logout') . "</a></li>";
  11. see this example: the key is the entityEncodeText option: https://processwire.com/api/ref/inputfield/
  12. Sorry no experience in this sector - I've had a look at https://www.mollie.com/ but never had the possibility to try it out but they seem to offer easy recurring payments.
  13. hey jmartsch thanks for your interest and help I found the problem and did a quickfix. Seems to work now inside the root directory and also in a subdirectory: https://gitlab.com/baumrock/kickstart/commit/a68ba04c53e144ee1255faea704ab9c350b7fbe8 I have to leave now so I could not do more testing - could you please check if the recipes folder gets deleted after installation? Think I have to fix that. Also it should have thrown an error during installation, have to fix that too. But it should work now Thanks
  14. I can highly recommend Laragon: https://laragon.org/download/migrate-from-xampp.html
  15. Hi anyway, in my link (and the sublink) you can see two possible solutions: Open the dropdown on 1st click, open the link on the 2nd Show some additional link via javascript on 1st click In both cases you don't need to change the page structure (2 pages in the tree for 1 page would theoretically be possible with hooking/redirecting, but definitely not a good idea). Other options would be to add the parent as sub-item like you showed (parent trigger + parent). You could do this via javascript or via php. The point is that you don't modify the pagetree in the backend but you define what happens on the frontend (display). See https://github.com/processwire/processwire/blob/master/site-default/templates/_func.php#L61-L118 for an example of a custom pagetree render function.
  16. Sorry for my delay The problem is that the touch device I am talking about is my Laptop with a standard sized screen Somehow this device behaves a little different than a regular non-touch device and it does not trigger hover actions even when a mouse is connected. Also here in the forum I have to click twice for the like-button...
  17. Hi anyway, I think I read your post in the other thread but didn't get your point. The problem you are describing here is not processwire specific - it's a general problem related to touch and non touch devices. you can find some possibilities here (and in the linked thread):
  18. hi thuijzer, would you mind adding a screenshot to get an instant first impression of how it looks like?
  19. great idea, thx! needed that several times and maxLength=>... was a pain would it be hard to have the shortcut bdb() for bd($page, [6,999]) ? i think it would totally be fine to have that shortcut with fixed values since we have the other option of defining it manually like you showed above. but i think in 99% of the cases the bdb() would work just well and it is less to write and a lot easier to remember
  20. looks interesting! so @kongondo don't you use vscode git at all or do you use vscode git for simple tasks (like shown in my screenshot) and sourcetreeapp for more complex ones? thx
  21. wow! thank you for all your work! loving the logo - just updated my signature
  22. Making future website upgrades more error prone and time consuming, I agree. I don't have this feeling. One of the things I like most about PW is that I don't really have to care about updates. But I agree that it would be better to have less new features pushed out every week and have a little more conversation upfront to make the result as good as possible. Yes, we should get more organized somehow. yep, my vote for better community managment here I'd be happy to help in this regard as much as I can.
  23. thx @Peter Knight don't know what the benefit of another program should be... I like to have everything in the editor and see everything live while I'm working on the code: only thing missing is a proper way to push changes to a pw site... but that's part of the roadmap thread (of course it is possible, but as mentioned there I think it is a lot more complicated to achieve than I am used to by processwire easiness).
  24. [offtopic, sorry, please comment here in case of questions/interest] Agree it should not be a dependency, but regarding git I can really recommend gitlab.com + vscode - no cli at all, all free and really nice and easy UI:
  25. @noelboss just posted a comment in this thread and the thread is just one of many examples of people looking for solutions of a proper staging/production strategy. we have some modules that try to close this gap, but imho this is an important part of a professional workflow and therefore should be part of the core. don't know how that could be implemented exactly, but at least it would be great to have a thought-out strategy and maybe some kind of standard/best practise guide of how to keep staging/production in sync, be safe while editing, integrate GIT in this process etc. while other features are nice to have for me, this is really one thing that makes me feel totally unprofessional and is a huge pain. i don't think that the options we have so far are as good as they could be. for example if i had to push a fix to a live system, i wished it would be possible to: pull the latest version from live to dev with one click (excluding a predefined list of files / db tables) work on that dev version locally (having all files on the local computer makes searching all files a lot easier) push the fix to git push the fix to production some parts of this workflow can be done with the migrations module, some with the quite new duplicator module, some could be implemented via githooks, but, hey... we are talking about ProcessWire and where PW really shines is making our lives as devs easier and in this special case i feel that this is not true maybe i'm just too inexperienced in this topic and there are proper solutions out there, but following the forum over the last years i didn't see a solution that felt "processwire-awesome". maybe a blog-post covering this topic could be a first step. and maybe i'm totally alone with this opinion... a feature request-voting system could also help a lot here [pub] that was the tracy-boost
×
×
  • Create New...