Happy New Year everybody! 🍾
We begin 2020 with an awesome Roadiz update. v1.3 will bring many big new features such as versioning, encrypted settings and Symfony 4.4 LTS.
Lots of new features mean some changes to apply in your themes, check the following changelog to upgrade smoothly.
Feel free to answer in this thread to share your upgrade experience.
Migration to Symfony LTS 4.4.* version
- Many deprecation removals
choices_as_values
form option was removed, check your Form types
- New syntax for EventDispatcher and Event system
$form->isValid()
must be called after $form->isSubmitted()
Role
class deprecation
- (Doctrine) Removed deprecated
Doctrine\Common\Persistence
namespace
- (Doctrine) Removed deprecated
merge()
method
- Update for
intervention-request
lib
- More
strict_types
everywhere: pay more attention at your type especially when using native PHP function
with wrong argument types (ie. null
instead of string
with explode()
method).
- Single event classes and FQCN are used to address
EventDispatcher::dispatch
deprecation when using multiple arguments. See documentation for updating your events.
Markdown: get rid of Parsedown
in favor of thephpleague/commonmark
Due to PHP 7.4 and the lack of update from erusev/parsedown-extra
maintainer we decided to switch to
Commonmark
library with a custom made extension for Markdown footnotes support.
In order to anticipate any library change in the future we split the Markdown feature in a dedicated component: roadiz/markdown. This service provides a MarkdownInterface
with text
, textExtra
and line
methods, it’s up to you to wire any Markdown converter to these 3 methods.
Parsedown maintainers have updated parsedown-extra lib since we switched to commonmark. But, guess what, we made roadiz/markdown library extensible so you can revert using parsedown instead of commonmark without changing any code in Roadiz or your theme.
Redirections
- Nullable
redirectUri
and timestampable fields to control redirection by their date
- NodesSources redirections can be managed in their own section, in Node SEO page. This enables dynamic redirections with which query is static but redirected URL is generated at call-time against node-source URL.
ALTER TABLE redirections ADD created_at DATETIME NOT NULL, ADD updated_at DATETIME NOT NULL, CHANGE redirectUri redirectUri VARCHAR(255) DEFAULT NULL;
CREATE INDEX IDX_38F5ECE48B8E8428 ON redirections (created_at);
CREATE INDEX IDX_38F5ECE443625D9F ON redirections (updated_at);
Encrypted settings
Roadiz now takes advantage of rezozero/crypto
and paragonie/halite
libraries to perform modern cryptographic operations (this requires lib-sodium which should be available since PHP 7.2).


ALTER TABLE settings ADD encrypted TINYINT(1) DEFAULT '0' NOT NULL;
- New console command to generate a private key :
bin/roadiz generate:private-key
- New configuration param:
security.private_key_path
with default value: conf/default.key
Be careful to copy and back-up your private key when deploying your website data or your setting values will be lost for ever… ever.
If you enabled encryption on a setting while having no private key, data will be saved as a clear string into your database.
Versioning
We added node-source content versioning on scalar fields (not on relations and children nodes) to be able to view and revert to previous changes. Each node-source has its own history, so reverting changes on a parent node won’t affect its children.
A new DB table is required for holding versioning data:
CREATE TABLE user_log_entries (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, action VARCHAR(8) NOT NULL, logged_at DATETIME NOT NULL, object_id VARCHAR(64) DEFAULT NULL, object_class VARCHAR(255) NOT NULL, version INT NOT NULL, data LONGTEXT DEFAULT NULL COMMENT '(DC2Type:array)', username VARCHAR(255) DEFAULT NULL, INDEX IDX_BC2E42C7A76ED395 (user_id), INDEX log_class_lookup_idx (object_class), INDEX log_date_lookup_idx (logged_at), INDEX log_user_lookup_idx (username), INDEX log_version_lookup_idx (object_id, object_class, version), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC;
ALTER TABLE user_log_entries ADD CONSTRAINT FK_BC2E42C7A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE SET NULL;
bin/roadiz generate:nsentities
to add Versioned
flag on your node-sources fields.
- Add new
ROLE_ACCESS_VERSIONS
to allowed back-office users to manage versions.
AdvancedDocumentInterface
Roadiz now stores document file size and image average color for any processable formats.
ALTER TABLE documents ADD filesize INT DEFAULT NULL;
ALTER TABLE documents ADD average_color VARCHAR(7) DEFAULT NULL;
Backoffice
- Tag contents edition form is now submitted async… it will enhance UX when dealing with lots of tags before our team get the time to refactorize the whole back-office UI, especially trees.
- We hid newsletter feature until we can maintain it and… use it. Tell us if you are using this newsletter composing section and is it still relevant for you? Instead of using Mailchimp or any other dedicated solution.
Solr
- Make sure to update your Solr configuration since
v1.2.14
changes, see https://github.com/roadiz/roadiz/releases/tag/v1.2.14
- Solarium objects are now created using
RZ\Roadiz\Core\SearchEngine\SolariumFactoryInterface
service. Following code:
$solarium = new SolariumNodeSource(
$nodeSource,
$this->solr,
$this->dispatcher,
$this->handlerFactory,
$this->logger,
$this->markdown
);
can be replaced by:
/** @var SolariumNodeSource $solarium */
$solarium = $solariumFactory->createWithNodesSources($nodeSource);
Better docker for development configuration examples
You’ll find docker-compose.yml
examples in our standard edition and ready-to-build development docker images based on our production-ready Roadiz stack to develop with docker and get production-ish performances (on Linux and Windows, macOS still sucks with docker shared volumes).
Export
- Stack types are now exported with your nodes when using
.rzt
format from back-office.
Fonts
- We use absolutes paths instead of absolute URL in the
font-face
CSS file generated by Roadiz
Misc
- We now use
phpstan
to run static analyse with Travis CI for a better maintenance.
- We activated Symfony Debug tool in dev.php mode for cooler error pages. This means that 404 errors will not trigger your theme custom page since your are not in prod mode.
- Roadiz now supports latest
sentry/sentry
Monolog handler, make sure to require these librairies before using it in your configuration file: composer require sentry/sentry php-http/curl-client guzzlehttp/psr7
- Fixed login screen layout when errors occur, remove error message when requesting new password
Migration recap
ALTER TABLE redirections ADD created_at DATETIME NOT NULL, ADD updated_at DATETIME NOT NULL, CHANGE redirectUri redirectUri VARCHAR(255) DEFAULT NULL;
CREATE INDEX IDX_38F5ECE48B8E8428 ON redirections (created_at);
CREATE INDEX IDX_38F5ECE443625D9F ON redirections (updated_at);
ALTER TABLE settings ADD encrypted TINYINT(1) DEFAULT '0' NOT NULL;
ALTER TABLE documents ADD filesize INT DEFAULT NULL;
ALTER TABLE documents ADD average_color VARCHAR(7) DEFAULT NULL;
CREATE TABLE user_log_entries (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, action VARCHAR(8) NOT NULL, logged_at DATETIME NOT NULL, object_id VARCHAR(64) DEFAULT NULL, object_class VARCHAR(255) NOT NULL, version INT NOT NULL, data LONGTEXT DEFAULT NULL COMMENT '(DC2Type:array)', username VARCHAR(255) DEFAULT NULL, INDEX IDX_BC2E42C7A76ED395 (user_id), INDEX log_class_lookup_idx (object_class), INDEX log_date_lookup_idx (logged_at), INDEX log_user_lookup_idx (username), INDEX log_version_lookup_idx (object_id, object_class, version), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC;
ALTER TABLE user_log_entries ADD CONSTRAINT FK_BC2E42C7A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE SET NULL;
ALTER TABLE fonts CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL;
ALTER TABLE tags CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL;
ALTER TABLE subscribers CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL;
ALTER TABLE folders CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL;
ALTER TABLE translations CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL;
ALTER TABLE users CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL;
ALTER TABLE newsletters CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL;
ALTER TABLE custom_forms CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL;
ALTER TABLE nodes CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL;
ALTER TABLE documents CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL;