ProcessWire 3.0.184 new master/main version

This week we have a new master/main version released after a full year in the making. As you might imagine, this new version has a ton of great new stuff and we’ll try to cover much of it here.

There's so much in this new version that we won't be able to cover everything you seen in the commits log, but we'll review the biggest changes, starting with a few highlights, and then get into some of the details.

What you’ll find in this new version

A collaborative community driven version of ProcessWire

This version was driven almost entirely by the ProcessWire community. The majority of what appears in the new master/main version came by way of pull requests, issue reports, ideas and feature requests from the community. This version includes nearly 40 user submitted pull requests and resolves more than 100 user submitted issue reports. A huge thanks to our community for all of their work with this version!

Our Github pull-request contributors list now includes 27 contributors, which is a significant and major increase from before. Though it's also worth noting that the actual number of contributors is certainly much larger, as several people (like Robin S.) have contributed quite a lot, though more silently through issue reports, feature requests and by other means over time. But even if it isn't comprehensive, it's really nice to see our official contributors list on GitHub growing so much. See the contributors list

New support for URL/path hooks

URL/path hooks enable you to provide a handler or output for any URL that you decide simply by adding a hook like this: $wire->addHook('/hey/man', function($e) { return 'Hi!'; }); The path /hey/man can be any path, but it also supports dynamic matches, patterns and capturing with expressions and arguments, enabling you to define a handler for any number of URLs at once. This is a really powerful new feature and one of my favorite additions to ProcessWire recently. Read more about URL/path hooks

$wire->addHook('/hello/world', function($event) {
  return 'Hello World';
}); 
$wire->addHook('/hello/{planet}', function($event) {
  return "Hello " . $event->planet;
}); 

Find pages faster and more efficiently

The new $pages->findRaw() method was added for finding pages and getting specific property/field values from them. It returns associative arrays of raw data without loading the actual pages. This enables a huge increase in performance when it suits your needs. Read more about findRaw and find() vs. findRaw()

$a = $pages->findRaw("template=blog-post", [ "title", "date" ]); 

$pages->findRaw() takes a selector and either a field name or an array of fields, and returns the raw, unformatted data for given field (or fields as) a PHP array. Field name may contain wildcards and you can also request subfield values.” —ProcessWire Weekly #351

If you like this kind of optimization, we think you'll also really enjoy the new programmatic autojoin options. Read more

$pages->find('template=blog-post, field=title|summary|author');

Our Uikit admin theme is now fully customizable

Major new admin theme customization options were added thanks to PRs by Bernhard Baumrock. ProcessWire can now compile Uikit 3 along with your own custom admin.less file additions to it, automatically. This great new addition puts you in full control over the admin stylesheet, opening up a world of new customizability in ProcessWire. It also enables us to easily keep the core’s Uikit version up-to-date. Read more about these additions and how to customize your admin theme

An example of a “dark theme” posted by user johndoe in the ProcessWire forums. Click the image below for his post which includes the admin.less file, plus examples from more users.

New database scalability options

ProcessWire now enables you to configure separate "reader" and "writer" database connections. You can also have multiple "reader" (read-only) connections. ProcessWire directs queries to the appropriate database connection on-the-fly, improving your site or application’s scalability and performance while reducing costs. Works great with AWS RDS read-replicas and Amazon Aurora replication, but can be used in any environment that supports separate reader and writer connections to the same database. Read more about DB readers/writers and more from ProcessWire Weekly

New flexible tags input type

The new InputfieldTextTags module was added to the core and it uses the Selectize JS library. This Inputfield provides a great new input method for selectable options (and tags) with Page fields, Options fields and Text fields. It can also be used on front-end forms, like in FormBuilder. In addition, it comes with an option to use it as an AJAX autocomplete input! Supports predefined and user-input options, multiple languages, and options for separate tags and labels. This is perhaps one of the most useful input types added to ProcessWire since the beginning, and we think you'll love it. Read more about the TextTags Inputfield

New decimal fieldype added

The new FieldtypeDecimal module was added to the core which enables support for decimal fields. This accompanies our existing Integer and Float fields and we think it's a very useful and necessary addition that answers an increasingly popular fieldtype need in ProcessWire. More about Decimal fields

“From an end user point of view Fieldtype Decimal is close to Fieldtype Float, the biggest difference being that it stores values in MySQL DECIMAL format instead of FLOAT. You'll find more details about why this matters from the original feature request as well as the forum thread about developing a decimal field, but the long story short is that while float provides slightly better performance, decimal should be used if accuracy is required (e.g. when doing calculations involving currency).” –ProcessWire Weekly #350

What else is new in ProcessWire 3.0.184?

In addition to the highlights outlined above, ProcessWire 3.0.184 contains a ton of new additions relative to the previous master/main version (3.0.165). Below is list of all that is new. Though note that it does not cover every detail, nor does it include a changes related to the more than 100 issue resolutions — for that we have the commit log.

Pages

New performance boosting programmatic autojoin options enabling you to find pages faster and more efficiently. Details

Improvements and optimizations to several text searching operators in DatabaseQuerySelectFulltext class. It now includes improved results for searches that include stopwords and short words (words too short for fulltext index).

Updated the $pages->getByPath() method to support new options such as allowing URL segments to appear in given path, disabling partial path matching, and supporting paths that might have a root subdirectory url in it. Details

Improvements and optimizations were made to several fulltext index-based text-searching operators (such as *=, ~=, *+=, ~+=) so that they can better match words too short to index, as well as many stopwords. Details

New $pages->findJoin('selector', [ fields ]); method finds pages and autojoins given field names. Details

New $pages->findRaw('selector', [ fields ]); method finds pages and returns raw field values from them in a PHP array. Details

New $pages->getRaw('selector', [ fields ]); method returns single page and requested raw field values. Details

New $pages->getFresh('selector'); method returns a fresh, non-cached copy of the page from the database. Details

New $page->setUnformatted('field', $value); method that temporarily turns off output formatting (if it was on), sets a known unformatted value, then turns output formatting back on (if it was previously on). Details

Files and images

Improvements to configuration of file and image fields. Plus, now you can enable custom fields for file/image fields much more easily. Details

Added support for secure page files on a per-template basis. Details

The core file and image fields have been updated with the ability to require (rather than just utilize) a FileValidatorModule for certain file upload extensions (like SVG). Details

Updated the image select (ProcessPageEditImageSelect) thumbnail list to use field labels to identify when there are multiple images fields on the page from which you can select images to insert.

Added support for more Fieldtypes within file/image custom fields, plus improved support for them in repeaters.

New $files->exists('/path/to/file', $options); method for checking if a file exists with optional $options argument that can be one or more of space-separated words in a string to also validate that it matches: 'readable', 'writable', 'file', 'link', 'dir'. Details

New $files->fileGetContents('/path/to/file/); method that returns the entire contents of given file. Abstracted version of PHP's file_get_contents(). Details

New $files->renameCopy($old, $new); method that enables file rename by first copying files to destination and then deleting source files. Details

Modules

Updated Modules system to support finding new module location when it moves in file system. Plus, added the ability to identify modules that are in the database but have no file on the file system. A "Missing" tab now appears in the Modules admin, identifying and providing tools for when such modules are found.

Added support for "preload" modules that load before all other modules, including core modules. This is primarily intended for Tracy Debugger.

Added a ConfigModule interface as an alternative to the existing ConfigurableModule interface for modules that want to maintain non-interactive configuration data. To support this interface, the module need only extend the WireData class.

Added ability to remove modules with missing files. This prevents orphan module entries in database when files for a module are removed before the module is uninstalled.

Database

Added support for starting/stopping debug mode DB query logging, enabling you to focus in on logging queries in between specific calls. See the boolean value option for the $sql argument of the $database->queryLog() method. Details

New $database->getColumns('table', $options); method returns an array of all columns in a table, with options. Details

New $database->getIndexes('table', $options); method returns all indexes from given table, with options. Details

New $database->indexExists('table', 'index'); method returns whether or not the given table has the given index. Details

New $database->getPrimaryKey('table'); method returns column(s) or info for given table’s primary key/index. Details

New $database->getTime(); method returns current ISO-8601 time string according to database server.

New $database->getVersion(); method returns the database version string. Details

New $database->getRegexEngine(); returns the type of regex engine the database uses. Details

Sanitizer

Improvements have been made to the $sanitizer array methods so that they can now support associative arrays with a ‘keySanitizer’ option that lets you specify which sanitizer method to clean up array indexes/keys.

The $sanitizer->validateFile() method was rewritten and improved, plus new ‘dryrun’ and ‘getArray’ options were added. Details

New $sanitizer->textdomain('value'); method that returns value sanitized as language textdomain. Details

New $sanitizer->selectorValueAdvanced(); method for sanitizing selector values using the advanced text search operator #=. Details

Session

Added IPv6 support to $session->getIP(). Details

Improvements to the SessionHandlerDB module including better handling and responses in error conditions.

New $session->sessionHandler(); method returns the current WireSessionHandler instance or null if using PHP file-based sessions.

New $session->location($url) method that is like the redirect() method but implies a temporary (302) redirect. Details

New $session->hasLoginCookie(); method that returns true if a session login cookie is present. This only indicates the user was likely logged in at some point, and may not indicate an active login. Details

PR #187 by @pine3ree was added, which adds cookie SameSite support for ProcessWire session cookies as well as other cookies set from the ProcessWire API.

Inputfields

ProcessWire can now open and collapse a multi-column row of Inputfields together as a group. So if you collapse an Inputfield that has other Inputfields in the same row, the entire row will collapse, rather than just one Inputfield within it. Details

Added support for $f = $inputfields->InputfieldText; which is equivalent to $modules->get('InputfieldText'); but more understandable to the IDE (like PhpStorm). The $inputfields can be any InputfieldWrapper like a form or fieldset.

Upgraded the InputfieldRadios and InputfieldCheckboxes modules to support a configurable "option width" setting. This enables a more responsive-friendly alternative to the existing "option columns" setting.

Added new InputfieldForm::renderOrProcessReady hook that is called before a form is either rendered or processed.

Upgraded CKEditor version to 4.16.0 for InputfieldCKEditor module.

Added CKEditor option for fixed-height inline mode (per request).

Added an "unmask" option to the Password Inputfield (per request).

New $inputfields->getByName('name'); method returns Inputfield having given name, or null if not found. Alias of getChildByName() method. $inputfields may be an InputfieldWrapper like a form or fieldset. Details

New $inputfields->getValueByName('name'); method that returns the value attribute from an Inputfield having given name. $inputfields may be an InputfieldWrapper like a form or fieldset. Details

PR #38 by @rolandtoth was added, which adds a “link text” feature to our modal link editor that you see when editing a link in CKEditor. This enables you to both see and modify the text of a link rather than just the URL it links to.

PR #169 by @BernhardBaumrock was added, which adds an alternative behavior for clicks of Inputfield headers/labels which makes Inputfields behave more consistently when it comes to their open and close behavior. For now, you can enable this is behavior in the AdminThemUikit module config, though if it's widely preferred we may make it the admin default at some point.

PR #184 by @teppokoivula was added which makes it possible to activate inline CKEditor instances from the keyboard rather than just the mouse.

Templates

Added a "Manage Tags" feature to the templates editor (Setup > Templates), just like the one in the fields editor. Plus new API methods for managing tags and improved support.

Numerous other improvements were also made to the templates editor (Setup > Templates). Details

New $template->editUrl(); method that returns the URL to edit $template. Details

New $templates->add('name'); method that creates and returns a new template and fieldgroup and saves to the database. Details

New $templates->rename($template, 'name'); method that renames a template, its fieldgroup and file (if writable). Details

Fields

Repeater fields updated with improved support for the "depth" option via "family friendly mode" which makes the depth option behave in a manner where items with more indent are considered children of items with less indent (parents). So when you click and drag to move a parent item, it brings along the children too. Details

“New icons for field editing, which (among other things) identify fields that have per-template overrides or context settings. Icon indicators now also function as direct links to the relevant part in the field edit screen.” (Quoted from ProcessWire Weekly #374) Details

“In the fields screen the "type" column now also displays the inputfield where it matters. For an example a field that was previously identified as "Textarea" might now show up as "Textarea/CKEditor", which makes identifying RTE fields a breeze.” (Quoted from ProcessWire Weekly #374) Details

Numerous other improvements were made to the fields editor. (Setup > Fields) Details

New $field->getContexts(); method that returns all contexts that a Field is used in. Details

Input

New $input->queryStringClean([ options ]); method like the existing $input->queryString() method except that it enables you to get a cleaned up version according to rules you specify in an $options argument. Details

PR #161 by @porl was added, which adds support for multi-dimensional arrays in our $input variables. To specify the multi-dimensional depth you want to support add a $config->wireInputArrayDepth = 2; to your /site/config.php file, and replace the "2" with the maximum depth you want to support.

Users

Added support for user-view-[role] permissions for cases where people may be implementing a /site/templates/user.php (or related) template file.

New $users->setAdminThemeByRole($adminTheme, $role); method sets all users having given role to use given admin theme. Details

Added Lister bookmarks support to users editor (ProcessUser) per request.

Multi-language

Updated the ProcessLanguageTranslator module to support download or view of CSV translations files.

New ability to bundle multi-language translations with your modules via a PR from @LostKobrakai. Details

Added support for custom LanguagePage classes, enabling you to extend the Language class like you do with other custom Page classes. More about custom page classes

Comments

Added new API method FieldtypeComments::getNotifyEmails() for getting notification emails.

Improved HTML version of notification emails sent by CommentNotifications::sendNotificationEmail(). Added a ‘notifyDefault’ option to CommentForm class so you can specify a different default notification option other than ‘off’.

Improvements to FieldtypeComments notifications to improve hookability and allow greater runtime/hook customization for how notification emails are sent.

Added support for searching flags property in FieldtypeComments::find() method.

Added new field configuration option to include comment text in notification emails.

Shutdown

Major refactoring and improvements to the WireShutdown class were made, plus a new setFatalErrorResponse() method was added. Details

Several improvements were made to admin error emails sent by the WireShutdown class.

New $shutdown->fatalError(); hookable method was added to enable hooking of fatal errors via WireShutDown::fatalError.

And more…

Added support for HTML Purifier configuration options (per request).

The WireHttp class has been updated with a new sendStatusHeader() method to accompany the existing sendHeader() method. Details

New $config->jsConfig(); method was added for setting or getting a value exclusive to ProcessWire’s javascript settings. Details

New $config->serverProtocol runtime property added which contains one of HTTP/1.1, HTTP/1.0, HTTP/2, or HTTP/2.0.

When editing the title of a page, it now updates the headline as you type in the page editor (in Uikit and Reno admin themes).

Added support in admin themes for interactively (in module config) converting existing users to use the admin theme automatically (by role).

Pages in trash now sort by modified time (per request).

Upgrading to ProcessWire 3.0.184

This is a major upgrade, but should also be a really easy upgrade for most. If upgrading from ProcessWire 3.0.135 or later, follow the general upgrade process which amounts to backing up your site (as always), and then replacing your old /wire/ directory with the one from the new version.

If upgrading from a 3.x version prior to 3.0.135, you'll want to upgrade your .htaccess file too. If running ProcessWire 2.x still, then see the upgrading from ProcessWire 2.x instructions. When possible, always test upgrades on a development or staging server before upgrading a live/production server.

Thanks for reading, and thanks again to everyone that has helped and contributed over the last year towards making this one of our best master/main versions ever! Thanks also to Teppo Koivula who runs ProcessWire Weekly and does an amazing job writing it every week.

Comments

  • Chris

    Chris

    • 3 years ago
    • 43

    Awesome, can't wait to try it out!

 

NextNew Repeater and Repeater Matrix features

1

This week we have some very useful new additions to both the core Repeater Fieldtype and the ProFields Repeater Matrix Fieldtype. This post covers all the details along with a couple of brief demonstration videos.  More 

Latest news

  • ProcessWire Weekly #549
    In the 549th issue of ProcessWire Weekly we’re going to check out the latest core updates, highlight one older yet still very relevant third party module, and more. Read on!
    Weekly.pw / 17 November 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits