Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by ngrmm

  1. I tried to import pages from another pw-installation The process results in an error as soon as it starts doing the import. All steps before ok (choosing destination, linking fields, …) working fine. PW creates one page, sets the page name but is not able to set the page title and gives this error: Schwerwiegender Fehler: Uncaught Error: Call to a member function setLanguageValue() on null in wire/modules/LanguageSupport/FieldtypeTextLanguage.module:159 #0 wire/modules/LanguageSupport/FieldtypeTextareaLanguage.module (114): FieldtypeTextLanguage->___importValue(Object(Page), Object(Field), Array, Array) #1 [internal function]: FieldtypeTextareaLanguage->___importValue(Object(Page), Object(Field), Array, Array) #2 wire/core/Wire.php (425): call_user_func_array(Array, Array) #3 wire/core/WireHooks.php (952): Wire->_callMethod('___importValue', Array) #4 wire/core/Wire.php (484): WireHooks->runHooks(Object(FieldtypeTextareaLanguage), 'importValue', Array) #5 wire/core/PagesExportImport.php (957): Wire->__call('importValue', Arr (Zeile 159 in wire/modules/LanguageSupport/FieldtypeTextLanguage.module) Diese Fehlermeldung wurde angezeigt wegen: Sie sind als Superuser angemeldet. Fehler wurde protokolliert. Both sites have the same languages installed (default/de) This is an example of my json: { "type": "ProcessWire:PageArray", "created": "2023-05-18 11:32:25", "version": "3.0.200", "user": "admin", "host": "website.com", "pages": [ { "type": "ProcessWire:Page", "path": "/path/path/some-title/", "class": "ProcessWire\\Page", "template": "team_member", "settings": { "id": 13702, "name": "some-title", "status": 1, "sort": 31, "sortfield": "sort", "created": "28-03-2022 18:39:22", "modified": "28-03-2022 18:46:39", "name_en": null, "status_en": 1 }, "data": { "title": { "default": "Name LÖL", "en": "Name LÖL" }, "headline": { "default": "", "en": "" }, "phone": "0987654321", "email": "email@website.com", "body": { "default": "<p>text</p>", "en": "" } } }, …
  2. this worked $this->addHookBefore('Pages::save', function($event) { $p = $event->arguments("page"); if($p->id == "1599") { $p->of(false); foreach($p->table as $row) { if($row->pass == "") { $pass = new Password(); $string = $pass->randomAlnum(22); $row->pass = $string; } } } });
  3. I would like to run this via a hook: $page->of(false); foreach($page->table as $row) { if($row->pass == "") { $pass = new Password(); $string = $pass->randomAlnum(22); $row->pass = $string; } } $page->save('table'); and tried this: $this->addHookAfter('Pages::save', function($event) { $p = $event->arguments('page'); if($p->id == 1599) return; // my page $p->of(false); foreach($p->table as $row) { if($row->pass == "") { $pass = new Password(); $string = $pass->randomAlnum(22); $row->pass = $string; } } $p->save('table'); }); But I get a 500 error. Is it an infinite loop? SOLVED
  4. @MoritzLost I added it this way. Thanks a lot for the help and the module! Another question that I have: If I wanted to add it manually, where in your snippet do you choose the specific form? Or would it add the hCaptcha to all forms? // site/init.php wire()->addHookAfter('ProcessPageEdit::buildForm', function (HookEvent $event) { $form = $event->return; $submitButton = $form->getChildByName('submit_save'); if ($submitButton) { $hCaptcha = $event->wire('modules')->get('InputfieldHCaptcha'); $hCaptcha->set('label', __('Spam Protection')); // ... configuration goes here $form->insertBefore($hCaptcha, $submitButton); } $event->return = $form; });
  5. @MoritzLost Are you sure you're not logged in, and your guest user doesn't have the permission to bypass the captcha? yes Maybe the form was cached while you viewed it as the admin, and the guest user is seeing the cached output without the captcha input? I guess that is not the case What happens if you submit the form (as the guest user) while the captcha is not visible - do you get an error or does the submission succeed? It gives me this Error: [fieldname] - Captcha response is missing. Please fill out the captcha and try again. Depending on selected strength and hCaptcha subscription (if any), the script may not always show a visible captcha if it's confident you're a real user. Try reloading the page with the DevTools open - is the hCaptcha script being loaded? I was testing it always with devtools open with reset-cache-mode active If so, maybe it's just using a hidden captcha. If not, the inputfield is probably not included at all, then it's probably an issue with your template. Can you post your form builder template? Depending on how your template is built, you might need to include the hCaptcha inputfield manually. Maybe you could try it yourself on a Test-PW-Installation. Just generate a FormBuilder form with simple text fields and a hcaptcha field and try out embed-option D. Generate a copy markup of the form via FormBuilder. PW generates a copy here: /site/assets/cache/FormBuilder/ After copying it to /site/templates/FormBuilder/ the hcaptcha-field won't show up
  6. @MoritzLost having the same problem. Nothing shows up. Using PW 3.0.200 FB 5.3 and latest hCaptcha-Inputfield. I added it to my form as per instructions with secret and site keys from hCaptcha. I tried it in another Browser as a guest-user. Still nothing to see. I'm using the custom markup embed option (D). So when I generate the markup via formbuilder there is no sign of the captcha field in the markup. echo $forms->embed('form_name'); But also if I use the B option echo $forms->render('form_name'); still nothing. Any Idea what I'm doing wrong? UPDATE: It looks like it's not compatible with the option D of embedding forms. As long there a file with same name as the form here: /site/templates/FormBuilder/… the captcha is not there. Is there a way to add it manually?
  7. @Robin S thanks! Okay. The history is empty! my page names are /20years (default – language) /de/20Jahre (de – german second language) When I enter www.domain.com/20jahre the page shows up but in the default language. Is there any cache that I have to empty? Even if I add de:/20jahre in the backend, it does not work as it should. UPDATE: Or is it a problem to have a redirect url-name like the page name of the non default language?
  8. yes it is installed. It is still giving this error Call to a member function getPathHistory() on null maybe it is because it's a backend module and has to be initialized on the frontend before?
  9. I have a redirect problem with a page inside a multi language website and would like to have a look at the page path history of that page. But I get an error if I use this for example: https://processwire.com/api/ref/page-path-history/ $array = $pagePathHistory->getPathInfo($page); // Error: Undefined variable: pagePathHistory on line: 1 Exception: Call to a member function getPathInfo() on null on line: 1 How can I use the page-path-history class.
  10. Good idea, but maybe it's better to have this optional. I explained this so many times to clients but some of them still would like to have something like an explainer popup. But another topic is the obligation to protocol clicks/sessions (GDPR) for sites which have more than necessary cookies. I messaged @joshua a while ago, but he had no time back then. Maybe someone else could come up with a solution? I don't have the skill to do that, but would be happy to sponsor the work.
  11. no thx 🙂 but maybe to @joshua the creator of the module.
  12. "Accept all" means YES to all groups "Accept necessary cookies only" means YES only to necessary cookie (NO to statistics, external …) Try it like in the docs: <script type="text/plain" data-type="text/javascript" data-category="statistics" data-src="/path/to/your/statistic/script.js"></script> Do you work local or on a webserver?
  13. @Web-ID you could do it like this: <script type="" data-type="text/javascript" data-category="statistics" class="require-consent"> … and remove <noscript>
  14. Looking for someone to link a website to an (AWS) S3 server to get videos via presigned URLs. The website is an archive and each archive item (page) is linked to a video. Things to do: 1. You will get VPN-connections to the website and the S3-server 2. Setup a Bucket on the Server 3. Uplaod a Test-File (mp4 file) 4. Link video page to the mp4 test file on S3-server via AWS SDK for PHP
  15. @Bacelo did you find any solution back then? @Roope I'm using PW 3.0.200 and it looks like the module is stuck somewhere in the process. Script is not added automatically. When I add it manually it does not find anything in the document. So with script added manually and using $sanitizer->emo($string) it find the email and replace it completly with a noscript tag.
  16. yes, your update fixes the issue, thanks!
  17. @teppo I get this error when I add a repaterMatrix field to indexed fields TracyDebugger: TypeError SearchEngine\IndexValue::__construct(): Argument #1 ($value) must be of type string, null given, called in /…/htdocs/domain.com/_NEW/site/modules/SearchEngine/lib/Indexer.php on line 297 search► –––– File: .../domain.com/_NEW/site/modules/SearchEngine/lib/IndexValue.php:33 23: * 24: * @var array 25: */ 26: protected $meta = []; 27: 28: /** 29: * Constructor 30: * 31: * @param string $value 32: */ 33: public function __construct(string $value = '') { 34: $this->value = $value; 35: } 36: 37: /** using pw 3.0.200 © 2022, search engine 0.35.0 and php 8
  18. @joshua does privacywire log user clicks? As far as I understood you must have a „consent log“. „… By default, consents collected through the Cookie Notice banner and/or the Privacy Notice link are automatically logged so that you can access the information at any time. Your consent log is basically a list of users who interact with the banner by either consenting or declining to the use of their information.“ CookieBot for example does this: „Cookiebot CMP stores the user's selection for 12 months, after which the banner automatically reopens to renew the user's consent. … All user consents are automatically logged in anonymized form and encrypted. A data processing contract (DSGVO) is not required. The consent log can be downloaded from the manager and used for documentation.“ or cookiehub: https://www.cookiehub.com/de/produkt/premium/einwilligungsprotokoll
  19. I have a page which imports external json-feed into pages and would like to run this page every day. The Problem is that the import take 10–20 seconds. Is there a way to trigger this import from any other page and let in run in the background? I would like to avoid slow pageloads of other pages, even if it's once a day.
  20. Did you check your Browser-Settings? DNT-Mode? Ad-Blocker?
  21. I use the explode function to generate a json-feed like this $list = $pages->get(1234)->children; $toJSON = $list->explode(function ($item) { return [ 'title' => $item->title, 'id' => $item->id, 'start' => $item->summary, ] } But i would like to use the sanitizer on the summary field. Like this: Obviously this can not work. But how can sanitize the summary before the output? $list = $pages->get(1234)->children; $toJSON = $list->explode(function ($item) { // $itemSummary = $sanitizer->truncate($item->summary, [ // 'type' => 'punctuation', // 'maxLength' => 155, // 'visible' => true, // 'more' => '…' // ]); return [ 'title' => $item->title, 'id' => $item->id, 'start' => $itemSummary, ] }
  22. Looks like it's not possible. It says: • settingsField: Specify a PW field that uses CKEditor to use for the settings of this column. Note that inline mode is always used, regardless of field settings. • …
  23. @FireWire thanks for the module! Is there a way to force regular mode for CKEditorfields inside tables and use fluency? Or are they always in inline-mode, no matter what setting are set?
  • Create New...