Jump to content

teppo

PW-Moderators
  • Posts

    3,127
  • Joined

  • Last visited

  • Days Won

    102

Everything posted by teppo

  1. https://processwire.com/modules/lister-native-date-format/ is great for formatting lister dates, by the way. You can configure preferred default format for native date fields and switch format on the fly πŸ™‚
  2. @adrian, I've got one more request (kind of). Earlier you added composer.json, but didn't yet push the project to packagist.org. Would be nice if you could add the module there as well, otherwise it can only be installed by adding the GitHub repository directly. Thanks in advance! πŸ™‚
  3. Brilliant, thank you Adrian!
  4. Not really. I've had some issues in the past, mostly related to disk cache getting out of sync or somehow the module compilation itself messing up the code (but such cases have been super rare). Mostly it just feels unnecessary and a bit "off" to have a separate copy of the code and then have the system abstract that layer away. If I could, I would likely disable module compilation entirely from my/our projects (just like template compilation), but there are indeed still some modules that depend on it, so for now it's a no-go πŸ™‚
  5. One more thing: I'm wondering if there's some use case where current way of getting properties via eval is necessary? I don't see anything technically wrong with that, but would feel better not using eval at all, and it tends to get flagged by security audits etc. This seems to achieve largely similar results, at least in latest PW version: $replacement = $p->get(implode('.', $properties)); Again my use case for this module is very limited for now, so may be missing something important.
  6. Hey @adrian! Might be a strange use case (considering that it doesn't seem to be supported yet), but I'd like to use this module for a field that's locked (non-editable). Looks like hooking into Inputfield::render won't work in this case, while Inputfield::renderReadyHook does work. To be honest I'm not sure what else that might change/break πŸ™‚ I've made that change locally since this is indeed something I need, and so far it seems to work (though not much testing done yet). Also... have you considered updating the module to PW3? I mean adding the namespace, mainly, so that module compile wouldn't be needed. And it would be great to have this module installable via Composer. Food for thought πŸ™πŸ˜„
  7. As someone who does a lot of local development, sometimes with no Internet access or extremely slow one (e.g. while travelling), this would not be preferable. Having everything available locally guarantees that things work as expected. Also it guarantees that the version I have can't be compromised by malicious actors. Assuming, of course, that it was safe in the first place πŸ™‚ Personally I don't have an issue with Ace, but if Monaco (or something else) does similar things with less overhead then why not πŸ‘Œ
  8. So, I'm currently having a conversation with ChatGPT about a new module πŸ™‚ Feels weird to be honest: it's quick to answer, especially at first seemed absolutely certain that every answer was the correct one, and kept making obvious mistakes. But that being said: I could've taken the initial code, made a few changes here and there, and it would've been a functional module. Now, after some iterations, it's looking almost perfect. One problem I'm having is that the bot keeps stopping halfway through the answer. When I tried to confront if it about that, this is how it responded: Not sure we're quite on the same page here πŸ€” Anyway, it looks like I might be able to take the code provided by the bot, polish it a bit, and put it in use. Sure it required us a dozen tries or so to get here, I had to patiently keep pointing out mistakes and suggest actual hookable methods instead of the non-existing ones that it pulled out of thin air, but that is very impressive nevertheless. I can definitely see how this would be useful for something a little simpler πŸ™‚
  9. If the error message is pointing to the correct line, then this does not look like a PHP 8 issue. That line should be valid in PHP 7.4 or any later version. I would double check that you're running the code on correct PHP version, and also that this is an actual error you get while running the code (not just in your code editor, where the check may potentially be performed by locally installed PHP or something along those lines). There may, of course, be other PHP 8 incompatibilities in the library πŸ™‚
  10. Been over a year since last update, so another quick heads-up: MarkupMenu 0.11.0 adds support for menu items as an array (as an alternative for the module figuring the menu structure out from current and root page, or reading it from a PageArray) and template strings as callables. Needed these two for a project I'm working on πŸ™‚ echo $modules->get('MarkupMenu')->render([ 'current_page' => $page, 'menu_items' => [ [ 'title' => 'Home', 'url' => '/', 'id' => 1, ], [ 'title' => 'About', 'url' => '/about/', 'id' => 29, ], [ 'title' => 'Parent', 'children' => [ // ... ], ], ], 'templates' => [ 'item' => function($item) { return empty($item->url) ? '<span>{item.title}</span>' : '<a href="{item.url}" class="{classes} {class}--level-{level}">{item.title}</a>'; }, ], ]);
  11. No, but looks interesting πŸ™‚
  12. Hey @Sten, Sounds like your field (moment) may be configured to output a date that strtotime doesn't understand. You could test by seeing what "echo $event->moment" returns; is it "2023-04-03 18:30:00" or something else? Anyway, one way to resolve this would be to replace "$moment=strtotime($event->moment)" with $event->getUnformatted('moment'). This will return a timestamp, so strtotime is no longer required.
  13. Short answer is "no", at least not for now πŸ™‚ SE populates a search index for a piece of content (page) and compares provided query string against said index. It's a tool for handling "regular" site search, from indexing to front-end rendering. The index is a textarea field, so complex queries (advanced text search) and a few special cases ("link:https://www.processwire.com") are supported, but the module has little to do with facets/filters. On a loosely related note, in recent projects I've been leaning towards implementing filters/facets on the front-end based on static data generated by the backend and cached on disk. The main reasons are performance and scalability: real-time search using ProcessWire can be pretty quick, but won't achieve the speed of a front-end only implementation. This is especially tempting approach when the amount of data is relatively small (i.e. you don't have to deal with tens of thousands of pages (or more) with numerous searchable properties each.) Which approach makes most sense β€” and how vigorously the search should / needs to be optimized β€” depends on the case at hand πŸ™‚
  14. Hey @Mats, In this case you're setting view directly on the View object, so you should read it from there as well: // in controller $this->view->setView('buy'); // in view file echo $this->getView();
  15. Both parts of the site look really nice! Tiny display issue with "do you recommend this tour":
  16. Hey @Spiria β€” just a heads-up that I have merged your post to the Menu Builder support thread. Official support thread is the best way to reach module author. Looking back to the report in 2021, it looks like that earlier report might've just gone unnoticed.
  17. Looks like MarkupHTMLPurifier used to skip tel: links in the past due to HTML Purifier not supporting them. This bypass was removed in 3.0.137, so after that version tel: links have likely had to adhere to stricter rules. I would likely go with this option, to be honest. But perhaps someone else knows how to customize Purifier β€” I've tried it once or twice, but eventually had to give up πŸ™‚
  18. I don't think there's any obvious way around this: PHP considers namespace declarations and use statements (aliasing/importing) on a per file basis. (Technically this could be achieved by some sort of file complication scheme, but in my opinion issues with that approach would easily outweight potential benefits.) It's a matter of preference of course, but I often use full namespace (e.g. \Wireframe\Lib\Utils::some_method()) in my views. Just feels more intuitive to me, even if it does add a bit of verbosity πŸ™‚
  19. See the first bullet point under "Docker desktop may be used for free as part of a Docker Personal subscription for": This is repeated in other documents, including the service agreement. You don't have to (and can't, that would be quite impossible) fill all the conditions for free use, just one, and use within "small companies" (or "small businesses") is one of them.
  20. Docker FAQ seems to disagree: This is further clarified in the Docker Subscription Service Agreement: The Service Agreement is a bit messy (kind of seems like they might've updated one section and forgot another, so numerals are not in sync), but at least based on this the small business exception is still in place and applies to the desktop component as well πŸ™‚
  21. Was a bit slow to answer, so @gornycreative pretty much covered this already, but just to be clear: in my experience most of them are still valid. Potential exceptions may, for an example, include modules that for some reason rely heavily on a certain admin theme. Overall there have been very few breaking changes in the core through the years, so most β€” probably close to all β€” modules that worked for 3.0 (or even 2.x versions) still work today, some may just look a bit off. Or there may be a core feature nowadays that solves a similar need without a need for third party module πŸ™‚ One thing worth keeping in mind is thatolder modules typically don't have/use the ProcessWire namespace, which means that you'll have to keep FileCompiler enabled for modules. This is the case by default, so not a problem unless you've intentionally disabled $config->moduleCompile via site/config.php. I must admit that this confused me a bit. If you're just looking to see which field is attached to which page, that doesn't sound like a reason to switch entire admin theme. Admin themes are generally more about the look and feel of the admin, not so much about the features included, while this sounds like a rather specific feature. I can't remember if I've seen exactly this type of list myself; fields are connected to templates, so usually you'd want to see which templates a field belongs to or which pages use a specific template, rather than which pages use a specific field πŸ™‚ If you're interested which fields have a value in specific field, then that's a different story. You can use the built-in pages find feature to list pages where that field is not empty: Also, as a general rule of thumb β€” and this is definitely more than a bit opinionated β€” I wouldn't recommend installing new admin themes unless you know what you're doing. While admin themes can be changed, and third party admin themes may work perfectly fine, generally speaking admin features are most likely to work best with the default (Uikit) admin theme. Then again, "at your own risk" is often just something developers say when they put stuff out there. It doesn't necessarily mean that something is broken β€” just that there's no guarantee that it will, and also no warranty in case it doesn't work πŸ™‚ Don't worry, asking questions is A-OK πŸ™‚
  22. Hey @fruid, just noticed this post in the modules forum. It would be best to post ProMailer specific questions to the ProMailer (VIP) support area of the forum β€” this way Ryan will notice them. I've never used a subscription form from ProMailer myself so can't really answer right away, but it looks like form markup is defined (and can be customized) via promailer-subscribe.php. You can find instructions for modifying ProMailer templates from https://processwire.com/store/pro-mailer/manual/#about-the-promailer-subscribe-page-template-file (specifically take a closer look at the part starting with "If you have any custom fields you also want to use, please do the following" under "Modifying the β€œSubscribe” form"). Custom fields are explained at https://processwire.com/store/pro-mailer/manual/#custom-fields-reference. -- The modules area of the forum is intended for module-specific support threads (one thread per module) so I'm moving this thread to "General Support".
  23. Hey @bernhard, I'm considering RockMigrations for a new project, but would very much prefer to install it via Composer to avoid bundling module code with project code, make updates easier, etc. I noticed that your old RockMigrations project had a composer.json in place, so would you mind adding that here as well, and preferably also submitting the package to packagist.org? Thanks in advance! πŸ™‚ Note that I would recommend using the options outlined here: ... instead of hari/pw-module. The installer plugin from Hari was updated a while ago to support Composer 2, but it still lacks support for custom modules directory, for an example. In my opinion it would be best to eventually migrate modules to use composer/installers, since that's the "official" solution.
  24. This is the expected behaviour, with one catch: users with edit access to said pages should be able to view them. This always includes superusers. If you are certain that the sites themselves are identical (code and site settings, template settings, permissions, etc.) there are a couple of things to check first: - Is there some sort of caching on the live site that isn't present on the working environment? - Is the admin domain the same as the one used after clicking "view" links on the live site?
  25. Not a Drupal developer (unless a small course on D6 years ago counts...) so this is the best I can do. You've got this πŸ™‚ Honestly, my two cents would be to try to embrace Drupal properly before making decisions about whether you like it. In my experience every major platform has ins and outs, some of which may take a while to grasp. I'm sure there's a lot of good in Drupal as well; for an example it sounds like they have solid integrations with many development-oriented tools, from Symfony components to Composer, PHPUnit and Nightwatch for testing, etc. Silver lining: sounds like an interesting learning opportunity! As for pushing ProcessWire, that may indeed be hard, especially if they have a good flow with Drupal. In terms of sales Drupal likely has an edge as well: a lot of folks have the impressions that Drupal is the go-to system for "enterprise open-source" content management, which is can make it easier to sell to certain types of clients. Perhaps suggest doing some smaller or in-house projects with PW, and see where it goes? Pushing anything too hard, especially to other developers, has a tendency to backfire πŸ˜‰
Γ—
Γ—
  • Create New...