Skip to content

v2.18.0

Latest

Choose a tag to compare

@github-actions github-actions released this 05 Nov 03:02
Immutable release. Only release title and notes can be modified.
72d93f7

Added

  • Query loops can filter on a host's own taxonomies (#439). QueryRuntime::applyTaxQuery() only knew category and post_tag, so any other taxonomy left the loop unfiltered. It now passes those to a new ap.cmsFramework.query.taxQuery filter, with (Builder $query, string $taxonomy, list<int> $terms, string $operator, string $postType), and listeners constrain the builder in place and return it. The built-in taxonomies don't change, and with no listener an unmapped taxonomy stays a no-op. Unlike the built-ins, the filter also receives NOT IN, AND, EXISTS and NOT EXISTS, so a listener can implement them. Any other operator, or a taxonomy that isn't 1–64 letters, digits, _, -, . or :, never reaches the filter.

Changed

  • Plugin and theme changes now refresh the runtime synchronously. PluginManager::installFromZip(), installFromDisk(), activate(), deactivate() and delete(), and ThemeManager::installFromZip() and activateTheme(), now run queue:restart and, when the site has cached config, routes or events, rebuild each cache in a fresh php artisan process (up to 120 seconds each) before returning. Admin requests that make these changes take longer on a host with compiled caches, and every queue worker restarts after its current job (#450, #453).
  • cms.updates.opcache.web_reset defaults to off when APP_ENV=testing. Left unset, the CLI web-OPcache reset chain is skipped whenever app()->runningUnitTests() is true, without a warning or a php_reload_required flag. A deployed server that runs with APP_ENV=testing should set CMS_UPDATES_OPCACHE_WEB_RESET=true (#456).

Fixed

  • Plugin updates that download in the same second no longer share an archive (#460). On the legacy update_url feed path, UpdateManager::downloadUpdate() named its temp file from time() alone and buffered the whole archive in memory. Two updates in the same second wrote to the same file, so one update could extract the other's archive after its own checksum had passed, and the first update to finish deleted the archive the other still needed. The download now streams through StreamsDownloadsToDisk to a randomly named file, like the source-backed path. That path also applies the cms.updates.download_timeout timeout and https-only redirects. A non-2xx response is still reported as a download failure. Plugin and theme backup archives get a random suffix too, so two backups of the same version in the same second no longer overwrite each other.
  • Host and plugin test suites no longer reach a real PHP-FPM socket or the loopback route (#456). Since #453, every plugin or theme install, activation, deactivation and delete run from the CLI went through the web OPcache reset chain, so a downstream test suite made a FastCGI request to any PHP-FPM socket it found, an HTTP request to app.url's loopback route and, if configured, ran cms.updates.php_reload_command. A new cms.updates.opcache.web_reset setting (CMS_UPDATES_OPCACHE_WEB_RESET) turns the chain off or on. Left unset, it is off while the application runs its unit tests and on otherwise. A skipped reset records the method as null without flagging php_reload_required or logging a warning. The same applies to the self-updater and to the reset after a plugin's Composer install. UpdateStateStore::recordOpcacheReset() takes an optional $reloadRequired.
  • The core self-updater signals queue workers to restart after a rollback (#457). ApplicationUpdateManager::rollback() restored the snapshot and reset OPcache but never ran queue:restart, so a worker that loaded the failed release's classes, above all the one that ran PerformUpdateJob, kept them until it was restarted by hand. rollback() now runs queue:restart after its OPcache reset, and so does a failure with no snapshot to restore.
  • The core self-updater signals queue workers to restart after an update (#452). ApplicationUpdateManager rebuilt the compiled caches and reset OPcache but never ran queue:restart, so a worker started before the update, including the one running PerformUpdateJob, kept the old framework classes until it was restarted by hand. It now runs queue:restart after the OPcache reset, after a successful update and when a failure finishes forward. The restart moved into a new RestartsQueueWorkers trait that the self-updater and the plugin and theme managers share.
  • Plugin and theme installs and activations go live on production hosts (#453). With a route cache in place, a newly activated plugin's named routes didn't exist until route:cache was run, and nothing reset OPcache or restarted queue workers. PluginManager::installFromZip(), installFromDisk(), activate(), deactivate() and delete(), and ThemeManager::installFromZip() and activateTheme(), now rebuild the caches the site had, reset OPcache and run queue:restart, as updates do since #450. Each change refreshes once per request: an update's own deactivate and reactivate, a delete's deactivate and the OPcache reset after a Composer install (#438) are folded into it, and cms:plugins:sync refreshes once, only when something changed. The managers report the outcome through opcacheResetMethod() and phpReloadRequired(), and the install, activate, deactivate and delete endpoints return opcache_reset_method, php_reload_required and a warning, like the update endpoints. A change that fails after it was saved, such as an activated listener that throws, still refreshes before the failure is rethrown.
  • A rolled-back plugin or theme update resets OPcache and rebuilds the caches it cleared (#454). After a failed update restored its backup, PHP-FPM could keep serving bytecode compiled from the failed version's files, and caches cleared by the deactivate around an active plugin's update stayed cleared. Once the backup is restored, the plugin and theme UpdateManagers now run the same refresh as a successful update. When no OPcache reset reached the web server, the failed update's 422 error bag gains a php_reload_required message, and the plugin 409 and theme 500 responses carry opcache_reset_method and php_reload_required.
  • Plugin and theme updates now go live on production hosts without manual steps (#450). On a host with opcache.validate_timestamps=0, cached routes and a queue worker, an update only changed files. PHP-FPM kept a mix of old and new bytecode, the route cache kept the old routes, and workers ran the old job classes, so new methods and named routes failed until PHP-FPM was reloaded, optimize was run and PHP-FPM was reloaded again. After a successful plugin or theme update, UpdateManager now rebuilds the config, route and event caches the site had, in a fresh process and whatever cms.plugins.autoClearFrameworkCaches says, then resets the web server's OPcache through the self-updater's chain (#429), then runs queue:restart. The update endpoints report opcache_reset_method and php_reload_required, plus a warning to reload PHP-FPM when no reset reached it. The cache rebuild moved from ApplicationUpdateManager into a new RebuildsCompiledCaches trait.
  • Theme Image borders and shadows land on the <img> in the editor canvas (#449). GlobalStylesEmitter put a block's styles.blocks border and shadow on its wrapper, so an Image's frame wrapped its caption in the canvas, unlike the Blade front end since visual-editor 1.20. Border and shadow declarations now follow visual-editor's BlockStyleCssCompiler::FEATURE_SELECTORS (Image, Post Featured Image and Avatar on their <img>, and the shadow of Button and Table on their inner element), with a built-in copy of the map for older visual-editor versions.
  • Saved _resolved* attributes are stripped before a record's content is stamped (#448). rendered_content relied on the query pass stripping them by default, so a query pass that threw would let a saved _resolvedShareLinks win over what PostResolver computes. HasRenderedBlockContent now strips them as its own step, with visual-editor's ResolvedAttributes::strip() (or PostResolver::stripSavedAttributes()), and tells the query pass the tree is already stripped.
  • Site-editor filters keep all-digit slugs such as 404 (#447). The ap.visual-editor.templates, template-parts, patterns and navigation filter callbacks merged with array_merge(), which renumbers integer keys, so a static 404 entry and a resolved 404 template both survived and visual-editor's resolver returned a 500. They now use array_replace().
  • A plugin's Composer packages now reach PHP-FPM without a manual reload (#438). On a host with opcache.validate_timestamps=0, installing, updating or activating a plugin with a composer block succeeded, but every later request ran from PHP-FPM's cached pre-install autoload_static.php, bootstrap/cache/packages.php and services.php. The package's classes and service provider didn't exist for the site until PHP-FPM was reloaded. PluginManager now resets OPcache once the packages are installed. In a web request it calls opcache_reset(). From the CLI, such as workshop:checkin or cms:plugins:*, it uses the self-updater's chain from #429: FastCGI to cms.updates.opcache.fpm_socket, then the signed loopback route, then cms.updates.php_reload_command. If nothing reaches the web server, the install still succeeds and a warning tells the operator to reload PHP-FPM, with the reason each mechanism failed. The chain moved from ApplicationUpdateManager into a new ResetsWebOpcache trait, which both managers use.