Related: octobercms/october#3208. This issue surfaces when deployment tools attempt to run various commands not already protected (i.e. vapor:health-check) before running any migrations, which causes issues if plugins attempt to access the database during their registration or booting process.
In theory we could also apply this logic to HTTP requests, however it is generally easier to see and handle the reported exception of the table being missing in an HTTP context, so it's acceptable to limit this protection to the CLI.
As a reminder, plugins making use of the $elevated permissions are responsible for defensive measures to reliably operate in potentially unstable states of the application.
Related: octobercms/october#3208. This solves an issue when attempting to access any SettingsModel before initial migrations have been run but the database exists (which is all App::hasDatabase() looks for).
This change allows developers to prevent the CMS route from being registered.
An example use case for this is loading the CMS content under a set path prefix by re-registering the CMS route with the appropriate prefix in place. Preventing the registration of the default CMS route is required in order to override the mapping of the controller action to URL (and thus have the Cms::url() helper generate the correct URLs in this example).
Example:
```php
Route::any('docs/{slug?}', 'Cms\Classes\CmsController@run')->where('slug', '(.*)?')->middleware('web');
Event::listen('cms.beforeRoute', function () {
$path = Request::path();
// Disable the CMS routes so that the docs/ route can take over for URL generation
if (Str::startsWith($path, 'docs')) {
return false;
}
});
```
Introduce a delay to give the widget enough time to show the just added item before maxItem limit check is run.
Co-authored-by: Alexandr Orosciuc <alexandr.orosciuc@isoftbet.com>
Co-authored-by: Ben Thomson <git@alfreido.com>
The override for the paths in the testing environment was causing plugin tests to fail as the base plugin test class was pointing to the wrong plugin root.
I've changed it so the override is now only applied for the test(s) that need it.
Refs: https://github.com/wintercms/wn-redirect-plugin/pull/15#issuecomment-1510038828
This adds the sizeBytes & lastModified item attributes to the getItems() function in mediamanager.js exposing them for use in the onInsert() handler of the MediaManager popup.
Credit to @zaxbux
This PR introduces support for all mediamanager filters as modes for the mediafinder formwidget.
This means that the following mode values would be available:
image
file
document
audio
video
all (default)