Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/14/2018 in all areas

  1. I've updated the first post with info on how to run tests from the browser, so there's no need to have command line access to the server.
    3 points
  2. Hello, Welcome to the ProcessWire forum! Here is a thread discussing such errors:
    2 points
  3. I as have been a bit confused for some time about how the "Markup Regions" functionality in Processwire worked. But i have know read a bit more and think that i am getting to grips with it. And Markup Regions is going to be huge. To aid me in understanding Markup Regions better i started to read the Source code for the new "Regular" theme in conjunction with the Blog about the markup regions. It helped me a great deal to understand the basics and more fine details of it. A tip is to open both links and use the Source code of the "Regular" theme while reading the blog post. The Source code: https://github.com/processwire/processwire/blob/dev/site-regular/templates/_main.php The Blog post: https://processwire.com/blog/posts/processwire-3.0.62-and-more-on-markup-regions/ Markup Regions in ProcessWire (New - 2022-09-08) https://processwire.com/docs/front-end/output/markup-regions/ I hope this could help others starting out with markup regions. Just take it slow and read it a couple a times and soon you will see the greatness of markup regions. /EyeDentify
    2 points
  4. my bad, of course searching before posting would have been more clever - I found it: https://processwire.com/blog/posts/processwire-3.0.39-core-updates/#new-functions-api
    2 points
  5. 2 points
  6. This issue was happening to me all of a sudden. Happened just after uploading a 3MB photo via the admin. Tried messing with permissions and no help. Tried deleting the photo via FTP and suddenly was able to login again. Uploaded another photo and got the "appears to be forged" warning. Then it occurred to me that possibly I had maxed out my allocated storage. This was the case. I increased my space on my hosting account and everything is good again.
    2 points
  7. Custom Inputfield Dependencies A module for ProcessWire CMS/CMF. Extends inputfield dependencies so that inputfield visibility or required status may be determined at runtime by selector or custom PHP code. Overview Custom Inputfield Dependencies adds several new settings options to the "Input" tab of "Edit Field". These are described below. Note that the visibility or required status of fields determined by the module is calculated once at the time Page Edit loads. If your dependency settings refer to fields in the page being edited then changes will not be recalculated until the page is saved and Page Edit reloaded. Usage Install the Custom Inputfield Dependencies module. Optional: for nice code highlighting of custom PHP install InputfieldAceExtended v1.2.0 or newer (currently available on the 'dev' branch of the GitHub repo). The custom inputfield dependencies are set on the "Input" tab of "Edit Field". Visibility Show only if page is matched by custom find Use InputfieldSelector to create a $pages->find() query. If the edited page is matched by the selector then the field is shown. Show only if page is matched by selector As above, but the selector string may be entered manually. Show only if custom PHP returns true Enter custom PHP/API code – if the statement returns boolean true then the field is shown. $page and $pages are available as local variables – other API variables may be accessed with $this, e.g. $this->config In most cases $page refers to the page being edited, but note that if the field is inside a repeater then $page will be the repeater page. As there could conceivably be cases where you want to use the repeater page in your custom PHP the module does not forcibly set $page to be the edited page. Instead, a helper function getEditedPage($page) is available if you want to get the edited page regardless of if the field in inside a repeater or not. $edited_page = $this->getEditedPage($page); Required The settings inputfields are the same as for Visibility above, but are used to determine if the field has 'required' status on the page being edited. https://github.com/Toutouwai/CustomInputfieldDependencies http://modules.processwire.com/modules/custom-inputfield-dependencies/
    1 point
  8. I have put together a very basic module for generating images from the pages of uploaded PDFs. It requires imagemagick, ghostscript, and the imagick pecl extension. It could easily be adapted to work without the imagick extension, but I usually like having exec disabled. At the moment it also requires a couple of specific custom fields: document_pdf (file) and document_thumb (image), both with "Maximum files allowed" set to "1". Obviously I will make these more generic, or add the fields on module install once this is closer to being released. There is some commented code that facilitates image resizing before upload to PW if that is what is wanted. I should also make these configurable module options. Currently I am using this for a searchable list of publications to generate a thumbnail of the cover to place with the description, PDF download link etc. I am planning on extending this a fair bit as I want to use it to generate image previews for each page of the PDF so I can use them in a "look inside" modal lightbox. These would all be stored in a standard images field. I think when I start generating images for all the pages I am going to run up against a speed problem. It could potentially take a few minutes to generate all the images for a large PDF. I was thinking of making use of lazycron, but I think I'd rather see some progress indicator. The other issue is if I use lazycron, then it is possible that someone may visit the site and go to use the look inside functionality before the images for all the pages are ready, so maybe this idea is out. Perhaps the best approach would be to hook into the PDF upload. Once the upload is complete, the module would start generating the images before the page is ever saved by the user. Would really appreciate any suggestions on how to set this up. Off the topic a little, but one other minor consideration in all this is RGB vs CMYK colorspace. If the user uploads an RGB PDF then everything is fine, but if someone uploads CMYK PDFs the colors are often terrible, but there is a tweak that can be made to imagemagick to fix it. Here is a good description of the problem and how to fix it: http://www.lassosoft.com/CMYK-Colour-Matching-with-ImageMagick Basically you need to add the command line option ''-dUseCIEColor'' to all of the GhostScript commands in the delegates.xml file, so that they now look like this: <delegate decode="eps" encode="ps" mode="bi" command='"gs" -q -dBATCH -dSAFER -dUseCIEColor -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 -sDEVICE="pswrite" -sOutputFile="%o" -f"%i"' /> Would anyone else make use of this module? Also, does anyone have any obvious suggestions for what I have so far. It's my first module, and I don't really have a handle on best practices yet. Thanks! PS I know convention is to attach module files, but this one is so short at the moment, it didn't seem worthwhile. <?php /** * ProcessWire ProcessPDFImageCreator * * Process PDF Image Creator creates images from PDFs. * * @copyright Copyright (c) 2013, Adrian Jones * */ class ProcessPDFImageCreator extends WireData implements Module { /** * Return information about this module (required) * * @return array * */ static public function getModuleInfo() { return array( 'title' => 'PDF Image Creator', 'summary' => 'Creates images from PDFs.', 'version' => 001, 'author' => 'Adrian Jones', 'singular' => true, 'autoload' => true ); } /** * Initialize the module and setup hook */ public function init() { $this->pages->addHookAfter('save', $this, 'createPdfImage'); } /** * If document_pdf field contains a PDF, generate an image from the first page. * * */ public function createPdfImage($event) { $page = $event->arguments[0]; if(count($page->document_pdf)>0){ $src = $page->document_pdf->first()->url; if(count($page->document_thumb)==0){ $pdf_filepath = $page->document_pdf->first()->filename . '[0]'; //the appended [0] refers to the first page of the PDF $jpg_filepath = str_replace('.pdf', '.jpg', $page->document_pdf->first()->filename); $resolution = 288; $im = new imagick(); $im->setOption("pdf:use-cropbox","true"); $im->setColorspace(Imagick::COLORSPACE_RGB); $im->setResolution($resolution,$resolution); $im->readImage($pdf_filepath); $geometry=$im->getImageGeometry(); $width = ceil($geometry['width'] / ($resolution/72)); $height = ceil($geometry['height'] / ($resolution/72)); $im->setImageFormat("jpg"); /*if($width>150){ $width = 150; $height = 0; } $im->scaleImage($width, $height);*/ $im->writeImage($jpg_filepath); $page->of(false); $page->document_thumb->add($jpg_filepath); $page->document_thumb->first()->description = $page->title . ' PDF thumbnail'; $page->save(); } } } }
    1 point
  9. Update 2018-07-09: ProcessNetteTester module is available in the Modules Directory and on GitHub. This is a short tutorial on how to use Nette Tester with ProcessWire. As you will see it's very easy to setup and use and it's perfect for testing your code's functionality. With bootstrapping ProcessWire it's also possible to check the rendered markup of pages using the API, checking page properties, etc. It's also a great tool for module developers for writing better code. While there will be nothing extraordinary here that you couldn't find in Tester's docs this can serve as a good starting point. Prerequisites: PHP 5.6+ 01 Download Tester Go to https://github.com/nette/tester/releases and download the latest release (currently 2.0.2). Download from the link reading "Source code (zip)". You can use composer also if you wish. 02 Extract Tester files Create a new directory in your site root called "tester". Extract the zip downloaded here, so it should look like this: /site /tester/src /tester/tools /tester/appveyor.yml /tester/composer.json /tester/contributing.md /tester/license.md /tester/readme.md /wire ... 03 Create directory for test files Add a new directory in "/tester" called "tests". Tester recognizes "*.Test.php" and "*.phpt" files in the tests directory, recursively. 04 Create your first test In the "tests" directory create a new "MyTest.php" file. The first test is a very simple one that bootstraps ProcessWire and checks if the Home page name is "Home". This is not the smartest test but will show you the basics. Add this to "/tester/tests/MyTest.php": <?php namespace ProcessWire; use \Tester\Assert; use \Tester\DomQuery; use \Tester\TestCase; use \Tester\Environment; require __DIR__ . '/../src/bootstrap.php'; // load Tester require __DIR__ . '/../../index.php'; // bootstrap ProcessWire Environment::setup(); class MyTest extends TestCase { // first test (step 04) public function testHomeTitle() { $expected = 'Home'; // we expect the page title to be "Home" $actual = wire('pages')->get(1)->title; // check what's the actual title Assert::equal($expected, $actual); // check whether they are equal } // second test will go here (step 06) // third test will go here (step 07) } // run testing methods (new MyTest())->run(); I've added comment placeholders for the second and third tests that we will insert later. 05 Run Tester Tester can be run either from the command line or from the browser. The command line output is more verbose and colored while in the browser it's plain text only (see later). Running from the command line Navigate to the "/tester" directory in your console and execute this: php src/tester.php -C tests This will start "/tester/src/tester.php" and runs test files from the "/tester/tests" directory. The "-C" switch tells Tester to use the system-wide php ini file, that is required here because when bootstrapping ProcessWire you may run into errors (no php.ini file is used by default). You may load another ini file with the "-c <path>" (check the docs). If the title of your Home page is "Home" you should see this: If it's for example "Cats and Dogs", you should see this: Running from the browser First we need to create a new PHP file in ProcessWire's root, let's call it "testrunner.php". This is because ProcessWire doesn't allow to run PHP files from its "site" directory. The following code runs two test classes and produces a legible output. IRL you should probably iterate through directories to get test files (eg. with glob()), and of course it's better not allow tests go out to production. <?php ini_set('html_errors', false); header('Content-type: text/plain'); echo 'Starting tests.' . PHP_EOL; echo '--------------------------' . PHP_EOL; $file = __DIR__ . '/PATH_TO/FirstTest.php'; echo basename($file) . ' '; require $file; echo '[OK]' . PHP_EOL; $file = __DIR__ . '/PATH_TO/SecondTest.php'; echo basename($file) . ' '; require $file; echo '[OK]' . PHP_EOL; echo '--------------------------' . PHP_EOL; echo 'Tests finished.'; exit; Navigate to "DOMAIN/testrunner.php" in your browser to execute the file. If every test succeeds you should get this: If there are failed tests the execution stops and you can read the error message. If there were more tests (eg. ThirdTest), those won't be displayed under the failed test. 06 DOM test This test will check if a page with "basic-page" template has a "h1" element. We will create the page on the fly with ProcessWire's API. To keep things simple we will add the new test as a new method to our MyTest class. Add this block to the MyTest class: public function testBasicPageHeadline() { $p = new Page(); $p->template = 'basic-page'; $html = $p->render(); $dom = DomQuery::fromHtml($html); Assert::true($dom->has('h1')); } This will most likely be true but of course you can check for something more specific, for example "div#main". Note that we have used the DomQuery helper here (check the "use" statement on the top of the file). 07 Custom function test You will probably want to make sure your custom functions/methods will work as they should so let's write a test that demonstrates this. I don't want to complicate things so I'll check if the built-in "pageName" sanitizer works as expected. Add this to the myTest class: public function testPageNameSanitizer() { $expected = 'hello-world'; $actual = wire('sanitizer')->pageName('Hello world!', true); Assert::equal($expected, $actual); } This should also be true. Try to change the expected value if you are eager to see a failure message. 08 Next steps You can add more methods to the MyTest class or create new files in the "tests" directory. Check out the range of available Assertions and other features in the docs and see how they could help you writing more fail-safe code. Once you make a habit of writing tests you'll see how it can assist making your code more bulletproof and stable. Remember: test early, test often ? If you find out something useful or cool with Tester make sure to share.
    1 point
  10. Currently I do not have to pay for publishing this: "...seeks to impose a link-tax: which would establish a special copyright-like fee to be paid by websites to news publishers, in exchange for the privilege of using short snippets of quoted text as part of a link to the original news article but also to make this an inalienable right, i.e. one that cannot be waived by the publishers even when they choose to do so." But if those money hungry idiots push this thorough, I will. Or I will just simply stop cross-linking: http://www.i-programmer.info/news/81-web-general/11893-why-article-13-must-be-stopped.html Money talks. Insane.
    1 point
  11. To avoid the notice "Trying to get property 'type' of non-object" and possible issues later it's better to check wether the field is really a Field: $f = $fields->get('myfield'); if ($f instanceof Field && $f->type instanceof FieldtypeLanguageInterface) { // do something }
    1 point
  12. Thanks all. I cleared and refreshed browser cache and it didn't make a difference. But, it did make me check my browser version and realized it needed an update (I was using Vivaldi). Once I did that everything is great. Thanks!
    1 point
  13. skynet ? ? I don't think amazon and intel will take the risk for hiding any backdoors or telemetry. It will be discovered sooner or later.
    1 point
  14. I will never understand why people are happy to buy and deploy things like this spying on them. We are living in crazy times when some of us even pay for such things. After Spectre and Meltdown, Intel Management Engine a backdoor and things like that it is just ignorant to assume that such a thing can be "secure". Just hook it up to your wifi router and you'll never know what the future will hold.
    1 point
  15. Hi @theo, WOW. Surely will give it a try. Nice job. By the way, why not update the first post so that others can find the package easier?? Gideon
    1 point
  16. Very nice solution – i had the same issue with user profile pictures … this could work… On one of my pages I have a similar setup, I provide protected files using the page and the filename and then manually serving it using the render hook… Would need to look into the code… Something like > pathtothepage/?f=filename.jpg – because you know the page, you can access the file with PageFilesManager ($page->filesManager) and then send it using http://processwire.com/api/ref/wire-http/send-file/
    1 point
  17. That's likely not going to be trivial. Adding check_access=0 in a selector to display the link is quite another thing as serving the secure file to a guest user. When you have pageFileSecure enabled, the following happens: PW prefixes the file directory site/assets/files/[PAGEID] with $config->pagefileSecurePathPrefix ("-" by default so it will be site/assets/files/-[PAGEID]) When the browsers tries to show the image (i.e. open the URL /path/to/pw/site/assets/files/1258/image.jpg in a separate request), the file isn't found by .htaccess .htaccess hands off the request to index.php index.php calls PageRender::execute with the request URL PageRender::execute checks if the request is to a file, then checks if the page it belongs to is published and viewable by the current user Since $user->hasPermission('page-view', $page) returns false (the guest user doesn't have view permissions) that fails (otherwise, PW would prefix the path now and output the file) PW outputs the 404 page Since the method where the check is are done is not hookable (and some necessary properties and methods are protected, i.e. not reachable from a hook) you'd probably have to hook before ProcessPageView::execute and duplicate a lot of code from ProcessPageView or hook after User::hasPagePermission and at least duplicate ProcessPageView::checkRequestFile in both cases, match the file URL to $page->image to prevent handing out a access to other file/image fields on the page Another approach (if the images aren't too big and the protected pages aren't too many) would be to include the real image data as data URIs: <?php foreach($protected_pages as $protected_page) { echo $protected_page->title . "<br>"; $fn = $protected_page->image->filename; $imgdata = "data:" . mime_content_type($fn) . ";base64," . base64_encode(file_get_contents($fn)); echo "<img src='$imgdata' alt='{$protected_page->image->description}' />"; } If the images are small enough but you have many pages, using PW's pagination might be an option too.
    1 point
  18. Hello If you like, you can now download a demo of this "setup" or "snapshot". I think it's "ready enough" to try it and to see what you think. Donwload this installer file (Duplicator), put it in a web root and rename it to "installer.php" http://pwdev.square7.ch/download/installer.php.txt Put this zip in the same web root http://pwdev.square7.ch/download/2018-06-13_16-03-08-localhost.package.zip Call <yourweb>/installer.php and follow the instructions. An empty MySQL Database is required. If everything went smooth, you can log in as "admin" under /processwire using password: agu3j$Fh832a Then edit "home". You can add, delete, move, resize, dialog-edit and inline-edit the items (colums). At the bottom of the page, you will find "Grid Settings". There you can define which breakpoint will be changed when using wysiwyg resizing. This may be confusing if you change a breakpoint which does not correspond to your current screen width, because nothing happens visibly. You can hover over each element to quickly see the column settings. Some basic understanding of the Boostrap 4 Grid System is recommended (Link provided in the dialog). If you would like to change the german text in the demo, just select "Deutsch" where you see "Default" in the backend nav (AOS Feature). This demo is not about "stunning" design, it is kept as simple as possible showing the options which are there. If you would like to change the design, there is package.json in the root folder which should install everything you need. "npm install" is your friend. ? In "/site/templates/scss/shared.scss" is the sass-code shared by front- and backend. There would a be lot more to say, but I think this is enough for the moment. It's a demo, don't use it for your customers atm. ? Have fun!
    1 point
  19. IMHO building your prototype with PW gives you a solid base from which you can go in every direction. You can build just a part in Vue and let the Vue app grow over time. There's a little bit of effort involved to tie PW's pages, fields and templates and Vue templates together smoothly without a lot of overhead, but an experienced Vue dev should be able to wire that up quickly and in a reusable way (Vue would be my choice there as well). Exposing PW pages and limited write actions through ajax isn't hard to do either. It's also a walk in the park to migrate PW content into less normalized "external" tables with a small bootstrap script if performance really requires it, so unlike other CMSes where you have all kinds of different things (posts, pages, parts, whatever) in different structures, you don't really lock yourself in with PW. I agree with @LostKobrakai insofar as that there are in fact a few areas where a custom tool will get you further, like if you need a full-blown discussion forum. The choices there are rather limited if you want a good integration. Invision (the software this forum runs on) seems to be rather straight forward in that regard. I have tried my hand on a phpBB3 integration module and while the basics mostly work, it's really a PITA in some parts (like outdated examples and misleading documentation) and I've run out of time to get it into a really usable shape. There are probably a few Laravel forum components I've never heard of that can get you most of the way as a half way option. I think that will be the hardest part to decide, where will PW (or any other CMS or own development, in fact) ever only be the second best choice compared to a single purpose tool you can integrate.
    1 point
  20. When using setUp and tearDown methods it's good to keep in mind that Tester runs tests in parallel threads. That is, if you except that a Page you create in the setUp method will be deleted in tearDown before the next test method begins, you may be wrong. For example I've created and saved a new Page with the same title in setUp and deleted it in tearDown. I randomly got a ProcessWire error saying it could not generate a unique name for the page, and that was because the other tests have been started before the page could be deleted in the tearDown method. The actual thread number can be retrieved, so appending it to the title solved the issue (or by adding a random suffix): $p->title = 'Test ' . getenv(\Tester\Environment::THREAD); Alternatively you can reduce the number of threads to 1 with the "-j 1" switch (runtime will increase a lot).
    1 point
  21. PW is MIT & MIT2: https://processwire.com/about/license/mit/ https://processwire.com/about/license/mpl/ In short: https://choosealicense.com/licenses/mit/ Distribution is granted but include license and copyright notice. You might want to state that your own work is MIT too. And of course, check what each module or any other library says about licensing. Generally speaking I think you will be ok to share it like that.
    1 point
  22. Honestly I haven't went that far yet but the closest I found are the setUp and tearDown methods (see the docs). Of course this creates holes in the autoincrement ids but I don't think that matters much. Method calls order ------------------ setUp() testOne() tearDown() setUp() testTwo() tearDown()
    1 point
  23. @tires The pull request is here https://github.com/ryancramerdesign/TextformatterVideoEmbed/pull/12
    1 point
  24. Up until now not one of the many softwares on github that I have been using even had branding attached. With pro modules the user knows exactly what to expect: buy and then use. With free modules that ask for money to remove brandings, the user could feel tricked. I'd rather prefer that for the same reason mentioned above. I happily pay for pro modules and use them a lot. I totally respect the way you see things in this matter and it is your freedom as a module developer to handle things like you do. Just wanted to share my thouights and feelings about it and explain some negative views people might have on your approach, especially since it is the first time I come across this in the PW module world. Enough said. Thank you for everything you're giving to the community and keep up the great work!
    1 point
  25. I wouldn't consider forking an open source project and amending it to one's need as bad karma at all. This is what places like github, gitlab etc. is all about. I have to agree with @Robin S For me personally, it feels wrong having obligatory powered by links in a free module in the PW universe. You see that very rarely here. It is more common on other platforms, e.g. Joomla, and this was one of the many reasons that drove me away from there. Most of my clients do not accept links like that on their website. Contacting the developer to have this removed would cost extra time, both for me and the developer. So why not make it optional in the first place? I understand that this is a way to generate backlinks which generate traffic which generates attention and ideally more jobs which in the end generate money. But, again, it does not feel right to me to use a free PW module for that purpose. I totally appreciate the time that developers spend on releasing free modules and this is the spirit that makes projects like PW stand out. To generate income from a module one can always release a paid version. Free versions shouldn't have any strings attached.
    1 point
  26. We check the stock trough an Ajax call each time the user selects an option. If it's not in stock anymore, the button "add to cart" stays not clickable. If it's in stock the user can add it to the cart. We also set an max in the quantity field, that's the same value as the stock is. Javascript clothing = { size: "", sex: "", product_id: "", init: function() { $('input[name="Size"], input[name="Sex"]').on('change', function (e) { clothing.size = $('input[name="Size"]:checked').val(); clothing.sex = $('input[name="Sex"]:checked').val(); clothing.product_id = $('#product_id').val(); if(clothing.sex && clothing.size && clothing.product_id) { clothing.getVariationId(); } }); }, getVariationId: function() { var url = '/api/?id=' + clothing.product_id + '&variation=clothing&size=' + clothing.size + '&sex=' + clothing.sex; $.ajax({ type: 'GET', url: url, success: function(result) { if(result){ var res = JSON.parse(result); if(res.success){ if(res.qty > 0){ $('#qty').prop('disabled', false); $('#qty').parent().removeClass('c-form-group-disabled'); $('#qty').attr("max", res.qty); $('#variation_id').val(res.id); $('#clothing .c-button').prop('disabled', false); $('#clothing .c-button').removeClass('c-button-disabled'); } else { $('#qty').prop('disabled', true); $('#qty').parent().addClass('c-form-group-disabled'); $('#qty').attr("max", 0); $('#qty').val(0); $('#variation_id').val(""); $('#clothing .c-button').prop('disabled', true); $('#clothing .c-button').addClass('c-button-disabled'); } } } }, error: function(jqXHR, textStatus, errorThrown){ } }) }, }; api.php <?php namespace ProcessWire; if(config()->ajax()) { $data = array( 'success' => input()->get('id') ); if(!input()->get('variation')){ return json_encode($data); } else { switch (input()->get('variation')){ case "clothing": if(!input()->get('id') || !input()->get('size') || !input()->get('sex')){ return json_encode($data); } else { $product_id = input()->get('id'); $size = input()->get('size'); $sex = input()->get('sex'); foreach (pages()->get($product_id)->product_variations as $v) { if (($v->size == $size) && ($v->sex == $sex)) { $data = array( 'success' => true, 'id' => $v->id, 'qty' => $v->product_quantity ); return json_encode($data); } } } break; case "default": return json_encode($data); break; } } Indeed we used the demo of @kongondo as a starting point.
    1 point
  27. Just working on some smaller projects and take the step into the actual master/dev version and all the new methods and api chunks that are coming with the 3.x series... since i'm not always build websites i'm not always go with the brand new things and put them in my workflow....there is a 24 per day timelimit i think...;) BUT actual i dive deep in markup regions....and holy shit this feature ROCKS! It should put in place better than in some blogposts: http://processwire.com/blog/posts/processwire-3.0.49-introduces-a-new-template-file-strategy/ http://processwire.com/blog/posts/processwire-3.0.62-and-more-on-markup-regions/ or can some admins make a headline in the official docs and link to the blogentries?? This feature is to important to get missed for beginners and other users of PW! I'm just kick my whole workflow and change it for the markup regions....i'm feeling like xmas in summer Thank you @ryan Best regards and happy "new" year....
    1 point
  28. SOLUTION below Yep. It works. Corrected code: $selector = "template=invoice"; $results = $pages->find($selector)->not("children.template=payment"); // or: $results = $pages->find("template=invoice")->not("children.template=payment"); // Doesn't work correctly (doesn't exclude pages with children.template=payment (PW 3.0.62 & 3.0.96)): $results = $pages->findMany("template=invoice")->not("children.template=payment"); It also executes 0,5-2 times faster than first working script. I've tried to use findMany method, but it doesn't work with not method.
    1 point
  29. As I said, I used the PW internal one https://gitlab.com/baumrock/RockForms/blob/master/RockForms.module.php#L68-75 Sorry, I don't understand your first post. Do you mean you setup an admin page and then you can render this page directly as form on the frontend? Interesting idea. This way one could use the processwire admin to build forms. Then on the frontend we could to $form->loadFromPwTemplate('myrequestform'); I think that would make a lot of sense since the page is needed for logging anyhow. Ajax: I guess you implemented a vanilla js solution? datepicker, autocomplete, autogrow, character counter Pff, no need for this at the moment. where/how do you define those settings? Add css classes Good point. I'm sure this will be useful. date/ip/lang Mhm, might make sense as well. Ok, so as soon as we start adding all those things it might also make sense to have a custom process module to handle the forms. And also install the necessary fields on installation. Should not be a big deal. The problem is, that I need to work on my Datatables module now (will be a perfect companion for this module for listing all form submissions). Then finish some client work and then I might find time for such additions. If anybody else thinks he can find time earlier feel free to take over. I think the module is already usable as is, I just wanted to share it early to start a discussion (which appearently worked out).
    1 point
  30. I did try deleting it anyway and it started to work again! So if nothing helps try this brutal solution))
    1 point
×
×
  • Create New...