Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/20/2020 in all areas

  1. Hello @gebeer, yes, I still maintain it, but had little time in the past. The last version was for PW stable 3.0.128. Right now PW stable is at version 3.0.148. I try to have a look at it in the next days and update it, if applicable.
    4 points
  2. @Pete From this side, my wife's job is one that requires her to be on phone/video meetings most of the day, so she's got to lock herself away from us to focus on that, and the kids are mostly with me during the day. I'm good at focused attention, but not great at changing gears, so I'm still learning. My days used to be just coffee and code. Now things are much more diverse, here's a typical day: wakeup, breakfast, coffee, code, kids wakeup, resolve dispute, make breakfast, coffee, code, hear that TV is on, check in to make sure kids are doing school work, turn off TV, say “get back to school work”, try to figure out something with google classroom, worry about whether I'm doing enough to keep kids focused on school, code, get icloud request to approve download of some game on iPad, tell kids to “get back to work”, explain why several times, answer questions about school work, hear music from some game and decide to let it slide, 1 email, cycle power on router because wife says she can't connect to important video call, code, resolve kids dispute, put 1 kid in timeout, legos, clean up spill, 1 email, slack message, cook lunch, coffee, code, worry about whether kids are spending too much time on screens, phone call, reset wifi because daughter says Roblox won't connect, then work a little more, click the "snooze" button on a dozen emails so they return tomorrow, take kids outside to play while I work on house or yard, ride bikes, cook dinner, eat, netflix, cleanup dinner, go to bed, feel thankful to be healthy, sleep well. I'm definitely still adapting here, but I can't complain about the new normal because having everyone under one roof is comforting, especially at times like this. And while it's harder to get work done, it's mostly still getting done and I just feel thankful to be staying busy. Also, knowing there's nowhere to go but home, life is simpler in many ways.
    4 points
  3. I can only thank @bernhard again for this module and for the support he provided, for example in finding a solution for option fields. RockFinder2 can not only be used to load masses of pages faster, it can also be used at field level. For example, I used it to load about 40 to 60 fields per repeater matrix type, which are also further nested in FieldsetPages (for design settings) in one query. This amount of fields caused 700 or more single SQL queries to be executed and up to 140 PW-Page objects to be loaded into RAM. This caused a significant loading delay. By using RockFinder2 the SQL queries could be reduced to 200 on average. About 60 page objects less are loaded in RAM, the CPU is also happy and the loading time for pages without cache was also reduced on average to 700 ms to 1 second. Good job Bernhard! ?
    3 points
  4. Here’s a brief update on what’s new in the core since last week. Next week I’m going to compile a more complete overview of everything that’s in 3.0.154 (and more) and put it in a blog post. I wanted to do that today, but my kids have needed a lot of help with various things today (and this whole week actually) with all of this online school stuff and I’ve run out of time. We're a few weeks in and school is cancelled for the rest of the year due to the coronavirus (likely the same around the world). I'm still learning how to adapt to kids around all day and needing attention, but overall it's nice to have the family around more even if it is sometimes hard to get work done. So I’ll keep this sort of brief, and get into more details next week. Several updates were made to the core/LanguageFunctions.php (language functions) file, with biggest being the option to programmatically replace translation text (whether multi-language support is installed or not), useful for very easily updating core/module output to say exactly what you want, and without needing to install multi-language modules. No longer do you need to use various hooks to change text in one module or another. Also moved the __('text') configuration options to dedicated functions which makes it more clear to use, as well as much better for documentation purposes: wireLangEntityEncode(), wireLangTranslations(), wireLangReplacements(). You'll see these new functions in our docs by next week. More details and examples of these in action in next week’s blog post. The CKEditor version has been upgraded from 4.12.1 to 4.14.0. To see what’s changed, see the release notes for CKEditor 4.13.0, 4.13.1 and 4.14.0 here. There’s actually quite a lot here in terms of additions and fixes. Note especially the two security related fixes in 4.14.0 (though I think only the first may be applicable to us). While it looks like a rather unlikely combination of factors needs to come together, and with just the right person, it’s good to be aware of nevertheless. Of note is that these particular cases are entirely client side, before PW ever gets to see or filter the content, so this is something that only a CKEditor upgrade can fix. Updated the core Debug class to use PHP 7.3’s recommended hrtime (high resolution time) for debug timers, rather than microtome. This is only available in PHP 7.3 and newer. As far as I can tell it produces identical results to microtome (as far is our timers go) but the PHP documentation page indicates hrtime is what we should now be using, so that’s what we’re going with. I also did a little refactoring and minor improvements in the Debug class as well. Updated ProcessWire’s Inputfield rendering system so that you can customize markup by matching a field by name, and without hooks. This essentially takes part the Inputfield customization system developed for LoginRegisterPro and brings it into the core. This opens up a lot more customizability for those that want it. Various resolutions of GitHub issue reports, with more on the way. The above are just updates from the last week, but there’s plenty more in 3.0.154 as well. See ProcessWire Weekly #309 for details on Image and file field updates, new $database->columnExists() method and new Selectors::getOperators() method, and more. There are also the new expanded file and image properties, as discussed in #308 and the last blog post. Thanks for reading and I hope you all have a great weekend!
    2 points
  5. Hey @ryan just posted a fix for an error that makes the new Image Fieldtype unusable with german locale setting due to an SQL error after image upload: https://github.com/processwire/processwire-issues/issues/1155
    2 points
  6. $item['ratio'] = number_format($pagefile->ratio, 2, '.', ''); This works! ? I guess waking up from the DB should not be an issue because it will always get a decimal dot from the DB... I'll file an issue on github, thx for your help @adrian and @kongondo, VARCHAR was the key ?
    2 points
  7. @gebeer @bernhard Here you go ? https://github.com/jmartsch/pw-lang-de/releases/tag/3.0.148
    2 points
  8. This should have been already implemented with the option to set a custom storage path. Unfortunately I recognized a bug while looking in this. This bug is fixed now and I made some additional changements. Please update to v1.2.3. The automated cleanup effects only the custom path and not site/assets/backups/database/ used by ProcessDatabaseBackups. Currently you cannot use ProcessDatabaseBackups to edit backups stored under a custom path. I added functionality to protect files by 'stopword'. Files having this in its names or descriptions will be protected from beeing deleted by the cronjob. Just set the 'stopword' in the module config. @bernhard @horst @Robin S I hope the fix helps and feeds your needs (?)
    2 points
  9. Device.js is 6 years old, which for a topic like media queries is ages ago. Generally I feel like if you really need to alter markup, and not just styles, for different devices use client side templating. Those cases should imo be a small minority, so it should concern the least amount/local to the problem code of your codebase possible. Having different domains is however like a sledgehammer everything on the server suddenly knows about. Generally media queries based on device size / touch capabilities won‘t give you a great picture anyways with today's devices. Take microsofts surface or ipad pros, which have resolutions bigger than some older laptops, touch and mouse support as well as alternatives like the apple pencil. There are more useful media queries in the pipeline about hover capabilities or coarseness of the pointer - finger vs. pencil. I wouldn‘t want to involve this complexity on the server side.
    2 points
  10. Here's a small new module that started as a spinoff of a memcache proof-of-concept. Cache your strings and partials in-memory using Redis as a backend. CacheRedis All you need is a running Redis database. The module supports connection through regular TCP, over TLS and via unix domain sockets. Host and port are configurable, and authentication is supported too. Here's a screenshot of the module configuration options: I'll not go into too many details about the usage, you can see everything explained in the README on GitHub, and just highlight the most important points. When the module is active, you'll have a wired $redis variable, which means you can reach the module as $redis, wire("redis") or within Wire classes / modules as $this->redis. CacheRedis is strongly influenced by WireCache, and its usage is (hopefully) straight forward. // Store an entry in the cache under the given key name with the given value: $redis->store("cached_value_number_one", $expire, $value); // Retrieve a value from the cache $value = $redis->fetch($key); // Delete a cache entry $redis->delete("my_other_cached_value"); // Clear the whole cache $redis->flush(); // Retrieve a value from the cache, and if not found, create it through the given function // and store it with a lifetime of 5 minutes (300 seconds) $value = $redis->fetch($key, 300, function() use($page) { return "Page last changed on " . strftime('%m/%d/%Y %H:%M', $page->modified | $page->created); }); // Render a file using wireRenderFile and store it in the cache. // We'll pass a selector as the expiry value so this cache gets // emptied every time a page matching the selector is saved. $news = $redis->renderFile("partials/news.php", 'template=blog-post', ["page" => $page]); The module is still very crude work in progress, but I hope some of you feel daring, try it out and let me know in case anything breaks. Have fun!
    1 point
  11. True. It should be the work of the Fieldtype to make sure it is saving correctly formatted values to the DB. So, I would file a bug report
    1 point
  12. Yeah, I don' think MySQL's DECIMAL supports using a comma as the decimal separator. I believe PW needs to handle conversion from comma to period and back again on wakeup if the locale settings require it.
    1 point
  13. Or perhaps a varchar just to make sure it's not trying to save something that isn't supported by the DECIMAL type at all.
    1 point
  14. Strange indeed. I'll try and replicate. I have Maria DB 10.4.10 in local setup (windows).
    1 point
  15. I have successfully tested at Webfaction hosting, everything is working perfect. PHP Version 7.4.5 Processwire: 3.0.148 CroppableImage: 2.0.0-RC02 (beta) I just noticed a bit of slowness when generating the thumbnail before making the crop. The image was 5.1 mb
    1 point
  16. Currently it doesn't support it. It's probably a pretty easy hack to make it support your scenario, but also ask Ryan about it in the support board for that module so he knows that users want that functionality.
    1 point
  17. @kixe what do you think of this scenario: CronjobDatabaseBackup writes a Identifier Comment Word into all its files, and if that identifier is missing, just ignore it in all routines.? So, stopword also sounds good, but needs manual action everytime. The other way round, if I create manual dumps and want to delegate them to CDBs cleaning routine, I can include the identifier word. This has less harm when forgot or mistake on including a word.
    1 point
  18. Hi, Making a website responsive with the use of css is only one way. What do you guys think about using device.js for showing different website layouts on different devices ? Device.js is a media query-based device detection without needing special server-side configuration, saving the time and effort required to do user agent string parsing. Device.js will read all of the version links in your markup, and redirects to the appropriate URL that serves the correct version of your website for desktop, laptop, tablet and phone. Info: https://github.com/borismus/device.js/blob/master/README.md Here is how your HTML will look like: <head> <!-- Every version of your website should include a list of all versions. --> <link rel="alternate" href="http://foo.com" id="desktop" media="only screen and (touch-enabled: 0)"> <link rel="alternate" href="http://m.foo.com" id="phone" media="only screen and (max-device-width: 640px)"> <link rel="alternate" href="http://tablet.foo.com" id="tablet" media="only screen and (min-device-width: 641px)"> <!-- Viewport is very important, since it affects results of media query matching. --> <meta name="viewport" content="width=device-width"> <!-- Place the JS in the head to load as little of the page as possible before (potentially) redirecting. --> <script src="device.js"></script> </head> To see examples, on the top right click on the little arrow to select for different devices and see how it works: http://borismus.github.io/device.js/sample/desktop.html?force=1
    1 point
  19. @Tyssen I've run into that error a couple of times, I think it's specific to the Selectable Option field. I think it's related to how Twig tries different ways to get a property value from an object. ProcessWire uses magic __get methods all over the place, which are checked quite late by Twig. So Twig first tries to call hasValue on the object, which exists but requires additional arguments, so it breaks ... A workaround is using more explicit properties, either of those should work: {{ matrixBlock.fieldName.getValue }} {{ matrixBlock.fieldName.first.value }}
    1 point
  20. Have you considered using the custom user template and parent feature? That way you wouldn’t need to link the profile page to a user. You could just put user pages in the appropriate place in the page tree ans use those as profiles.
    1 point
  21. I have a repeater matrix field on a page and one of the matrix types has an options fieldtype. If I do {{ matrixBlock.fieldName }} I get the numeric value of the selected option. But if I do {{ matrixBlock.fieldName.value }} (or title) I get: Any ideas?
    1 point
  22. FYI, the core has built-in support for relative time strings: https://processwire.com/api/ref/wire-date-time/relative-time-str/
    1 point
  23. Thanks, Bernard. Much appreciation for your work and presence here, and thanks for the lead. All the best! Jay
    1 point
  24. This is the way ... now Shopify .. then Processwire + Padloper 2 (when released)
    1 point
  25. Everyone, please be aware of this bug in AdminOnSteroids (https://github.com/rolandtoth/AdminOnSteroids/issues/118) that breaks CkEditor fields with this new PW version. You can easily patch AOS to fix it, but be sure to test before you let your site editors find the problem ?
    1 point
  26. Good to hear ? There's actually another new version just posted which improves ACE mode detection and whether the current code matches the saved version after a page reload.
    1 point
  27. +1 I have automatic backups every hour during development and do manual backups when reaching milestones and they get deleted from time to time so I need to manually restore them. In my case it would be enough to exclude special filenames from deleting.
    1 point
  28. @kixe, I feel that the settings "Maximum number of backups" and "Remove backups older than" should only apply to backups created by CronjobDatabaseBackup. If the user has made manual backups, or backups have been made by a different module, then CronjobDatabaseBackup should never delete those backups. What do you think?
    1 point
  29. Yes, you enter database information when you restore the backup (try it).
    1 point
  30. I plan to use this module as duplicater. How is it handling database name? I want to create a template PW site and clone it for new projects. So i need to change the database name for every new clone. It should not overwrite former clones databases on the same server. Can achive this with this module?
    1 point
  31. It does not work for me, so I will just take a manual backup of the files. Thanks for the help ?
    1 point
  32. @eydun - two things. 1) Did you check the "Native" option in the module settings? I am sure you did, but just checking ? 2) Try the attached file in the Classes directory. I had to modify it to get it working at my end. BackupDatabase.php
    1 point
  33. I have tried with the dev-version, but it also timed out. I guess the host is to low-end.
    1 point
  34. @eydun - please try the dev branch - https://github.com/flydev-fr/Duplicator/tree/dev - it uses native backups and solved the timeout issues I was having.
    1 point
  35. Thank you for a fantastic module. Would it be possible to exclude the database from the backup? I ask because it get a timeout when running the backup, and I can move the database (which is quite large) by other means.
    1 point
  36. If you could have a quick look at those database details before I carry out the update, that would be great! Thanks a lot for your offer. Maybe it spreads some light on what's going on behind the scenes, on such server/setup. I'll send you a PM then (it'll be 2..3 weeks from now)...
    1 point
  37. Sorry, forgot to mention that @David Karich added support for options fields and slide ranges, so there is no need for manually doing joins like shown before ? How to create custom column types It is really easy to create custom column types that can retrieve any data from the PW database. See this commit for two simple examples: https://github.com/BernhardBaumrock/RockFinder2/commit/54476a24c78ae4d3b6d00f8adfb2c8cd9d764b9d If the fieldtype is of broader interest please consider making a PR. If you are the only one needing it add the type via hook. Adding a custom column type is as simple as this: $f->addColumns(['FieldOptionsValue:your_options_fieldname']);
    1 point
  38. Hi Nancy Reagan fan, There are a number of different ways you could do this, but if you want the class added to all images inserted via CKEditor then the simplest is to do it client-side with jQuery. 1. In your template file(s), wrap the output of your CKEditor field(s) with a div so you can identify them: echo "<div class='cke-content'>$page->body</div>"; 2. In a Javascript file: $(function() { $('.cke-content img').addClass('img-responsive'); }); But consider if you really need to add this class or not. If you wrap your CKEditor content as in step 1 then you can target the images in your CSS/JS with ".cke-content img" without needing to add a class to the images themselves.
    1 point
  39. This looks awesome. Been playing with the demo for a while and, though I clearly don't yet understand much of what it's capable of, so far I'm very impressed. Seems like a very good example of building (relatively) large-scale application on top of ProcessWire You were wondering if this would make sense as a module. What I've seen so far makes me think that it probably wouldn't make that much sense. You could move individual features, functions etc. to modules in order to separate some of the business logic and perhaps even parts of markup generation from actual views (template files), but your current structure seems to fit this project pretty well too, so it's entirely up to you. Of course this sort of separation could be achieved simply by moving functions to include files, so a module isn't needed for that either. One quirk in the demo map is that whatever I type in the search field (left toolbar), "Fehler: Zeitüberschreitung der Anfrage in functions.js" is displayed. Perhaps something isn't working quite right there? Sorry, "a bit" off-topic, but this depends on which meaning of "steep learning curve" is used. I'll never be able to wrap my head around steep learning curve meaning that something is difficult to learn -- that's just plain wrong. Learning vs. time make so much more sense
    1 point
×
×
  • Create New...