Jump to content

ngrmm

Members
  • Posts

    249
  • Joined

  • Last visited

Everything posted by ngrmm

  1. @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
  2. @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
  3. 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.
  4. Did you check your Browser-Settings? DNT-Mode? Ad-Blocker?
  5. 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, ] }
  6. 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. • …
  7. @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?
  8. it's solved. There was an issue with https://www.domain.com and https://domain.com. $config->httpHosts = array('domain.com', 'www.domain.com'); was missing and I activated redirects from https://domian.com to https://www.domain.com
  9. On one of my PW-installations I'm not able to view unpublished pages as superuser. Getting redirected to the 404-page running ProcessWire 3.0.184 and no errors showing up.
  10. Actually this is perfect, as I don't need all the page data. But unfortunately it outputs the page ID as key, what don't want to have. Maybe there will be some options in the future to change this default behaviour. Thanks @Zeka anyway, the other solution works perfectly!
  11. wow much easier than i thought. And what is the correct syntax to go more levels deeper? Let's say one my tags has also page-reference-field itself.
  12. thx @Zeka I got it working with a temporary loop inside my foreach-loop (see update on my post). Actually I needed the tags to be arrays themself. But your method looks better. Is there a way to output the tags as arrays themself with your method?
  13. I know there are some modules (pageQueryBoss, GraphQL, …) this. But non of them outputs exactly how i would like my json to be. So i tried to do it manually: $list = $pages->get(1234)->children; $list_array = array(); foreach($list as $listItem) { $list_array[] = array( 'title' => $listItem->title, 'id' => $listItem->id, 'tags' => array( 'ids' => $listItem->page-reference-field ) ); } $list_json = json_encode($list_array, true); echo $list_json; How do I loop through a page-reference-field inside an array? UPDATE: i think, thats the way to do it $list = $pages->get(1234)->children; $list_array = array(); foreach($list as $listItem) { $listItemTags = array(); foreach($listItem->tags as $tag) { $listItemTags[] = array( 'id' => $tag->id, 'title' => $tag->title, ); } $list_array[] = array( 'title' => $listItem->title, 'id' => $listItem->id, 'tags' => $listItemTags ); } $list_json = json_encode($list_array, true); echo $list_json;
  14. What ever lived before dinosaurs, I'm one of those 🙂 I use Nova as Code Editor which has a FTP-client builtin. Most of the time I'm working on the live-server. ProCache takes care of my scss-files Modules: PrivacyWire, Jumplinks, ProtectedMode, lot of the ProModules, … ProfileSiteExporter for moving Sites I also do not offer hosting Even with a limited setup as mine, there is a lot possible with ProcessWire. What a great CMS and community. btw: Happy new year to you all!
  15. @dadish I tried the above code <?php namespace ProcessWire; echo $_POST['query']; and I'm getting this error in TracyDebugger PHP Notice: Undefined index: query in .../httpdocs/xxxxxxxxxxx/site/templates/graphql.php:3 My graphi template has the forward slash activated. Just to understand this, is it right that I first configure the output with the GraphiQL-tool. And this output is then shown on /graphql/ as json? UPDATE: seems it has something to do with my site-settings I tried it in JS and it works However when I use /graphql/ as URL i see an object in the console. When I use /processwire/setup/graphql/ I see a json in the console $.post( '/graphql/', { query: "{ eventsArticle { list { id } } }" }, function (res) { console.log(res); } );
  16. {"errors":[{"message":"Syntax Error: Unexpected \u003CEOF\u003E","extensions":{"category":"graphql"},"locations":[{"line":1,"column":1}]}]} I'm getting this error for the GraphQl page for domain.com/subfolder/graphql/ GraphiQl (domain.com/subfolder/graphiql/) is working fine. Also domain.com/subfolder/processwire/setup/graphql/ I assume this has something to do with my pw-installation inside a subfolder? I already saw that hint with the slash and also tried this in my graphql-template <?php namespace ProcessWire; header('Content-Type: application/json'); $ProcessGraphQL = $modules->get('ProcessGraphQL'); $ProcessGraphQL->GraphQLServerUrl = '/subfolder/graphql/'; echo json_encode($ProcessGraphQL->executeGraphQL(), true); In my htaccess i have RewriteBase /subfolder/ and in my config file I still have $config->httpHosts = array('domain.com', 'www.domain.com');
  17. I exported a profile and wanted to install it on another webspace. I've done this hundred times and it works always. But this time the install-process fails before the last step. The screen where you can enter admin name and password does not appear. The browser gives me an 200 Error for install.php I can not login into the backend (no user account set yet). At the frontend I get different errors. Looks like any functions linke css() (ProCache) and render() (Formbuilder) causes errors. The server is running php 7.4 and mysql 5.7 PW is the latest masterversion the install.sql in my exported has a 16.4mb filesize the phoinfo() says 120 max time for php executions. Could this be the problem? the first frontend errorlogs after installation fails: 2021-12-14 15:06:19 ? ? You must assign a template to the page before setting custom field values (name1062) [pageClass=ProcessWire\Page, template=] 2021-12-14 15:06:19 guest https://xxxxxxxxxx.com/_new2/ You must assign a template to the page before setting custom field values (name1062) [pageClass=ProcessWire\Page, template=] one after some refreshes in the browser 2021-12-14 15:21:50 guest https://xxxxxxx.com/_new2/ Fatal Error: Uncaught Error: Call to a member function css() on null in /homepages/21/d521107727/htdocs/xxxxxxx/_new2/site/templates/_inc/header.php:50 Stack trace: #0 /homepages/21/d521107727/htdocs/xxxxxxx/_new2/site/assets/cache/FileCompiler/site/templates/home.php(4): include() #1 /homepages/21/d521107727/htdocs/xxxxxxx/_new2/wire/core/TemplateFile.php(327): require('/homepages/21/d...') #2 /homepages/21/d521107727/htdocs/xxxxxxx/_new2/wire/core/Wire.php(414): ProcessWire\TemplateFile->___render() #3 /homepages/21/d521107727/htdocs/xxxxxxx/_new2/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod('___render', Array) #4 /homepages/21/d521107727/htdocs/xxxxxxx/_new2/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #5 /homepages/21/d521107727/htdocs/xxxxxxx/_new2/wire/modules/PageRender.module(554): ProcessWire\Wire->__call('render', Array) #6 /homepages/21/d521107727/htdocs/xxxxxxx/_new2/wire/core/Wire.php(417): ProcessWire\PageRender->___renderPage(Object(Proce (line 50 of /homepages/21/d521107727/htdocs/xxxxxxx/_new2/site/templates/_inc/header.php)
  18. maybe because of the 0 values for x and y? btw, do you do that?
  19. @joshua I'm using GoogleMapsApi on a page. And did this: <?php // allow button echo "<a class='privacywire-consent-button' data-consent-category='external_media'>allow cookies</a>"; $address = $content->map_address->address; $lat = $content->map_address->lat; $lng = $content->map_address->lng; echo "<script > var lat,lng,zoom; lat = $lat; lng = $lng; </script>"; // map stylung and render function echo "<script type='text/plain' data-type='text/javascript' data-category='external_media' data-src='{$templatesUrl}scripts/gmaps.js' class='require-consent'></script>"; // maps API echo "<script type='text/plain' data-type='text/javascript' data-category='external_media' data-src='https://maps.googleapis.com/maps/api/js?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX&callback=initMap' class='require-consent'></script>"; // my map echo "<div id='map' class='wrapper'></div>"; When I click on the allow button, all content disappear and there is a error domain.com/:1 Uncaught (in promise) Qe {message: 'Map: Expected mapDiv of type HTMLElement but was passed null … However the cookies are allowed. So that if refresh the page, everything is fine (cookies allowed and map is shown). What am I missing?
  20. @Pixrael thanks a lot! Great Idea to find out the outdated pages with the timestamp! I learned a lot!
  21. I would like to create pages from a json feed. So i decode my json and create them via API. $jsonData = json_decode($jsonFromOtherWebsite); foreach($jsonData as $jsonDataItem) { $pageTitle = $jsonDataItem->name; $p = new Page(); $p->template = 'import_page'; $p->parent = $pages->get(xxxx); $p->title = $pageTitle; $p->save(); } Let's say the source (json) changes and i have to do another import. Then I want to compare the new json with the existing pages to see if there are new ones and if there some aren't there anymore. Is there a way to compare the new JsonData with my existing pw-pages with the API. Something like foreach($jsonData as $jsonDataItem) { // check if a page with this title exist if($pages->find("template=import_page, title=$jsonDataItem->name") { // update existing field values $getExistingPage = $pages->find("template=import_page, title=$jsonDataItem->name"); // update value $getExistingPage->setAndSave('field', $jsonDataItem->x); } else { // create new page $pageTitle = $jsonDataItem->name; $p = new Page(); $p->template = 'import_page'; $p->parent = $pages->get(xxxx); $p->title = $pageTitle; $p->save(); } } // search for pages wich are not anymore in the json and hide/delete them // …
  22. Thanks @FireWire Actually the folder is already showing up in the error message above. When i do your quick fix i get this: fluency_tools.js:60 POST https://domain.com/_temp/_temp/fluency/data/ 404 moduleRequest @ fluency_tools.js:60 (anonymous) @ fluency.js:579 load (async) (anonymous) @ fluency.js:576 VM752:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) at XMLHttpRequest.xhr.onload (fluency_tools.js:53) xhr.onload @ fluency_tools.js:53 load (async) moduleRequest @ fluency_tools.js:52 (anonymous) @ fluency.js:579 load (async) (anonymous) @ fluency.js:576
  23. are there any known issues with pw-installations inside a folder? It works for me on a website like domain.com but not on pw-installation like domain.com/_temp/ I get this errors on a backend pageload fluency_tools.js:60 POST https://domain.com/_tmp/fluency/data/ 404 moduleRequest @ fluency_tools.js:60 (anonymous) @ fluency.js:579 load (async) (anonymous) @ fluency.js:576 VM287:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) at XMLHttpRequest.xhr.onload (fluency_tools.js:53) xhr.onload @ fluency_tools.js:53 load (async) moduleRequest @ fluency_tools.js:52 (anonymous) @ fluency.js:579 load (async) (anonymous) @ fluency.js:576 @FireWire you hardcoded the paypalme-PNG-Url into FluencyConfig.php (line:365). It's broken. /Fluency/img/paypal_me.png > /Fluency-Translation-main/img/paypal_me.png
×
×
  • Create New...