This document will help you upgrading from a LUYA admin module version into another. For more detailed informations about the breaking changes click the issue detail link, there you can examples of how to change your code.
- Invert the
modules
order in your config file (e.g.config.php
) to preserve the old admin menu order.
from:
'modules' => [
/*...*/, // bottommost module in admin menu
'admin' => [ /*...*/ ],
'cmsadmin' => [ /*...*/ ], // topmost module in admin menu
],
to:
'modules' => [
'cmsadmin' => [ /*...*/ ], // topmost module in admin menu
'admin' => [ /*...*/ ],
/*...*/, // bottommost module in admin menu
],
- Run the migrate command, as new migrations are available.
- Admin 4.0 requires luya core 2.0, which is part of the new minimum requirement.
- #601 The
luya\admin\events\FileDownloadEvent::$file
does not recieve aluya\admin\file\Item
anymore, instead its aluya\admin\models\StorageFile
Active Record model instead. - #634 Removed deprecated properties and methods
luya\admin\Module::$assets
removedluya\admin\Module::$moduleMenus
removedluya\admin\Module::setJsTranslations()
removed
- #599 The base filesystem requires a new method to send a file as stream (resource). Therefore
fileSystemStream()
must be implemented if you have any custom file system.
- #576 Using the
yii\mutex\MysqlMutex
overyii\mutex\FileMutex
as default mutex handler for admin queue components. This is due to less file permission conflicts when running cli consoles and runtime folder. In order to ensure the old behavior use the configuration below:
'modules' => [
'admin' => [
'class' => 'luya\admin\Module',
'queueMutexClass' => 'yii\mutex\FileMutex',
]
]
- #484 Changed
applyFilter()
method signature in classluya\admin\modles\StorageFilterChain
fromapplyFilter($loadFromPath, $imageSavePath)
toapplyFilter(ImageInterface $image, array $saveOptions)
. Since version 3.2 the applyFilter requires an instance ofImagine\Image\ImageInterface
and returns an array containing two elements, the image object and the saving options. This method is internally used to apply the filter chain and is typically not used in an application. If you are, for some reason, calling this method update to the new signature.
- Run the migrate command, as new migrations are available.
- Deprecated class
can()
has been removed. (#429)
- The {{luya\admin\Module::$apiUserAllowActionsWithoutPermissions}} disables the access for none permission protected actions by default. This means that actions which does not have a permission system entry (like the global search) are disabled unless
$apiUserAllowActionsWithoutPermissions
is enabled. This ensures the Api Users which can be used for SPA applications won't have access to system APIs. - As {{luya\admin\base\RestActiveController::can()}} is deprecated you should define those permissions in {{luya\admin\base\RestActiveController::actionPermissions()}} instead. Assuming your code was looking like this:
public function actionLogin()
{
$this->can(Auth::CAN_UPDATE);
// ... code of login
}
Remove the can()
part and define in actionPermissions() instead:
public function actionPermissions()
{
return [
'login' => Auth::CAN_UPDATE,
];
}
- The
table-responsive-wrapper
class got removed and replaced by the Bootstrap version of responsive tables: https://getbootstrap.com/docs/4.3/content/tables/#responsive-tables. Make sure to update your Markup accordingly. - Change version constraint as we follow semver (from
~1.2
to^2.0
) - Change the ngRestRelation
apiEndpoint
totargetModel
. From'apiEndpoint' => Sale::ngRestApiEndpoint()
to'targetModel' => Sale::class
inside ofngRestRelations()
. - #268 Deprecated classes and methods haven been removed:
- luya\admin\aws\TagActiveWindow replaced by luya\admin\aws\TaggableActiveWindow
- luya\admin\importers\StorageImporter
- luya\admin\models\StorageImage::getThumbnail() replaced by luya\admin\models\StorageImage::getTinyCropImage()
- luya\admin\ngrest\aw\ActiveField replaced by luya\admin\ngrest\aw\ActiveWindowFormField
- luya\admin\ngrest\aw\CallbackFormWidget replaced by luya\admin\ngrest\aw\ActiveWindowFormWidget
- luya\admin\traits\TagsTrait replaced by luya\admin\traits\TaggableTrait
- This release contains the new migrations. The migrations are requried in order to make the admin module more secure. Therefore make sure to run the
./vendor/bin/luya migrate
command aftercomposer update
. - #90 Due to uglification of all javascrip files, the angularjs strict di mode is enabled. Therefore change angular controllers from
.controller(function($scope) { ... })
to.controller(['$scope', function($scope) { }])
. Read more about strict di: https://docs.angularjs.org/guide/di or https://stackoverflow.com/a/33494259 - #69 Removed deprecated
luya\admin\helpers\I18n::decodeActive
useluya\admin\helpers\I18n::decodeFindActive
instead. Removed deprecatedluya\admin\helpers\I18n::::decodeActiveArray
useluya\admin\helpers\I18n::decodeFindActiveArray
instead. - #122 Signature change of base file system. If you are using a custom file system you should take a look at the issue description!
- This release contains the new migrations which are required for the user and file table. Therefore make sure to run the
./vendor/bin/luya migrate
command aftercomposer update
.