Jump to content

artfulrobot

Members
  • Posts

    78
  • Joined

  • Last visited

  • Days Won

    2

artfulrobot last won the day on December 4 2024

artfulrobot had the most liked content!

Profile Information

  • Interests
    open source

Recent Profile Visitors

1,573 profile views

artfulrobot's Achievements

Full Member

Full Member (4/6)

83

Reputation

  1. I have a selector like this: "template=job, job_id!=1|2|3|..." The purpose is to find all job pages except for those given in the OR list. I'd expect SQL like this: SELECT pages.id,pages.templates_id FROM `pages` LEFT JOIN field_job_id ON pages_id=pages.id WHERE (pages.templates_id=123) AND field_job_id NOT IN (1,2,3,4,...); However the PW query builder seems to generate something far more complex, including adding a JOIN for every id!=1|2|3|... value - this tips over Mysql's joins limit (61 in MariaDB at least) and causes a crash. I've had to work around this by instead of using selectors, loop every job page in PHP and test it's job_id field against the set I want to exclude, which is really inefficient. Is there a way to make the selector → SQL more efficient/not crashy?
  2. @ryan I don't think it breaks the ability to type, it's just you'd have to type the emoji/unicode character, then a space, then what you're searching for - which is something that very few people would be able to do. Thanks for taking on board the optgroups ... option! Interesting re iOS/Safari not noticing DOM changes in <select> elements! Happy 2025 🙂
  3. Hi @benbyf I just wanted to say hello because it's nice to come across a UK person (I'm in Oxford) working with ProcessWire, which I have started using in the last 2 years. Also nice to make a link with you from the Machine Ethics podcast which I've listened to.

    I'm also ethics focussed; I only work for orgs that I think increase hope, work for environmental/social justice etc. As part of that I spend a lot of my time being a pain to my clients by trying to encourage ethical web design (e.g. accessibility, avoiding dark patterns, open source (free) software and sustainability, avoiding dependency/funding problematic companies/people/systems, challenging AI use...etc.)

    I like your "written by human" badges on your site - I'm actually working with someone on that concept: badges/info to declare where content is partially or completely AI generated, or AI-free.

    It would be great to have a chat some day! But I just wanted to wave across to you. Happy 2025!

    rich (they/them)

    web: https://artfulrobot.uk
    email: hello at artfulrobot.uk
    social (fediverse): https://fosstodon.org/@artfulrobot

    1. benbyf

      benbyf

      Hi Rich!

      Nice to hear from you and your general interests we share, keep up the good fight! 🙂

      Please tell your friends about the podcast 😉 let me know if you ever want to knock heads on ethical or good design stuff. Currently trying to do less web and more AI ethics and Games stuff but still love Processwire and have a few clients I tick over on PW sites. I make all my own sites using PW too... though in my heart I would love to move to something in Python as PHP is a pain in the arse 😕 

      Anyways, let me know if you're ever in Bristol.

      Ben

  4. @benbyfAppreciate this, thank you! When I have to look at the logs page, my brain is usually in a panic, so this helps surface the thing I want without further thinking about "and now click to sort", or worse, trying to mentally scan and parse the textual description column like x hours/minutes ago!
  5. Wow, well that's a Christmas present! So glad this is coming (slowly), Thanks forfor sharing it!
  6. This looks really useful, by the way! Accessibility: I was going to submit this as an issue but perhaps you'd prefer discussion here as a precursor? Browser-native selects have a cool feature: you can type the label to find an item. If you're able to use a mouse like I am then this is just an efficiency, but if you can only use keyboard navigation then this is really very valuable to usability (on a long list) and to efficiency (on a short list). e.g. consider a list of countries. ("Where have you been on holiday?"). having to scroll and click is going to be awkward and slow; being able to type Uni and jump to United Arab Emirates (and below it United Kingdom) makes it a breeze. This important accessibility function gets broken by the way the icons representing selected/not are inserted as text before the labels. Sadly, CSS cannot rescue this - if CSS were supported better for <selects> then we could do various things to improve UX for visual users without it being at the expense of less able users. What about instead of using visual characters for selected/not, using <optgroup label="Selected"> and <optgroup label="Unselected"> and grouping the selected items first?
  7. @zoeck Being physically able to do something is not the same as legally/ethically being able to do something. I haven't found the license that pro modules are provided under, but Ryan makes it clear they are not open source, so your rights are unknown. Common sense says that I'm quite sure he doesn't mind anyone making changes to their local copy but that I'm quite sure he would mind if someone started sharing the code/modified versions of it, or even selling it! My interest in open source code is primarily sustainability - code that is openly shared/forked, has good leadership as part of an active team of developers, welcomes contributions. A closed product only exists as long as it is in the interests of its owner. If Ryan, God forbid, were to have a change of fortunes/interests, and shut shop, the open source code could be picked up by an interested community of developers and all our websites and services based on PW stand a chance of a future. The closed source products could not - legally - be continued. My biggest reservation in using ProcessWire is the business risks posed by its BDFL model / single point of failure in general and moreso with the pro modules. My interest in this forum post, however, was just how to give Ryan a modest donation to help fund his excellent continued work! I'll try reaching out directly/via contact-form on website as @Krlos suggested.
  8. I really appreciate ProcessWire as an open source CMF/CMS. I have used it for 3 websites now. I understand that the Pro modules are a way to support the project, however I do not want to use any proprietary code because it feels like a backwards step; I like being able to use, bend, fix, study, share the software I use, and I actively contribute to dozens of such projects. Is there a way I can make a donation to the work of the project without buying a Pro module?
  9. Thanks for taking the time to write this up and share, interesting read! I've been using some htmx on a processwire site recently, too, but you've gone much deeper into HTML integration than I did. To be honest I'm still not won over by htmx's "pretty much everything requires a server request" norm as it seems like excessive load and traffic in many use cases. And I did struggle a bit with multi-stage forms where pages may be used in different orders (I basically implemented a state machine flow). I'd be interested to see more of your implementation for interest/learning 🙂 as I'm into the idea of minimal no-build-step JS libs these days. It's also nice to revisit the idea that a site works without javascript, though I can't say I'm achieving this yet. So if you do have public access to view your code, please do drop a link here.
  10. Hi Felix,

    FYI I'm thinking of reworking

    https://github.com/felixwahner/TextformatterOEmbed?tab=readme-ov-file

    around Embera instead of Essence (which seems not to be being updated, and isn't php8-ready). I also have some ideas for overrides, e.g. I don't think X(itter) should be allowed a <script> outside of an IFRAME.

    Would you be interested in me doing this with a view to a PR back to your project? I'm fine either way - happy to start a new project/module, or happy to try to build on yours. If it is to be merged back into yours it will be a big rewrite of a small module!

    I wasn't clear re author, copyright and license. e.g. the code comment says Ryan Cramer and GPL2, but the readme says you and MIT. Did Ryan ever write any of this code? I think Glenn McLelland contributed too according to the commit log.

    If you are not interested in maintaining this any more, I'll probably start a new project, since some of the essence configuration options might not apply, etc. But if you are, and would welcome a PR then I'll try to do it that way with a view to contributing back to the community.

    Hope to hear from you.

    Rich

     

  11. @BitPoet Wow thank you, that worked! I note that: you used ready not init. This makes sense; ready fires after all the installed modules have initialised, and we need ProcessWire to know that the InputfieldSelector module exists before adding a hook, presumably. (Note that your code worked for me using init() instead which I tested to see. I guess this is at risk of a race condition though; if my module loaded before InputfieldSelector did, it might not work). You hooked InputfieldSelector not the parent Inputfield yours worked, mine didn't, so I guess we're not allowed to hook on parent classes? This is a great example of how flexible ProcessWire is. And how much I've yet to learn! Very grateful for your time responding to this and sorry I didn't see it sooner (note to self: check my notification settings!).
  12. I have a selector field and I need it to be able to select User templates, but User is hidden because it's a system template. I thought I could make this change with a hook, but I have not been successful. To try, I made a new module (single, auto load) and in its init() method I added code like this: class MyCustomModule extends Process implements Module { ... public function init() { $this->wire->addHookBefore('Inputfield::getConfigInputfields', function (HookEvent $event) { $this->wire->log('getConfigInputfields Fired', ['name' => 'testHooks']); }); $this->wire->addHookBefore('InputfieldSelector::init', function (HookEvent $event) { $this->wire->log('InputfieldSelector::init', ['name' => 'testHooks']); }); } ... } I thought that if I hooked into when an InputfieldSelector got instantiated, I could check whether it was the field I wanted to target and if so, make the setting change. But none of these hooks fired when I edited the page. Currently, I have achieved this through changing InputfieldSelector.module's __construct() method, but I wanted to do it with a hook so it has more of a chance of not getting removed on upgrade! Any help appreciated ?
  13. Nb. the same works for Roles. e.g. I added a text field to the Role template, called it "purpose" and then added that to the Roles admin list so it's clearer what role does what. Thanks for the tips.
  14. One question I have is: is output formatting on or off in this situation? $pwUser = $this->wire->pages->newPage([ 'template' => 'someTemplate', 'name' => 'someName', 'someField' => 'someValue', ]); A reflection about setting a value when output formatting is ON: The blog says that when it's ON, the formatters will run to check it can be formatted and it will set it to status:corrupted if they can't run. This sounds like good validation to me, which makes me think it might be better advice to do $page->of(true) before setting values, unless you're in a situation where you can really trust your raw data to be valid. Caveat: I note that the example edits are self referential ($page->someField = $page->someField + 'altered') in which case it's clear that output formatting ON is going to cause problems.
  15. The problem goes deeper. As well as the hooks above (published/unpublished) i needed to add one on Pages::saved(1:published) because my paths are based on the published date. I believe there's a bug in core that prevents us being able to implement path() in a page class successfully: https://github.com/processwire/processwire-issues/issues/1906
×
×
  • Create New...