Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

4 Neutral

About rooofl

  • Rank
    Jr. Member

Recent Profile Visitors

3,095 profile views
  1. Great! $sanitizer->pageName("raphaël", true) does the trick indeed. Thank you!
  2. I need to find the sinitizer used to generate page names from page titles. I found $sanitizer->pageName() but it seems to ignore special characters: With $sanitizer-> pageName(), raphaël becomes raphal, however in the PW back-end the page title raphaël becomes raphael. Any idea what I should use instead?
  3. Thank you both, I didn’t understand the use of of(false).
  4. Saving the page doesn’t solve my problem…
  5. Hello, I am trying to add a page to Page Reference field. Here is what I do: $testpage = $pages->get(1252); // Page to edit $designersField = $testpage->designers; // Page field to fill $designerArray = []; $toadd = $pages->get(1200); // Page to add array_push($designerArray, $toadd); $designersField = PageArray($designerArray); // $testpage->save(); should I save? var_dump($designersField); When I var_dump() the page, I can see that my `designer` page has been aded. However in the admin page view, nothing is listed in the AsmSelect field. What do I miss?
  6. I can’t figure what is happening: I can echo the page I select using find("template=…") but when I pass it to render() nothing is listed. Everything works fine with the basic-page template however. $items = $pages->find("template=basic-page"); // working $items = $pages->find("template=ressource"); // not working with my custom template $rss->render($items);
  7. I can’t list my selected page, just like @adickman. I suspect it is related to the page or field permissions because 1. I can see other templates (basic-page for instance), 2. if I comment the viewable condition in the MarkupRSS module, I can see my feed correctly. I also tried to check the “Make field value accessible from API even if not viewable (see below)*” box on my template page but it does not work. What else can cause a page’s template to be inaccessible from the API?
  8. I solved that with a hook in `site/ready.php` <?php $forms->addHookBefore('FormBuilderProcessor::processInputDone', function($e) { $form = $e->arguments(0); if($form->name == 'new_submission') { $pageTitle = "test"; $toFind = wire(pages)->find("title=$pageTitle"); if (count($toFind) == 0) { $page = new Page(); $page->parent = "/config/designer/"; $page->template = "designer"; $page->title = wire(sanitizer)->text($pageTitle); $page->save(); } } }); ?>
  9. Hello, I need users to add new entries to a page reference field, just like a “Create New” action. Is that possible in a form?
  10. I sloved my issue by removing the affected page field and building it again with the module Connect Page Fields
  11. Hello, when I try to edit some of the older pages of my website, the admin page returns the following error: Fatal Error: Uncaught Error: Call to undefined function wire() in /home/rbastide/externe/usemodify/wire/modules/Inputfield/InputfieldPage/InputfieldPage.module(305) : eval()'d code:4 Stack trace: #0 /home/rbastide/externe/usemodify/wire/modules/Inputfield/InputfieldPage/InputfieldPage.module(305): eval() #1 /home/rbastide/externe/usemodify/wire/core/Wire.php(383): ProcessWire\InputfieldPage->___findPagesCode(Object(ProcessWire\Page)) #2 /home/rbastide/externe/usemodify/wire/core/WireHooks.php(733): ProcessWire\Wire->_callMethod('___findPagesCod...', Array) #3 /home/rbastide/externe/usemodify/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\InputfieldPage), 'findPagesCode', Array) #4 /home/rbastide/externe/usemodify/wire/modules/Inputfield/InputfieldPage/InputfieldPage.module(359): ProcessWire\Wire->__call('findPagesCode', Array) #5 /home/rbastide/externe/usemodify/wire/core/Wire.php(383): ProcessWire\InputfieldPage->___getSelectablePages(Object(ProcessWire\Page)) #6 /home/rbastide/externe/usemod (line 4 of /home/rbastide/externe/usemodify/wire/modules/Inputfield/InputfieldPage/InputfieldPage.module(305) : eval()'d code) This error message was shown because: you are logged in as a Superuser. Error has been logged. I have no idea how to solve it, as apparently, this is not related to my template directory. [Edit]: I think I remember having changing something a while ago, a hook maybe, to make the page fields relations both way. Now it doesn’t work and the problem above appears when I create relations between some pages. I am stuck because I can’t change those relations in the admin edition page.
  12. That was the problem! Thank you Soma.
  13. Hi! Everything work as expected with my configuration of the Multisite module : $config->MultisiteDomains = array( "foo.com" => array( // domain name can be used to map to root page "root" => "/ml", // page name for the root page "http404" => 27 ), "law.foo.com" => array( // domain name can be used to map to root page "root" => "/law", // page name for the root page "http404" => 27 ) ); …except when I try to loop over pages: $siteRoot = $page->rootParent; $parent = "/".$siteRoot->name."/projects"; $projects = $pages->find("template=project, parent=$parent, sort=sort"); foreach($projects as $project){ $firstimg = $project->images->first->width(1000); echo "<a href='{$project->url}'><img src='{$firstimg->url}'></a>"; } The code below outputs a list of links that targets foo.com/ml/projects/post-title foo.com/law/projects/post-title instead of foo.com/projects/post-title law.foo.com/projects/post-title What am I doing wrong?
  14. Hello, I get often logged out from a web service built with PW. This web service has a large database and I use ListerPro to let my client browse and interact with it. After a couple of manipulations, or around 2-3 minute after logged in, the login page appears again. In this process, the last data submitted in the admin get often lost. About my configuration: The website is hosted on one of the first plans of OVH server (cheap ones), can it may be related to the problem? I uninstalled all the extra modules I used (Redirect, AdminCustomFiles). Nothing changed. The problem appeared recently only (since around 4 days) The website is still using basic http There is nothing interesting neither in `site/assets/logs/errors.txt` nor `site/assets/logs/modules.txt` I sometimes get the red error `This request was aborted because it appears to be forged.` together with `The process returned no content.` after a login attempt. I saw on this forum that it can be related to access rights and checked a couple of files permissions, and I *think* everything is fine. Thanks in advance for your help.
  15. Thank you both for your answers. The problem solved itself after a day, I guess it is related to a cache issue.
  • Create New...