Haste becomes a regular Contao bundle as of version 5.0.
The AjaxReload component has become a service and no longer accepts custom IDs:
// Content element (old)
\Haste\Ajax\ReloadHelper::subscribe(
\Haste\Ajax\ReloadHelper::getUniqid(\Haste\Ajax\ReloadHelper::TYPE_CONTENT, $contentElementId),
['foo-event']
);
// Content element (new)
$this->ajaxReloadManager->subscribe(\Codefog\HasteBundle\AjaxReloadManager::TYPE_CONTENT, $contentElementId, ['foo-event']);
// Frontend module (old)
\Haste\Ajax\ReloadHelper::subscribe(
\Haste\Ajax\ReloadHelper::getUniqid(\Haste\Ajax\ReloadHelper::TYPE_MODULE, $this->id),
['bar-event']
);
// Frontend module (new)
$this->ajaxReloadManager->subscribe(AjaxReloadManager::TYPE_MODULE, $frontendModuleId, ['bar-event']);
// Custom (old)
\Haste\Ajax\ReloadHelper::subscribe('my-unique-id', ['baz-event']);
// Custom (new)
// No longer supported!
This component did not change much, but we advise you to switch to the Contao core default features described in the manual.
The class with static methods has been converted to a service.
The DCA configurations did not change, but the class changes are BC breaks:
- The
\Haste\Model\Relations
class has been converted to the\Codefog\HasteBundle\DcaRelationsManager
service. - The model class has been renamed from
\Haste\Model\Model
to\Codefog\HasteBundle\Model\DcaRelationsModel
. - The following relation DCA keys have been converted from strings to arrays:
referenceSql
,fieldSql
. - The following relation DCA keys have been removed:
tableSql
. - The
\Codefog\HasteBundle\DcaRelationsManager::addRelationTables()
method has been removed as of 5.0 in favor of\Codefog\HasteBundle\DcaRelationsManager::appendToSchema()
.
The \Haste\Form\Form
class has been reworked and contains some BC breaks:
- The
tableless
feature has been dropped. - The form can now be initialized without the "submit check" callback.
- The
__toString()
method has been dropped. - The
splitHiddenAndVisibleWidgets()
method has been dropped. - The
addSubmitFormField()
method has a different argument order. Previously it wasaddSubmitFormField($fieldName, $label, $position = null)
and now it isaddSubmitFormField($label, $fieldName = 'submit', $position = null')
. - The
isDirty()
method has been dropped. Please usegetCurrentState()
instead. - The
addToTemplate()
method has been dropped. Please useaddToObject()
instead. - The
getMethod()
method has been renamed togetHttpMethod()
. - The
isNoValidate()
method has been renamed toisDisableHtmlValidation()
. - The
setNoValidate()
method has been renamed tosetDisableHtmlValidation()
. - The
setIsSubmitted()
method has been renamed tosetSubmitted()
. - The
bindModel()
method has been renamed tosetBoundModel()
. - The
getFormAction()
method has been renamed togetAction()
. - The
setFormActionFromUri()
method has been renamed tosetAction()
. - The
setFormActionFromPageId()
method has been renamed tosetActionFromPageId()
. - The
generateNoValidate()
method has been renamed togenerateNoValidateAttribute()
.
Please refer to the manual for new code examples.
The \Haste\Util\Format
class has been reworked and is now a \Codefog\HasteBundle\Formatter
service.
The \Haste\Util\Pagination
class has been reworked and contains some BC breaks:
- The
__toString()
method has been dropped. - The
isDirty()
method has been dropped. Please usegetCurrentState()
instead.
The \Haste\Util\StringUtil
class has been reworked and is now a \Codefog\HasteBundle\StringParser
service.
The \Haste\Util\Url
class has been reworked and is now a \Codefog\HasteBundle\UrlParser
service.
Furthermore, it no longer accepts the page ID as a second argument. Please provide the URL on your own instead.
The \Haste\Util\Undo
class has been reworked and is now a \Codefog\HasteBundle\UndoManager
service.
Furthermore, the $GLOBALS['HASTE_HOOKS']
and $GLOBALS['TL_HOOKS']['hasteUndoData']
has been removed. Use the event
dispatcher instead with the haste.undo
event.
Haste\Dca\PaletteManipulator
– it is a part of Contao core now.Haste\Dca\SortingFlag
– it is a part of Contao core now.Haste\Dca\SortingMode
– it is a part of Contao core now.Haste\Data
– obsolete stuff.Haste\DateTime
– use an alternative, for example nesbot/carbon.Haste\FileUpload
– obsolete stuff. The class itself has been moved to terminal42/contao-fineuploader.Haste\Frontend
– obsolete stuff.Haste\Geodesy
– obsolete stuff, use an alternative.Haste\Generator
– obsolete stuff.Haste\Haste
– obsolete stuff.Haste\Http
– use Symfony components instead.Haste\Image
– obsolete stuff.Haste\Input
– auto_item is always active in Contao core now.Haste\InsertTag
– obsolete stuff. The insert tags are still there.Haste\IO
– use an alternative, for example thephpleague/csv or PHPOffice/PhpSpreadsheet.Haste\Number
– obsolete stuff.Haste\Units
– use an alternative, for example jordanbrauer/unit-converter.Haste\Util\Debug
– obsolete stuff.Haste\Util\RepositoryVersion
– obsolete stuff.