Skip to content

Latest commit

 

History

History
192 lines (164 loc) · 26.5 KB

5.4.0.md

File metadata and controls

192 lines (164 loc) · 26.5 KB
title
5.4.0 (unreleased)

5.4.0 (unreleased)

Overview

Features and enhancements

Option to change ClassName column from enum to varchar {#classname-varchar}

On websites with very large database tables it can take a long time to run dev/build, which can be a problem when deploying changes to production. This is because the ClassName column is an enum type which requires an a ALTER TABLE query to be run affecting every row whenever there is a new valid value for the column. For a very rough benchmark, running an ALTER TABLE query on a database table of 10 million records took 28.52 seconds on a mid-range 2023 laptop, though this time will vary depending on the database and hardware being used.

This release introduces a new configuration option to change the ClassName column to a varchar type which removes the need to run ALTER TABLE whenever there is a new valid value.

Enabling this will result in a trade-off where the size of the database will increase by approximately 7 MB per 100,000 rows. There will also be a very slow initial dev/build as all of the ClassName columns are switched to varchar. To enable this, add the following configuration:

SilverStripe\ORM\DataObject:
  fixed_fields:
    ClassName: DBClassNameVarchar

SilverStripe\ORM\FieldType\DBPolymorphicForeignKey:
  composite_db:
    Class: "DBClassNameVarchar('SilverStripe\\ORM\\DataObject', ['index' => false])"

Reports quality of life updates

Numerous slight adjustments have been made to the ReportAdmin class for a better experience.

The changes include:

  • Search capability added (making use of PartialMatchFilter)
  • Sorting by columns now posssible
  • Default Sort is now Title ASC
  • Reports list is now paginated
  • Description is now displayed in the list as a column

New class_description configuration on DataObject {#class-description}

SiteTree and BaseElement both seperately implemented a description configuration property which was used to describe the purpose of a given subclass. For SiteTree this is used when creating a new page in the CMS. For BaseElement this is used in the elemental blocks report. In both cases the purpose is the same - it provides additional context about the intended use case for a given subclass.

We've now implemented this concept in DataObject directly with the new DataObject.class_description configuration property. It is now considered best practice to add a description of DataObject subclasses using this configuration. You can use the new DataObject::classDescription() and DataObject::i18n_classDescription() methods if you need a description of any DataObject class. Those methods already existed on SiteTree but have been moved up the hierarchy so they can be called on any DataObject class.

For now this is only used in the same places that used to use the deprecated configuration, but future minor releases are likely to broaden the scope of its usage.

As a part of this change, the SiteTree.description and BaseElement.description configuration properties are now deprecated. Use class_description instead.

The SilverStripe\CMS\Model\SiteTree.DESCRIPTION localisation key (along with the .DESCRIPTION suffix for any SiteTree subclass) will stop being used in a future major release. Use SilverStripe\CMS\Model\SiteTree.CLASS_DESCRIPTION instead.

Other new features

  • A new BaseKernel::getBooted() method has been added for checking whether the kernel has been booted yet or not.
  • A new CoreKernel::setBootDatabase() method has been added to replace the now deprecated DatabaselessKernel class.
  • Two new methods have been added to ArrayLib:
    • ArrayLib::insertBefore() for inserting a value before another value in an array
    • ArrayLib::insertAfter() for inserting a value after another value in an array
  • A new DBDatetime::getTimeBetween() method has been added. This method returns the amount of time that has passed between two DBDateTime objects as a human-readable string.
  • A new AbstractQueuedJob::getQueue() static method has been added to get the correct queue constant from a given string or int.
  • New GridFieldFilterHeader::setPlaceHolderText() and GridFieldFilterHeader::getPlaceHolderText() methods have been added which provide a way to override the GridFieldFilterHeader search field placeholder text if the dynamically generated text doesn't suit your use case.

API changes

  • The class names for the TopPage feature in dnadesign/silverstripe-elemental do not follow the correct naming convention for Silverstripe CMS. The existing classes have been deprecated and will be renamed to match the correct naming convention in a future major release.
  • SilverStripe\ORM\ArrayLib has been deprecated. It will be renamed to SilverStripe\Core\ArrayLib
  • SilverStripe\ORM\ArrayList has been deprecated. It will be renamed to SilverStripe\Model\List\ArrayList
  • SilverStripe\ORM\Filterable has been deprecated. It will be merged into SS_List.
  • SilverStripe\ORM\GroupedList has been deprecated. It will be renamed to SilverStripe\Model\List\GroupedList
  • SilverStripe\ORM\Limitable has been deprecated. It will be merged into SS_List.
  • SilverStripe\ORM\ListDecorator has been deprecated. It will be renamed to SilverStripe\Model\List\ListDecorator
  • SilverStripe\ORM\Map has been deprecated. It will be renamed to SilverStripe\Model\List\Map
  • SilverStripe\ORM\PaginatedList has been deprecated. It will be renamed to SilverStripe\Model\List\PaginatedList
  • SilverStripe\ORM\Sortable has been deprecated. It will be merged into SS_List.
  • SilverStripe\ORM\SS_List has been deprecated. It will be renamed to SilverStripe\Model\List\SS_List
  • SilverStripe\ORM\ValidationException has been deprecated. It will be renamed to SilverStripe\Core\Validation\ValidationException
  • SilverStripe\ORM\ValidationResult has been deprecated. It will be renamed to SilverStripe\Core\Validation\ValidationResult
  • SilverStripe\View\ArrayData has been deprecated. It will be renamed to SilverStripe\Model\ArrayData
  • SilverStripe\View\ViewableData has been deprecated. It will be renamed to SilverStripe\Model\ModelData
  • SilverStripe\View\ViewableData_Customised has been deprecated. It will be renamed to SilverStripe\Model\ModelDataCustomised
  • SilverStripe\View\ViewableData_Debugger has been deprecated. It will be renamed to SilverStripe\Model\ModelDataDebugger
  • CliBypass has been deprecated. It will be removed without equivalent functionality to replace it.
  • CliController has been deprecated. It will be replaced with symfony/console commands.
  • DatabaselessKernel has been deprecated. Use CoreKernel::setBootDatabase() instead.
  • BuildTask.segment has been deprecated. It will be replaced with a new $commandName property.
  • BuildTask->description has been deprecated. It will be replaced with a new static property with the same name.
  • BuildTask::getDescription() has been deprecated. It will be replaced with a new static method with the same name.
  • DevBuildController has been deprecated. It will be replaced with a new SilverStripe\Dev\Command\DbBuild class.
  • DevConfigController has been deprecated. It will be replaced with a new SilverStripe\Dev\Command\ConfigDump class.
  • DatabaseAdmin has been deprecated. It will be replaced with a new SilverStripe\Dev\Command\DbBuild class.
  • DevelopmentAdmin::buildDefaults() has been deprecated. It will be replaced with a new SilverStripe\Dev\Command\DbDefaults class.
  • DevelopmentAdmin::generatesecuretoken() has been deprecated. It will be replaced with a new SilverStripe\Dev\Command\GenerateSecureToken class.
  • DevelopmentAdmin::getRegisteredController() has been deprecated. It will be removed without equivalent functionality to replace it.
  • DevelopmentAdmin.registered_controllers has been deprecated. It will be replaced with new controllers and commands configuration properties.
  • CleanupTestDatabasesTask::canView() has been deprecated. It will be replaced with a new canRunInBrowser() method.
  • HTTPOutputHandler has been deprecated. It will be renamed to SilverStripe\Logging\ErrorOutputHandler
  • Build has been deprecated. It will be replaced with a new SilverStripe\GraphQL\Dev\SchemaBuild class.
  • DevelopmentAdmin has been deprecated. It will be removed without equivalent functionality to replace it.
  • DevBuildExtension has been deprecated. It will be renamed to SilverStripe\GraphQL\Extensions\DbBuildExtension
  • LDAPGroupSyncTask::log() has been deprecated. It will be removed without equivalent functionality to replace it.
  • LDAPMemberSyncTask::log() has been deprecated. It will be removed without equivalent functionality to replace it.
  • LDAPMigrateExistingMembersTask::log() has been deprecated. It will be removed without equivalent functionality to replace it.
  • SubsiteCopyPagesTask::log() has been deprecated. It will be removed without equivalent functionality to replace it.
  • CheckExternalLinksTask::log() has been deprecated. It will be removed without equivalent functionality to replace it.
  • CheckExternalLinksTask::setSilent() has been deprecated. It will be removed without equivalent functionality to replace it.
  • CheckExternalLinksTask->silent has been deprecated. It will be removed without equivalent functionality to replace it.
  • RealMeSetupTask::message() has been deprecated. It will be removed without equivalent functionality to replace it.
  • StaticCacheFullBuildTask::log() has been deprecated. It will be removed without equivalent functionality to replace it.
  • ContentReviewOwnerMigrationTask has been deprecated. It will be removed without equivalent functionality to replace it.
  • CronTaskController has been deprecated. It will be replaced with a new SilverStripe\CronTask\Cli\CronTaskCommand class.
  • Clear has been deprecated. It will be replaced with a new SilverStripe\GraphQLDevTools\SchemaClear class.
  • ConvertTranslatableTask has been deprecated. It will be removed without equivalent functionality to replace it.
  • Exception has been deprecated. It will be removed without equivalent functionality to replace it.
  • UpdatePackageInfoTask->supportedAddonsLoader has been deprecated. It will be removed without equivalent functionality to replace it.
  • UpdatePackageInfoTask::getSupportedAddonsLoader() has been deprecated. It will be removed without equivalent functionality to replace it.
  • UpdatePackageInfoTask::setSupportedAddonsLoader() has been deprecated. It will be removed without equivalent functionality to replace it.
  • ProcessJobQueueChildTask has been deprecated. It will be replaced with a new Symbiote\QueuedJobs\Cli\ProcessJobQueueChildCommand class.
  • ProcessJobQueueTask::getQueue() has been deprecated. Use AbstractQueuedJob::getQueue() instead.
  • HTTPOutputHandler::isCli() has been deprecated. Use Director::is_cli() instead instead.
  • PasswordValidator has been deprecated. It will be renamed to SilverStripe\Security\Validation\RulesPasswordValidator.
  • ContentReviewEmails::isValidEmail() has been deprecated. Use Email::is_valid_address() instead.
  • The DBField.defaultVal property has been deprecated. Use DBField::getDefaultValue() and DBField::setDefaultValue() instead.
  • DBFile::validate() has been deprecated. Use DBFile::validateFilename() instead.
  • ContentController::Menu() has been deprecated. Use ContentController::getMenu() instead if calling the method in PHP. You can continue to use $Menu in templates, including passing arguments to it.
  • GridFieldDataColumns::getValueFromRelation() has been deprecated. It will be removed without equivalent functionality to replace it.
  • ViewableData::castingClass() has been deprecated. It will be removed without equivalent functionality to replace it.
  • ViewableData::escapeTypeForField() has been deprecated. It will be removed without equivalent functionality to replace it.
  • ViewableData::objCacheName() has been deprecated. It will be made private. The corresponding ViewableData::objCacheSet() and ViewableData::objCacheGet() methods will change method signature to not require passing in the cache key.
  • The $cacheName parameter for the ViewableData::obj() method has been deprecated. It will be removed without equivalent functionality to replace it.
  • ViewableData::cachedCall() has been deprecated. Use ViewableData::obj() instead.
  • ViewableData::XML_val() has been deprecated. It will be removed without equivalent functionality to replace it.
  • ViewableData::getXMLValues() has been deprecated. It will be removed without equivalent functionality to replace it.
  • The $parser parameter for the SSViewer::__construct() method has been deprecated. It will be removed without equivalent functionality to replace it.
  • SSViewer::flush() has been deprecated. It will be replaced with SilverStripe\TemplateEngine\SSTemplateEngine::flush().
  • SSViewer::fromString() has been deprecated. It will be replaced with SilverStripe\TemplateEngine\SSTemplateEngine::renderString().
  • SSViewer::topLevel() has been deprecated. It will be removed without equivalent functionality to replace it.
  • SSViewer::chooseTemplate() has been deprecated. It will be removed without equivalent functionality to replace it.
  • SSViewer::setTemplate() has been deprecated. It will be replaced with SilverStripe\TemplateEngine\SSTemplateEngine::setTemplate().
  • SSViewer::setParser() has been deprecated. It will be replaced with SilverStripe\TemplateEngine\SSTemplateEngine::setParser().
  • SSViewer::getParser() has been deprecated. It will be replaced with SilverStripe\TemplateEngine\SSTemplateEngine::getParser().
  • SSViewer::hasTemplate() has been deprecated. It will be replaced with SilverStripe\TemplateEngine\SSTemplateEngine::hasTemplate().
  • SSViewer::exists() has been deprecated. It will be removed without equivalent functionality to replace it.
  • SSViewer::getTemplateFileByType() has been deprecated. It will be removed without equivalent functionality to replace it.
  • SSViewer::flush_template_cache() has been deprecated. It will be replaced with SilverStripe\TemplateEngine\SSTemplateEngine::flushTemplateCache().
  • SSViewer::flush_cacheblock_cache() has been deprecated. It will be replaced with SilverStripe\TemplateEngine\SSTemplateEngine::flushCacheBlockCache().
  • SSViewer::setPartialCacheStore() has been deprecated. It will be replaced with SilverStripe\TemplateEngine\SSTemplateEngine::setPartialCacheStore().
  • SSViewer::getPartialCacheStore() has been deprecated. It will be replaced with SilverStripe\TemplateEngine\SSTemplateEngine::getPartialCacheStore().
  • SSViewer::includeGeneratedTemplate() has been deprecated. It will be replaced with SilverStripe\TemplateEngine\SSTemplateEngine::includeGeneratedTemplate().
  • The $inheritedScope parameter for the SSViewer::process() method has been deprecated. It will be removed without equivalent functionality to replace it.
  • SSViewer::getSubtemplateFor() has been deprecated. It will be replaced with SilverStripe\TemplateEngine\SSTemplateEngine::getSubtemplateFor().
  • SSViewer::parseTemplateContent() has been deprecated. It will be replaced with SilverStripe\TemplateEngine\SSTemplateEngine::parseTemplateContent().
  • SSViewer::templates() has been deprecated. It will be removed without equivalent functionality to replace it.
  • SSViewer::setTemplateFile() has been deprecated. It will be removed without equivalent functionality to replace it.
  • SSViewer::get_base_tag() has been deprecated. Use SSViewer::getBaseTag() instead.
  • SSViewer_DataPresenter has been deprecated. It will be merged into SSViewer_Scope.
  • SSViewer_FromString has been deprecated. It will be replaced with SilverStripe\TemplateEngine\SSTemplateEngine::renderString().
  • SSViewer_Scope::getItem() has been deprecated. Use SSViewer_Scope::getCurrentItem() instead.
  • SSViewer_Scope::obj() has been deprecated. It will be renamed to scopeToIntermediateValue().
  • SSViewer_Scope has been deprecated. It will be renamed to SilverStripe\TemplateEngine\ScopeManager.
  • SSViewer::execute_template() has been deprecated. It will be removed without equivalent functionality to replace it.
  • SSViewer::execute_string() has been deprecated. It will be removed without equivalent functionality to replace it.
  • ThemeResourceLoader::findTemplate() has been deprecated. It will be removed without equivalent functionality to replace it.
  • FlushMiddleware has been deprecated. It will be replaced with flushing inside the Kernel directly.
  • The LeftAndMain.tree_class configuration property has been deprecated. It will be renamed to model_class.
  • SiteConfigLeftAndMain::save_siteconfig() has been deprecated. It will be replaced with save().
  • SSViewer_BasicIteratorSupport has been deprecated. It will be renamed to SilverStripe\TemplateEngine\BasicIteratorSupport.
  • SSTemplateParseException has been deprecated. It will be renamed to SilverStripe\TemplateEngine\Exception\SSTemplateParseException.
  • SSTemplateParser has been deprecated. It will be renamed to SilverStripe\TemplateEngine\SSTemplateParser.
  • TemplateIteratorProvider has been deprecated. It will be renamed to SilverStripe\TemplateEngine\TemplateIteratorProvider.
  • TemplateParser has been deprecated. It will be renamed to SilverStripe\TemplateEngine\TemplateParser.
  • ElementalAreaController::removeNamespacesFromFields() has been deprecated. It will be removed without equivalent functionality to replace it.
  • BaseElement::updateFromFormData() has been deprecated. It will be removed without equivalent functionality to replace it.
  • DBEnum::flushCache() has been deprecated. Use DBEnum::reset() instead.
  • The BaseElement.description configuration property has been deprecated. Use DataObject.class_description instead.
  • The SiteTree.description configuration property has been deprecated. Use DataObject.class_description instead.

Bug fixes

This release includes a number of bug fixes to improve a broad range of areas. Check the change logs for full details of these fixes split by module. Thank you to the community members that helped contribute these fixes as part of the release!