Jump to content

kongondo

PW-Moderators
  • Posts

    7,473
  • Joined

  • Last visited

  • Days Won

    144

Everything posted by kongondo

  1. Hi @douwe, Welcome to ProcessWire and the forums. Was this page created before or after you enabled $config->pagefileSecure? pagefileSecure only works for pages you created after you enabled it. I am not 100% sure the same constraint applies in the case of template-level secure files.
  2. Hey folks, I love the discussion, but please, we are getting OT ?. This thread is for Tailwind CSS. Please open a separate topic (if one doesn't already exist) if you wish to discuss other frameworks. Thanks ?.
  3. I am not sure it can be any clearer than what is already stated in the respective documentation. $sanitizer line() (emphasis is mine). $sanitizer->lines().
  4. Glad it works! There's more info here about double versus single quotes and use of backslash. I don't think there is, but then again I am not 100% up to date. Not necessarily the same thing but selectorValue() has this: You can also use this: Someone more knowledgeable could chime in here ?.
  5. With the much improved docs, these days, this should not be your first point of call ?. Yes, this should be the first place you check. By default, yes. However, there are options to refine how the sanitizer should work. Did you have a look at the white/blacklist options? This works fine with a Textfield called bid with a value of $100. <?php namespace ProcessWire; $allow = ["$"]; $selector = $sanitizer->selectorValue("$100", ['whitelist' => $allow]); $bids = $pages->find("bid=$selector");
  6. This is due to a backward incompatible change introduced in PHP 7.2. Line #341 of ProcessBatcher has this code: <?php namespace ProcessWire; if (!count($this->input->post->title)) { // code } That needs to be changed to ensure that the variable being counted ($input->post->title) is an array or a countable object. Best to send @Wanze a pull request.
  7. One way to do it: <?php namespace ProcessWire; $checkedPagesCount = $pages->count("name_of_checkbox_field=1"); You might want to refine the selector, e.g. limit to a parent or template(s). untested. Edit I see @lokomotivan beat me to it ?.
  8. Maybe a file and directories ownership issue since you state that: I am assuming you have also tested with 'small sized' images. I would look into file and directories ownership first. The usual scenario is there is a www-data user and group. ProcessWire would belong to that group and will be able to write to /site/assets/files/. Have a look at this page to troubleshoot permission issues: https://processwire.com/docs/security/file-permissions/ Regarding this: It usually means PHP responded with a fatal (or other) error. If you have $config->debug = true, or better, have TracyDebugger installed, you will see the exact error the server returned. You can also see these in your sites error logs. The text of the the response breaks the JSON (malformed), hence the Unrecognized token.... This is the so-called 418 I'm a teapot response! ?.Basically, the server is saying you are asking it to do the impossible; brew coffee but it is a teapot! You can read more about it here https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418 and how an April Fool's joke turned into this status by reading here https://sitesdoneright.com/blog/2013/03/what-is-418-im-a-teapot-status-code-error .
  9. Touché! ?. In my own modules though, I am eliminating jQuery. Wherever possible I use vanilla JavaScript.
  10. You will need to unlearn jQuery ?. There's a difference between an "error" and an "exception". I am guessing uikit is probably using fetch() internally? If using vanilla JS... TL;DR From the fetch() docs: To the solutions Handling Failed HTTP Responses With fetch() How to handle HTTP code 4xx responses in fetch api
  11. @benbyf, moderator note A near identical topic was created yesterday. I have combined your threads. @Simi I have modified the thread title slightly to better reflect the issue you are facing.
  12. I can't remember if I ever tested this inside Lister but I doubt it will work. Lister retrieves values from the database. This field has no database table. I'll have a look if a workaround is possible but you might have to wait a long time. PRs welcome though :-).
  13. @adrian. Is this currently possible though? Are you saying it is possible for ProcessWire to detect which modules are helper/child modules?
  14. Welcome to the forums @malvarco and thanks for sharing your work with us ?.
  15. Hi @sambadave, The module needs a file field (FieldtypeFile). It does not work with ProcessWire image fields (FieldtypeImage). Using image->width() should have thrown an error since Pagefile does not have such a method as compared to a Pageimage object. IIRC, there is a way you can tell ImageSizer to resize custom images (e.g. in a FieldtypeFile) but I can't seem to find the relevant forums posts at the moment. How did you manage to do this? Are you saying you managed to use an image field with ImageMarker? ?
  16. I'm not sure I follow the question. Do you want to use ProcessWire with MongoDB? If yes, it won't work. ProcessWire only supports MySQL.
  17. Yes, there is a review process. Normally, module authors would indicate this in their support thread, something along the lines of 'the module has been submitted to the modules directory and is awaiting review. The module is hosted on GitHub....link' ?.
  18. @carlitoselmago, Do we have a link to this module's project page and/or download page?
  19. @VeiJari, Works fine for me here with the code I posted above. <?php namespace ProcessWire; // get current user $user->of(false); // $user->project_references = $someOtherPage;// @note: not sure it works in all contexts // $user->project_references->add(1654); $user->project_references->add($pages->find("template=basic-page,parent=1651")); // $user->save(); $user->save('project_references');// saving just the multipage reference field What is $userToCreate?
  20. A Media Manager field is not the same as an images field. It has no getTag() or findTag() methods. Please read more about this here and here. Currently, there is no direct way of achieving what you want.
  21. @DV-JF, No, there isn't. For such cases, we have getMenuItems().
  22. @DV-JF Use a try catch block like this: <?php namespace ProcessWire; $menuItemsAsArray = [];// only if use getMenuItems() $menu = ''; $menus = $modules->get('MarkupMenuBuilder'); try { // no error: render menu $menu = "<div>"; $menu .= $menus->render('footer-3', $scnd_options); $menu .= "</div>"; // OR IF USING getMenuItems() //$menuItemsAsArray = $menus->getMenuItems('footer-3'); } catch (\Throwable $th) { //bd($th, 'ERROR'); // get error message (No menu items found! Confirm that such a menu exists and that it has menu items.) $menu = $th->getMessage(); } // if using menu items array if(!empty($menuItemsAsArray)){ // build menu from array }
×
×
  • Create New...