Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by cpx3

  1. @Jan RomeroYou are incredible. Danke! (PS: I like your profile image!)
  2. Hi to all, I have a page reference field (select_categories) that references to a page called "unternehmen". When I debug it, PW says that the of the referenced page is "unternehmen". But when I put the condition, I get false. What am I doing wrong?
  3. Thanks for that. Looks like that the problem was that one select_author is a select with a single value... I changed it and now it seems to work.
  4. Hi everyone, I have quite a strange problem. When I use the following code with a terminal php command, it produces the following error message: Fatal Error: Uncaught Error: Call to a member function of() on int in /site/templates/process_pagefields.php:20 #0 {main} thrown (line 20 of /site/templates/process_pagefields.php) When I use it with Tracy it works fine from time to time, but sometimes it echoes "0", too. Any ideas what I am doing wrong? Thanks in advance, Bernhard Here goes the code include("/html/index.php"); // bootstrap ProcessWire // Get derefAsPage property of page_field_b to distinguish multiple/single page fields $deref = $fields->get('select_related_articles')->derefAsPage; foreach($pgs as $p) { // For this page, get the pages selected in page_field_a $selected_pages = $p->select_author; // Standardise $selected_pages to PageArray in case of "single" field if($selected_pages instanceof Page) $selected_pages = $selected_pages->and(); foreach($selected_pages as $selected_page) { // Add this page to page_field_b on the selected page $selected_page->of(false); if($deref) { $selected_page->select_related_articles = $p; echo "Set $p \n"; } else { $selected_page->select_related_articles->add($p); echo "Added $p \n"; } $selected_page->save(); } $numPgs--; echo $numPgs."\r"; }
  5. AndZyk, I found the solution. For whatever reason, the file compiler option was deactivated in config.php, so the templates were not compiled...
  6. Hi fellow programmers, I have a strange problem: when I try to use any functional field I get the error message "undefined function"__richtext()" or whatever I try. As soon as I include <?php namespace ProcessWire; ?> in my template files, everything works fine. The _init.php file exists and is not excluded, the same is true for ready.php and they seem to get included. Any ideas? Thanks, Bernhard
  7. Thanks again for the answer. Actually I only called that selector on a testpage which had nothing on it than this selector plus pages->find. The solution for the moment was to add a "minimum date" (i.e. created>date_minim) which seemed to be the only possibility to increase speed. The interesting fact was however that the same selector with the same data (I did not change anything) worked from 1000 ms to 80000 ms.
  8. Hi to all, I have a quite strange problem. If I open a page that contains the selector select_countries=oesterreich, begin=(start_date=''),begin=(start_date<=today),end=(end_date=''),end=(end_date>=today), template=template-news, checkbox_not_startpage=0, select_categories!=tipps|shortcuts, id!=, limit=5, sort=-created things get so slow that I usually need to restart the whole server to be able to login to PW-admin. I attached the profiler output of the function and you can see that with the exactly same data the output time goes up to minutes... Any idea? When I put the selector in the debugger it has an execution time of about 1200 ms. The problem only seems to appear when the selector is (the first and only) part of a function. Any ideas? Thanks in advance, Bernhard
  9. Thanks for the great help everybody!
  10. Thanks once more for the answers! My problem is that I have no idea how to get the value of select_countries.title (which is a referenced page). I tried (beside many variations): foreach ($items as $p) { echo $p->select_countries.id; } But with no results...
  11. Thanks to everybody for the answer! I tried findRaw which seems to be the most effective but brings me to another problem: How to access page references? I have the following code: $items = $pages->findRaw("template=template-news, select_region=austria, limit=2, objects=1", ["select_countries" => [ "id", "title" ]]); where select_countries are referenced pages. But I have no clue how to access the select_countries id as it neither works with array[0] nor with select_countries->title...
  12. Hi there, to display a single slide from a huge database I only need a single page. But when I use the selector $pages->findOne("template=template-news,start=1,sort=created")->title; the selector seems to ignore the start position and always returns the same page. As the docs specify clearly that findOne has the same options as find, I have been trying to find my mistake for the last four hours with any success... (I cannot use find as this slows down things extremly). Any ideas?
  13. Thanks anyway. I supposed it would as it is possible to exclude them. But they are definitely the source of the problem.
  14. @wbmnfktrThe problem seems to appear only when url segments are activated. Is there anything I oversaw?
  15. Thanks for the hint, I reinstalled the module and did everything as described but it still does not count anything...
  16. Hi @David Karich, first thanks for the module I learnt to love on many sites. Today I installed version 2.0 on a new site and even if I see the script and the tag in the body tag nothing is beeing count. Any idea what I am doing wrong? (I accessed the site from five different devices).
  17. Thanks for the incredible support here!
  18. Adrian, thanks for your reply. I actually disabled both of them (by uninstalling the SessionHandlerDB module). It became slightly better but now another problem appeared: The selector "select_regions.name!=schweiz,select_regions.name!=liechtenstein, template=template-news, start=1, limit=1, sort=-id". Any idea what might be wrong?
  19. There seems to be a problem with the sessions. I always find the error message: Error: Exception: Unable to obtain lock for session (retry in 30s) in my log and the page seems to be delayed. I commented out all the sessions but it does not become better. Maybe there is no relation between that and the update but the problems occured immediately after updating PW.
  20. I did the update, now I cannot even login to PW anymore as the admin is not loading... (I restarted the whole server but it does not help at all). Any other ideas?
  21. Yes, I did! Thanks for the hint, I will immediately update it!
  22. Thanks for the support! I tried everything, including a complete new installation, but the update seemed to be a coincidence. Actually the error message I found in the logs was the following: "Error: Exception: Unable to obtain lock for session (retry in 30s)"... When not using any sessions it seems to work.
  23. After installing the update unfortunately the site does not load anymore. Neither the frontend nor the backend seems to be accessible anymore, everything freezes while loading...
  24. @flydev Merci beaucoup (also for your wonderful modul!) Eventually I found the problem: it was a missing trailing slash in the url segment, although the setting was to either / or. Thanks to all of you for the support!
  25. I do not use ProCache in this project but in another, so is good to know that it might cause troubles (I never read about that). I need sessions for navigation as I do not want urlSegments on the startpage and I need to know which in which „area“ of the page the user is (the menu depends on that). Any other idea?
  • Create New...