Susticle

Members
  • Content count

    10
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Susticle

  • Rank
    Jr. Member
  1. Thank you! I tried OR groups but didn't get them together to get the desired result. In the meantime I found out that the cause of the problem seems to be the Multi-dot selector. Not just for the OR '|' fields but also for my approach with the array. The parts of the array are working with AND logic until I add the part with the Multi-dot selector. So I did a little workaround: There are two searches now. The first one does an OR search in facility_jobs.facility_job.job_title with all given words. The resulting list of IDs is now a filter for the selector array instead of the Multi-dot selector. This seems to work quite well now. Maybe this can be done with one request using sub-selectors. I will look into this later.
  2. Thank you very much. I'll look into this!
  3. Thanks for your answer. This was the first way I tried it. But it results in an error message:
  4. Hello, there is (simplified): a template "job" field "job_title" a template "facility" field "facility_title" repeater "facility_jobs" field "facility_job_title" field "facility_job_description" field "facility_job" => pagereference to pages using the template "job" The facility template has a repeater to list jobs with an own name and description for this facility. In this repeater there is also a page reference to the template job. Everything is fine so far and everything works. But I don't get a search solved as I want. I need a result if *every* given word to search for matches facility_title OR facility_jobs.facility_job_title OR facility_jobs.facility_job.job_title. So template=facility AND (word1%=facility_title OR word1%=facility_jobs.facility_job_title OR word1%=facility_jobs.facility_job.job_title) AND (word2%=facility_title OR word2%=facility_jobs.facility_job_title OR word2%=facility_jobs.facility_job.job_title) AND (word3%=facility_title OR word3%=facility_jobs.facility_job_title OR word3%=facility_jobs.facility_job.job_title) I need this in one big selector because I do manual changes on the generated sql statement later. I created a selector array: foreach($arr_words as $i_number => $str_word) { $arr_selector[] = array( 'template' => 'facility', 'field' => 'title', 'operator' => '%=', 'value' => $str_word, 'group' => 'group'.$i_number ); $arr_selector[] = array( 'template' => 'facility', 'field' => 'facility_jobs.facility_job_title', 'operator' => '%=', 'value' => $str_word, 'group' => 'group'.$i_number ); $arr_selector[] = array( 'template' => 'facility', 'field' => 'facility_jobs.facility_job.job_title', 'operator' => '%=', 'value' => $str_word, 'group' => 'group'.$i_number ); } Sadly this doesn't work. It creates an OR-result. I need group1 AND groupX, but I get group1 OR groupX. I tried lots of stuff, but don't get it solved. Because of later changes to the sql statements, performance reasons, pagination I only want to search once. Any help is appreciated. Thank you! :-)
  5. Thanks for the answers. After discussing this we changed some things, now the way described above is appropriate.
  6. Hi, I wrote a little module which determines the value for an read-only inputfield depending on two other required text fields. If the necessary value cannot be found, saving should be prohibited but the entered values should stay in there. I used the hook "ProcessPageEdit::processInput" as described here and almost everything works fine. But there is one thing: The values are saved even if I detected an error. Is there a way to prevent this? I tried the hook "saveReady" but then the given values are lost in case of errors. Thanks!
  7. Susticle

    I was wrong in my previous post, sorry. The cookie I saw was not set by Processwire. So the code found in this post works for me.
  8. Susticle

    I can confirm this for version 3.0.98. It does something. If set to false, I cannot use the backend. But at the frontend the cookies are still set. I was wrong. It works nicely. The cookie I saw was not set by Processwire. Sorry.
  9. Hello everybody, I'm doing websites with Processwire for some time now. Now there is the first time I need to setup a hook. I created a module, that was no problem. I added a hook: In checkMethod I can check for errors and give out an error message with $this->error. With event->replace in case of errors I can prevent saving the wrong data. Everything's fine. But still I get the message that the page has been saved. So I think I did something wrong. What's the correct way to add a hook that checks the data, gives out an error message and prevents the page from being saved? Thanks, Lars