Jump to content

sz-ligatur

Members
  • Posts

    109
  • Joined

  • Last visited

Profile Information

  • Location
    Stuttgart/Germany

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

sz-ligatur's Achievements

Sr. Member

Sr. Member (5/6)

42

Reputation

  1. Hello @adrian & @Fuzen – I have tried this without success. May I ask you what it needs to set up? I need a second select (field b), that offers options related to the selected value in field a. Pages structure: _dir-tpls/ > Template 1 [chunk-tpl]/ >> Option 1 [tpl-option] >> Option 2 [tpl-option] >> … > Template 2 [chunk-tpl] >> Option … On a settings page I have these two fields: field a: name: select_tpl, type: select-option-single config > parent => _dir-tpls/ config > template => chunk-tpl field b: name: tpl_options, type: checkbox-multi config > parent => '' config > template => tpl-option config > findPagesSelector => 'parent=page.select_tpl' //include=hidden It doesn't show any options in the select field b. If I leave the findPagesSelector empty, all option pages [tpl-option] are listet. You say it's a core feature, so I guess it should work without any additional JS? Or did I get you wrong? I would be happy if you could help me with a hint – thank you!
  2. Hello @Nomak, I have the same error here on my live setup, getting this error on e.g. pagelister, view a log, edit template or field – did you find a solution? SQLSTATE[42000]: Syntax error or access violation: 1104 The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay in File: .../www/agi-placementtest/wire/core/PagesPathFinder.php:356 I guess it's related to mySQL 8 – any idea what I can do to fix this? ProcessWire: 3.0.229 PHP: 8.1.22-he.0 Webserver: Apache MySQL Server: 8.0.35-27 MySQL Client: mysqlnd 8.1.22-he.0 File: .../www/agi-placementtest/wire/core/PagesPathFinder.php:356 346: $selects = implode(', ', $selects); 347: $joins = implode(" \n", $joins); 348: $wheres = implode(" AND ", $wheres); 349: $sql = "SELECT $selects \nFROM pages \n$joins \nWHERE $wheres"; 350: $query = $database->prepare($sql); 351: 352: foreach($binds as $bindKey => $bindValue) { 353: $query->bindValue(":$bindKey", $bindValue); 354: } 355: 356: $query->execute(); // <-------- error here 357: $rowCount = (int) $query->rowCount(); 358: $row = $query->fetch(\PDO::FETCH_ASSOC); 359: $query->closeCursor(); 360:
  3. Hi @adrian, your phone field just came right in time, so I gave it a try and it fits my needs well. I now want to use this fieldtype InputfieldPhone in a custom form delivered by my module. After several tries and fails I found a way, but it feels a bit odd. Is there a better/right way to use a predefined/configured field in a custom form? I guess this question is not related to your field… more a general one – but as I was stumbling across that need with the phone field I post my question here (…and because I really value your experience). // module context public function ___executeTest() { $modules = $this->wire()->modules; $fields = $this->wire()->fields; $phone = $fields->get('m_phone_2'); $p = New Page; //is that the right way to do it? $input = $phone->getInputfield($p); /** @var InputfieldForm $form */ $form = $modules->get('InputfieldForm'); $form->attr('id', 'PhoneTest'); $form->append($input); // $wrapper = new InputfieldWrapper(); // $wrapper->add($input); // $form->append($wrapper); $out = $form->render(); return $out; } Thank you! 15 minutes later – addendum: in my usecase, a new user is created on submit. In $form->process() I fetch the data and try to set the values to a new user: //$form->process() //add new user $newuser = new User(); $newuser->name = $form->getValueByName('name'); // … other fields $newuser->m_phone_2 = $form->getValueByName('m_phone_2'); // is formatted value here +49 (0)### ####### $newuser->save(); I now have to fetch the values from the raw post data: $data = $this->wire('input')->post; $newuser->m_phone_2->set('country', $data->m_phone_2_country;); $newuser->m_phone_2->set('area_code', $data->m_phone_2_area_code); … again I just wonder… is this the way to go?
  4. @Richard Jedlička & @bernhard, just want to let you know, I did a pull request for fixing issues on non label fields and on fields "not closable". https://github.com/uiii/AdminHelperLinks/pull/6#issue-1988009038
  5. Hello @ryan, I'm using a datetimefield (in a frontend form), input type is set to separate select inputs. In a multilanguage context I didn't manage to get the translated month other than english. I found that in wire/modules/Inputfield/InputfieldDatetime/types/InputfieldDatetimeSelect.php there is strftime() in use. As this is marked as deprecated for PHP 8.1 I tried to use IntlDateFormatter() like the following: $abbreviate = strpos($format, 'M') === false; // line 90 $fmt = new \IntlDateFormatter( $this->wire('languages')->getLocale(), \IntlDateFormatter::FULL, \IntlDateFormatter::FULL ); $monthFormat = $abbreviate ? 'LLL' : 'LLLL'; $fmt->setPattern($monthFormat); for($n = 1; $n <= 12; $n++) { //$monthFormat = $abbreviate ? '%b' : '%B'; //replaced //$monthLabel = $sanitizer->entities($datetime->strftime($monthFormat, mktime(0, 0, 0, $n, 1))); //replaced $monthLabel = $sanitizer->entities($fmt->format(mktime(0, 0, 0, $n, 1))); $months->addOption($n, $monthLabel); } That did it so far, it outputs the correct language variant - but: - sure, I don't want to hack core files… is there a way to replace the whole render() method of class InputfieldDatetimeSelect with a hook? - I’m not really familiar with the IntlDateFormatter(), is the usage correct here? - are you maybe willing to update the core file accordingly? Thank you!
  6. @netcarver & @dotnetic Thank you both for replying that fast. Finally I found the reason: at DSGVO times I tried to avoid cookies as much as possible, so I have the following lines in config.php to let guests without session cookie: $config->sessionAllow = function ($session) { // if there is a session cookie, chances are user is logged in if ($session->hasCookie()) return true; if (!isset($_SERVER['REQUEST_URI'])) return false; // if requested URL is an admin URL, allow session if (!empty($session->config->urls->admin) && strpos($_SERVER['REQUEST_URI'], $session->config->urls->admin) === 0) return true; // otherwise disallow session return false; }; This somehow got stuck - I disabled that part and was able to log in again. After re-enabling the cookie conditions login/out is working as usual again. Thanks for your time - I appreciate it .
  7. Hi @dotnetic, I tried to log in without any tracy debugger files (removed td-module directory and all cache files), unfortunately the error message persists. Either way, thanks for the tip, I am very grateful. My first suspicion was that something could be wrong with my PHP (session) configuration on my new machine... but I can't find any problems on similar Processwire installations. I will have to look further. ProcessWire: ProcessLogin: Diese Anfrage war anscheinend gefälscht und wurde daher abgebrochen. DEBUG MODUS ABLAUFVERFOLGUNG ($config->debug == true): #0 /Users/…www/wire/modules/Inputfield/InputfieldForm.module(238): ProcessWire\SessionCSRF->validate() #1 /Users/…www/wire/core/Wire.php(416): ProcessWire\InputfieldForm->___processInput(Object(ProcessWire\WireInputData)) #2 /Users/…www/wire/core/WireHooks.php(952): ProcessWire\Wire->_callMethod('___processInput', Array) #3 /Users/…www/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(ProcessWire\InputfieldForm), 'processInput', Array) #4 /Users/…www/wire/modules/Process/ProcessLogin/ProcessLogin.module(364): ProcessWire\Wire->__call('processInput', Array) #5 /Users/…www/wire/core/Wire.php(413): ProcessWire\ProcessLogin->___execute() #6 /Users/…www/wire/core/WireHooks.php(952): ProcessWire\Wire->_callMethod('___execute', Array) #7 /Users/…www/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessLogin), 'execute', Array) #8 /Users/…www/wire/core/ProcessController.php(350): ProcessWire\Wire->__call('execute', Array) #9 /Users/…www/wire/core/Wire.php(413): ProcessWire\ProcessController->___execute() #10 /Users/…www/wire/core/WireHooks.php(952): ProcessWire\Wire->_callMethod('___execute', Array) #11 /Users/…www/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessController), 'execute', Array) #12 /Users/…www/wire/core/admin.php(160): ProcessWire\Wire->__call('execute', Array) #13 /Users/…www/wire/modules/AdminTheme/AdminThemeUikit/controller.php(15): require('/Users/sz/Sites...') #14 /Users/…www/site/templates/admin.php(31): require('/Users/sz/Sites...') #15 /Users/…www/wire/core/TemplateFile.php(328): require('/Users/sz/Sites...') #16 /Users/…www/wire/core/Wire.php(413): ProcessWire\TemplateFile->___render() #17 /Users/…www/wire/core/WireHooks.php(952): ProcessWire\Wire->_callMethod('___render', Array) #18 /Users/…www/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #19 /Users/…www/wire/modules/PageRender.module(575): ProcessWire\Wire->__call('render', Array) #20 /Users/…www/wire/core/Wire.php(416): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #21 /Users/…www/wire/core/WireHooks.php(952): ProcessWire\Wire->_callMethod('___renderPage', Array) #22 /Users/…www/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array) #23 /Users/…www/wire/core/WireHooks.php(1060): ProcessWire\Wire->__call('renderPage', Array) #24 /Users/…www/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(ProcessWire\DefaultPage), 'render', Array) #25 /Users/…www/wire/modules/Process/ProcessPageView.module(184): ProcessWire\Wire->__call('render', Array) #26 /Users/…www/wire/modules/Process/ProcessPageView.module(114): ProcessWire\ProcessPageView->renderPage(Object(ProcessWire\DefaultPage), Object(ProcessWire\PagesRequest)) #27 /Users/…www/wire/core/Wire.php(416): ProcessWire\ProcessPageView->___execute(true) #28 /Users/…www/wire/core/WireHooks.php(952): ProcessWire\Wire->_callMethod('___execute', Array) #29 /Users/…www/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'execute', Array) #30 /Users/…www/index.php(55): ProcessWire\Wire->__call('execute', Array) #31 {main}
  8. Hello all, today I have the same problem as described above - I have a new computer with copies of all my local sites. No problem so far, until today, where I can no longer log into a particular backend, with the message as above. My attempts, I have … - @config.php $config->protectCSRF = false; - deleted the sessions table in the database - deleted files in /cache - tried without success to login with $session->forceLogin($user) = Warning: session_regenerate_id(): Session ID cannot be regenerated when there is no active session in /Users/.../wire/core/Session.php on line 1017 Does anyone have an idea where I could find the cause? I would be very grateful for helpful tips. PHP 8.0 Processwire 3.0.210 using module SessionHandlerDB
  9. I did it … #1743 - update: this is fixed in processwire 3.0.220, I can confirm that this is working now as expected.
  10. Hello @ryan, I had to change some role names on an existing site – after a while I recognized changed behavior for some role related functions. What I found is that using roles in selectors doesn't work exactly the same as I see on other fields: $s1 = "roles=aaa"; $s2 = "roles=aaa|guest"; $s3 = "roles=aaa|guest|notavailable"; echo $users->find($s1); //works, returns some users echo $users->find($s2); //works, returns some more users echo $users->find($s3); //returns empty pageArray ! As soon as I do an "OR" with a role, that does not exist, it wipes out the whole result set. Is this the intended behavior? I guess not, but maybe you can tell me where I'm wrong. Thank you!
  11. Good morning @gebeer, that looks promising – so far I didn't make the step to use the findRaw() but I will – looks like a huge potential to get my search run better. Thank you so much for your detailed examples. I will definitely dive into that and try to use it further up in my data collecting process. Btw. its about 650 documents and 430 tags. For now I just tried your 1-liner… Result: 1:4! The nested if takes avg 0.28s, your version 0.07s – now found 423 matches takes 30s instead of 120s for building the cache file (on my slow local machine). Looks like a good start for today – thank you @gebeer!
  12. Hello @Jan Romero, thank you for the clarification. Very helpful. I could add the individual items to WireCache now. As far as the resultlist is concerned, there are unfortunately still a few things going on. The list consists of several sequential finds() and there is a tag list as an isotope filter-menu*, ... so I'm leaving the MarkUpCache continue to run for now. A very special thanks for your sidenote... that explains many a… I wasn't aware of what I was doing, and yes indeed I had problems with WireCache after hijacking it. *while trying to find the bottleneck(s) with profilerPro I found one exceptional hungry candidate, but that's another topic.
  13. Hello, I'm struggling with a query in search results that slow down the rendering way too much. So much I appreciate the processwire api, I may have done stupid things with it. I have a site-search for documents (pages). After retrieving the matches, I query for the used tags at each page to render a tag-filter menu (isotope.js). In addition there is a counter on each tag label to show the usage of this tag by documents in the current result list. Thats my code… //$matches : found pages //$tags : collection of all tags used by $matches (a tag is a page) //$page->tax_tag : is page reference field at document pages, multiple select foreach ($tags as $tag) { $usage = 0; foreach ($matches as $doc) { if ($doc->tax_tag->has("id={$tag}")) $usage++; } $label = "{$tag->get('title')} {$usage}"; … } I guess that's award-worthy for producing as many unnecessary database hits as possible ... 😇 What do you think is the right way to get this data out of the database? Is anybody out there with a blazing sql-query to get all that tag-info in one hit?
  14. Hello @ryan, maybe you can give me a short hint if it is in principle not possible to have subcaches in a cache call? In the meantime I tried my luck with namespaced caches - without success - same result as described above. Thank you!
×
×
  • Create New...