-
Posts
7,473 -
Joined
-
Last visited
-
Days Won
144
Everything posted by kongondo
-
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.
-
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 ?.
-
sanitizer: line() and lines() vs text() and textarea()
kongondo replied to DrQuincy's topic in Getting Started
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(). -
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 ?.
-
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");
-
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.
-
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 ?.
-
Problems after hosting company upgraded to Debian 10
kongondo replied to caffeineben's topic in General Support
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 . -
Touché! ?. In my own modules though, I am eliminating jQuery. Wherever possible I use vanilla JavaScript.
-
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
-
Module Module: RuntimeMarkup Fieldtype & Inputfield
kongondo replied to kongondo's topic in Modules/Plugins
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 :-). -
Gotcha.
-
@adrian. Is this currently possible though? Are you saying it is possible for ProcessWire to detect which modules are helper/child modules?
-
Welcome to the forums @malvarco and thanks for sharing your work with us ?.
-
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? ?
-
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' ?.
-
@carlitoselmago, Do we have a link to this module's project page and/or download page?
-
@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?
-
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.
-
Yes
-
@DV-JF, No, there isn't. For such cases, we have getMenuItems().
-
@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 }