lpa
Members-
Posts
221 -
Joined
-
Last visited
lpa's Achievements
Sr. Member (5/6)
28
Reputation
-
When having PagePathHistory module installed and moving a whole subtree of pages to a new location, should all the children get correctly redirected too? Old situation: - FrontPage -- /2024/ -- /2024/somepage/ -- /oldyears/ New situation: - FrontPage -- /2025/ -- /oldyears/2024/ -- /oldyears/2024/somepage/ What happens when accessing /2024/somepage/? I think it should be redirected to /oldyears/2024/somepage/, but I think it gives me a 404 error.
-
Create new pages through Page Reference field as children of the current page?
lpa replied to lpa's topic in General Support
Great! That was just what I needed. I think there is something missing or a bug in AdminPageFieldEditLinks as it says it should give me the opportunity to select the path where save the new page if no Parent is given. Now it gives me an error. And maybe the Select Parent should somehow support the dynamic parent to be the current page. -
Create new pages through Page Reference field as children of the current page?
lpa replied to lpa's topic in General Support
Thank you for your answer. Off course I know that it should work like that. Maybe my question was not clear enough. I asked, how could I define the new pages to be created as childs of the current page as I can't select the "current page" dynamically. I tried to define it like "parent=[page]", but that did not work. -
I have defined a Page Reference field in my template. I want to be able to create new pages through that field. I am using AdminPageFieldEditLinks-module. My problem is that I would like to define the new pages to be created as childs to the current page. I don't know how to define Selectable Pages to be the children of the current page. If I leave Selectable pages:Parent empty, I get the error: ProcessWire: ProcessPageAdd: No parent templates defined for <template> Any idea if this is possible and how to define the target of the new pages to be children of the current page?
-
I tried this module and it crawls the links. The status of links is updated and the database contains the links. But the GUI does not show the lists of links and the menu tabs or "broken". PW version 3.0.234 and PHP 8.1. Is this module still maintained or is there some better alternatives? EDIT: The problem wwas this: The console has this Jquery error: JqueryCore.js?v=1.12.4:1 Uncaught Error: Syntax error, unrecognized expression: a[href^=#link-checker]:not(:first):not(a[href^=#link-checker-check-now]) at Sizzle.error (JqueryCore.js?v=1.12.4:1:18926) at Sizzle.tokenize (JqueryCore.js?v=1.12.4:1:28664) at Sizzle.select (JqueryCore.js?v=1.12.4:1:34917) at Function.Sizzle (JqueryCore.js?v=1.12.4:1:11015) at a.find (jquery-migrate-quiet…in.js?sblspu:2:3686) at jQuery.fn.init.find (JqueryCore.js?v=1.12.4:1:38739) at a.fn.find (jquery-migrate-quiet…in.js?sblspu:2:8931) at jQuery.fn.init (JqueryCore.js?v=1.12.4:1:40240) at new a.fn.init (jquery-migrate-quiet…in.js?sblspu:2:3137) at jQuery (JqueryCore.js?v=1.12.4:1:663) This was fixed putting quotes arand the anchors on line 121 in ProcessLinkChecker.js: $('a[href^="#link-checker"]:not(:first):not(a[href^="#link-checker-check-now"])').on('click', function() { In addition to the above, there are these warnings: Warning: Undefined variable $wire in www/site/assets/cache/FileCompiler/site/modules/ProcessLinkChecker/LinkCrawler.php on line 136 Warning: Undefined variable $wire in www/site/assets/cache/FileCompiler/site/modules/ProcessLinkChecker/LinkCrawler.php on line 143 Warning: Array to string conversion in www/site/assets/cache/FileCompiler/site/modules/ProcessLinkChecker/LinkCrawler.php on line 335
-
We have some CLI and API scripts, that are not bound to Processwire pages/templates. They include PW at the start and then do something like: foreach ( $pages->find('template=item, derp=derpson') as $item ) { echo $item->field_with_multilang; } In these scripts we cannot get PW to honor the default language, user language or anything else. The only way to get this to work is to $item->field_with_multilang->getLanguageValue('default') We're hoping to avoid this because out application is vast, and many modules are used both in $page context and in cli scripts. This mean that we cannot have confidence in the type of the field and writing code like if ( is_string(<field>) ) { do this } else { do that } would cause massive bloat. Please advice. How can we force default language at the start of the script? PS We've already tried stuff like: $user->langauge = $languages->getLanguage('default'); $languages->setLanguage('default');
-
I try to get info for an old url-path found in PagePathHistory. $p->getPathInfo() does not return anything but the basic empty reply. What am I doing wrong? $p = $modules->get('PagePathHistory'); $p->getPathInfo("/en/about/child-page-example/") array (10) 'id' => 0 'path' => '/en/about/child-page-example' 'language_id' => 0 'templates_id' => 0 'parent_id' => 0 'created' => '' 'status' => 0 'name' => '' 'matchType' => '' 'urlSegmentStr' => '' And that page is found in the database page_path_history table: INSERT INTO `page_path_history` (`path`, `pages_id`, `created`, `language_id`) VALUES ('/en/about/child-page-example', 1002, '2024-04-13 16:31:53', 0); The module PagePathHistory is version 0.0.8 and PW version 3.0.237.
-
What happens in an internal redirect? How to distinguish between 301 and 404
lpa replied to lpa's topic in General Support
It seems to me, that the http404-page is rendered before the decission to redirect to the page in page path history is done. I would like to know when rendering http404, that there will be a redirect and the http404 page should not be tracked in Matomo as a page load. But I can't figure out how to detect this. HTTP_REFERER does not help, as I am interested to detect the forthcoming 301 before the 404 page is rendered. -
What happens in an internal redirect? How to distinguish between 301 and 404
lpa replied to lpa's topic in General Support
My straightforward question is: How can I determine on the '/http404/' page whether it's being accessed solely due to a redirect with a status code of 301 leading to the updated URL? -
I am trying to implement server level analytics calling Matomo PHP tracking API from page footer.php that is included in every template. When I call for a renamed page URL handled by a 301 redirect, it seems to go first to '/http404/'. The $_SERVER['REQUEST_URI'] for the call is '/oldpath/pagename/'. It is handled by '/http404/' having URL '/http404/pagename/' in URL column when logging with `$log->message($page->url)`. I don't understand what is really happening here. How should I detect that the requested path was '/oldpath/pagename/' and that it caused a 301 redirect and it should not be tracked in Matomo as a page load?
-
I have had problems with this module lately with errors to contact reSmush.it: reSmush.it (auto): Error optimizing /site/assets/files/1022/xxx.jpg, 0 ? (possible request timeout) Has anybody else had problems with this module lately?
-
We have logging of almost every page request like this: $log->save('userdb_log', $message); $log->prune('userdb_log', 30); The problem is, that the file is not saved for 30 days, but only for a few minutes. There is this error found regarding this: unlink: Given filename is not a file or link: /site/assets/logs/userdb_log.txt And then: rename: Given pathname ($oldName) that does not exist: /site/assets/logs/userdb_log.txt.new Is it not ok to try to prune the file just after the save every time? Where should the pruning then happen?
-
I have a selector: template=adsales-entry, banner_file|video_file|is_html5|html!= template=adsales-entry, banner_file|video_file|is_html5|html!= After upgrading it does not find anything, but this one still finds: template=adsales-entry, banner_file!= Is there anything that explains why multiple field selector does not work with the new version?
-
Any plans on adding this to PW, @ryan?
-
The problem seems to be when the database has an empty description field which is returned as an array on line 429: $description = wireDecodeJSON($item['description']); With TracyDebugger bd($description) I get: Array Before line 452 $description = $sanitizer->entities($description); bd($description); gives: "Array" And after the sanitizer bd($description); gives: array-0