Recently Updated Topics
Showing topics posted in for the last 7 days.
- Today
-
After taking a look at the code, I guess the best approach would be to go with a custom validation rule, because there is so much going on inside the isValid() function that must be checked in the setErrorMessageToField() method too. Can you explain which kind of validation you need in this case. Maybe I can help you to create the custom rule. You can also send me a PM with the code you have so far.
-
I never use AI to generate code, my case was more about understanding an issue and how the framework works. The kind of issue that is hard to find a solution with a Google search. The fun fact is that this issue never existed, that was a misinterpretation by myself, but all chatbot (ChatGPT, Claude and the framework dedicated chatbot) said this was a "very common issue", and gave me very bad solutions, all bullshit. 😂
-
InviteAccess — restrict staging site access with invite codes
howdytom replied to maximus's topic in Modules/Plugins
Thank you. It is a great module and works perfectly. Sometimes it would be cool to password protect individual pages instead of locking the complete sites. It just the opposite use case. -
Hey everyone, on a recent client project we had to deal with a large number of Markdown files that needed to end up as regular HTML content on ProcessWire pages. Converting them manually or piping them through external tools wasn't an option – too many files, too tedious, and the content had to be stored as actual HTML in rich textfields, not just formatted at runtime. So we built a small module that handles this directly inside ProcessWire. How it works The module creates a file upload field (md_import_files) and a Repeater field (md_import_items) with a standard title field and a richtext body field (md_import_body) inside. The body field automatically uses TinyMCE if installed, otherwise CKEditor. You add both fields (md_import_files,md_import_items) to any template, upload your .md files, hit save – each file gets converted to HTML via PW's core TextformatterMarkdownExtra and stored as a separate Repeater item. The source filename goes into the items title, processed files are removed from the upload automatically. Template output The Repeater items are regular PW pages, so output is straightforward: foreach ($page->md_import_items as $item) { echo "<section>"; echo "<h2>{$item->title}</h2>"; echo "<div>{$item->md_import_body}</div>"; echo "</section>"; } Tag mappings One thing we needed right away: control over how certain Markdown elements end up in HTML. For example, #headings in Markdown become <h1> – but on most websites <h1> is reserved for the page title. The module has a simple config (Modules → Configure → Markdown Importer) where you define tag mappings, one per line: h1:h2 h2:h3 strong:b blockquote:aside hr:br This performs a simple 1:1 tag replacement after conversion, preserving all attributes. Works well for standalone or equivalent elements like headings, inline formatting, blockquotes, or void elements like hr:br. Note that it doesn't handle nested structures – mapping table:ul for example would only replace the outer <table> tag while leaving thead, tr, td etc. untouched. Requirements ProcessWire 3.0.0+ FieldtypeRepeater (core) TextformatterMarkdownExtra (core) GitHub: github.com/frameless-at/MarkdownImporter Modules Directory: https://processwire.com/modules/markdown-importer/ Happy to hear if anyone finds this useful or has suggestions for improvements. Cheers, Mike
-
- 3
-
- Yesterday
-
Further to above, there was an issue with the sitemap handling urlsegments with the canonical link. Another hook solved it for me:
- Last week
-
Hi friends! And thanks for this useful module 😉 I'm not (actually) pretending to become this module supporter but I've found a bug which broke a couple of pages in my PW admin, so I had to make a fix. The problem is that Activity Log module cannot handle the situations when a data field has been deleted. I did a quick fix, feel free to use it 😉 MarkupActivityLog.module
-
Context Module - AI-Optimized Site Documentation with TOON Format
maximus replied to maximus's topic in Modules/Plugins
It's always great to hear feedback, it makes modules a must-have for every developer! -
☁️ Duplicator: Backup and move sites
Peter Knight replied to flydev's topic in Module/Plugin Development
Is Duplicator aware that some environments can contain symlinked Modules of remote repos? I can set the excluded files and folders to: .git .github .cursor .DS_Store .gitattributes .gitignore otherwise I recently had PHP warnings on some hosts about open_basedir restrictions. Cheers P -
module Image Classes — a CSS class picker for images in richtext editors
szabesz replied to Mikel's topic in Modules/Plugins
Nice solution! @Mikel Thanks for sharing! I will surely try it out. I used the style's menu for solving this, but your module is sure a lot more user-friendly.- 1 reply
-
- 1
-
-
@Soma a massive welcome back. I followed you on Twitter and absolutely loved your art journey but then it just seemed to disappear. As I hate social media I am not really on anything else, and certainly don't use X anymore. I always wondered what happened to a forum legend. As somebody mentioned earlier, you probably don't realise how much your posts have and still do help people.
-
If anyone is interested in being able to set script-src-attr to "none" on the frontend of their sites, the namespaced branch of Tracy now uses eventListeners everywhere - no more inline handlers.
-
Found it out myself. As a test case, I set up a vanilla multi-language site and created a custom TextLanguage field "custom1" for the images on "home". I wanted to change and save a single language value directly, e.g. $mlFieldValues->setLanguageValue("de", "new Value") ; $p->of(false); $p->save(); But this deletes all other language values. Instead, I have to 1. read in all current values, 2. change whatever language value has to be changed and 3. save the entire object. $newValues = ["de"=>"DE overwritten by script", "fi"=>"FI overwritten by script"]; $p = $pages->get(1); $img = $p->images->first(); $mlFieldValues = $img->custom1; print "\n\nBEFORE:\n";print_r($mlFieldValues); print "\n\nNEW VALUES:\n"; print_r($newValues); $p->of(false); foreach($newValues as $lang => $newValue){ $mlFieldValues->setLanguageValue($lang, $newValue) ; } $img->custom1 = $mlFieldValues; $p->save(); print "\n\nAFTER:\n";print_r($mlFieldValues); Output: BEFORE: ProcessWire\LanguagesPageFieldValue Object ( [default] => previous english value [de] => previous german value [fi] => previous finnish value ) NEW VALUES: Array ( [de] => DE overwritten by script [fi] => FI overwritten by script ) AFTER: ProcessWire\LanguagesPageFieldValue Object ( [default] => previous english value [de] => DE overwritten by script [fi] => FI overwritten by script )
-
Thanks @szabesz My comparison would be based strictly on licensing and 3rd party dependencies, so it wouldn't be fair. I didn't want to inject any processwire modules/jquery, etc. into the frontend. I leave processwire to do what it does best. I found sundeditor while working on a forum project a few years back. The source css/js files are fairly easy to update/customize, and the plain javascript, MIT license, and source were big selling points. So I can't really offer a comparison as I haven't tried modifying tinymce/ckeditor.
-
This week I worked with Claude Code on refactoring the core WireHooks class to improve it in various ways. I do this work because I like to code, so am of course handling that part. But Claude has been very helpful in finding issues as well as reviewing all my code before it gets committed. In this case, Claude found several bugs that are now fixed, and also saved me from introducing more when I added new features. Working with Claude Code reminds me of 1989 when I was in high school learning Turbo Pascal and building a BBS, and getting help from a neighbor and good friend that was doing the same. I learned so much then and now it feels like that time again. But man have things come a long way since then. I asked Claude about helping with the ProcessWire issues and requests GitHub repos, and now it's solving issue reports, replying to them and committing fixes. For simple fixes that involve a line or two, I'm going to let it handle the the whole thing. It's posting under my GitHub account, but it identifies itself as Claude in replies and and in commits. That way it's easy to tell what it does under my account. I had it just cover a couple of issue reports today as a test (see 2195 and 2192), but will be having it do a lot more going forward. Back to the WireHooks class, I asked Claude about writing a commit message for the WireHooks updates, and wow, check this out: Bug fixes in WireHooks: - conditionalArgMatch(): Fix Selector mutation bug where the shared Selector object stored in hook options was permanently mutated after the first call, causing argMatch hooks (e.g. addHook('WireLog::save(=errors)')) to stop matching after their first invocation. - getHooks(): Remove key variable from foreach to prevent shadowing $method param. - getHooks(): Replace array_merge() in loops with direct array append. - addHook(): Prevent 'noAddHooks' option from leaking into stored hook options. - isHookedOrParents(): Use $className string consistently in cache key writes, rather than $class which may be a Wire object. - runHooks(): Scope $useHookReturnValue inside foreach so it resets per hook. - runHooks(): Use strict null comparison ($toObject === null). Bug fixes in HookEvent: - arguments(): Allow setting an argument value to null (use func_num_args() > 1 instead of $value !== null check). - arguments(): Use array_key_exists() instead of isset() for null-correct lookup. - getArgumentNames(): Guard ReflectionMethod instantiation with method_exists() to avoid uncaught ReflectionException for dynamically-added hook methods. - __toString(): Fix argument list building (was appending to string instead of array), add null/bool display, avoid PHP fatal for objects without __toString(). New features in WireHooks: - cancelHooks: Now accepts string values 'before' or 'after' (in addition to boolean true) to cancel only hooks of a given type. For example, a before hook can set $event->cancelHooks = 'after' to cancel remaining after hooks without affecting the hooked method call. - Custom event data carry-forward: Custom data set on a HookEvent (via $event->customKey = $value) is now carried forward to subsequent HookEvent instances within the same runHooks() call. This allows before hooks to pass data to after hooks without using external variables. - getHooks('*'): Supports wildcard method to return all hooks for all objects. Available in debug mode only (uses allStaticHooks/allLocalHooks aggregates). - allStaticHooks: Now tracked alongside allLocalHooks when debug mode is on. - addHooks() comment fix: "If there is a parenthesis" corrected to "no parenthesis". - addHook() exception messages improved with additional context. - runHooks() docblock updated to include 'either' type. - hookTimer() PHPDoc: @param String corrected to lowercase string. New features in HookEvent: - $defaults static property: Defines the canonical set of standard HookEvent fields, used to distinguish custom data from built-in event properties. - $eid property: Each HookEvent instance gets a unique sequential event ID. - set() override: Tracks non-default keys set on the event in $customKeys. - getCustomData(): Returns only the custom (non-default) data set on the event, used internally by runHooks() for the carry-forward feature. - cancelHooks property updated to support bool|string type. Anyway, I know a lot of you here are deep into the AI stuff, and I'm just getting started, so none of this is surprising. But it sure is a pleasure collaborating with Claude Code on this stuff and it brings back that coding wonder and excitement from 1989. Some Claude and Claude Code podcasts I've enjoyed listening to or watching this week include one from AI for Humans Claude is Cooking, Wednesday's AI Daily Brief on How to use Claude's new upgrades, and the Get Educated AI video of how to setup Claude to use your computer and web browser, etc. (though I've not tried this just yet!). Lastly, last week I put together a ProcessWire powered JSON feed of bike tours, and the client prompted that they wanted a map and look what Claude Code did, I'm impressed!
-
- 16
-
-
Is Vimeo or a dedicated video host not an option?
-
@szabesz Sorry to hear that. I've been billed from Singapore for Kimi Code... Not sure if it would be useful to add mandarin in the email subject to create urgency? Though I think english is widely spoken there too.
-
Hi @Roope, thanks for this great module. I found a markup issue in Email Obfuscation 1.3.1 (ProcessWire 3.x, PHP 8.1+) when an email link contains an aria-label attribute. Reproduction Input HTML: <a href="mailto:mail@domain.de" class="uk-button uk-button-text" aria-label="Send email">mail@domain.de</a> Output with EMO enabled: <a href="mailto:<noscript data-emo="...">Enable JavaScript to view protected content.</noscript>" class="uk-button uk-button-text" aria-label="Send email"><noscript data-emo="...">Enable JavaScript to view protected content.</noscript></a> Expected behavior: the whole <a ...>...</a> should be obfuscated/replaced as one unit, not inject <noscript> into the href attribute. Suspected cause In EmailObfuscation.module (obfuscate()), the skip pattern for label also matches aria-label, which seems to split the anchor tag before the mailto regex can process it as a full link. As a temporary workaround, removing aria-label from mail links avoids the broken markup.