Roadiz is a polymorphic CMS based on a node system which can handle many types of services. This is v1 repository, for v2 and newer releases check https://github.com/roadiz/skeleton.
solr
from path https://github.com/solariumphp/solarium/releases/tag/5.0.0-alpha.1
Solarium\QueryType\Select\Query\Component\BoostQuery
has been moved to Solarium\Component\DisMax\BoostQuery
solr:
endpoint:
localhost:
host: localhost
port: '8983'
path: /
core: mycore
đ Dear fellow followers,
Here is our Roadiz summer update with great new features and improvements. But before, just a quick reminder with some useful links to bookmark:
Node::setStatus()
method is now @internal
. Use $this->get('workflow.registry')->get($node)->apply($node, 'publish')
to publish a node. Roadiz workflow registry can be extended with your own entities state machine.weight
attribute then set it to 30 kg
for one node, and to 15 kg
for another one. Attribute system is very handy if your customer wants some flexibility in its node schema without updating node-types and your Twig template for each new field. Just add new attributes, then loop over them in your templates. Ok, so why can't we use only attributes and no more node-types fields? Because attributes are for scalar values only (no relations) and not queryable (yetâŚ). But we still index them in your Solr index.AppController::getRoot
and Theme::getRoot
were deprecated and have been removed now.NSEntities::xxxxSources
methods to fetch NodesSources instead of Nodes in your Controllers and templates. For example, use {{ nodeSource.referencePageSources[0] }}
instead of {{ nodeSource.referencePage[0].nodeSources.first }}
to fetch your referencePage field in Twig. xxxxSources methods are optimized when referenced nodes are only from one type, avoiding left join on every node-types. Execute bin/roadiz generate:nsentities
to get these new proxy methods.ttl
field on node and defaultTtl
field on node-types to make HTTP cache TTL editable from back-office (if your theme use these new fields). 0
TTL means no cache. Node TTL is in minutes, not seconds.DefaultController
for easier theme development, no more need to create a PHP controller for each node-type, just a Twig template. Donât worry, youâll still need controllers for custom template assignation or logic, but avoiding Controller creation for basic pages will speed up developmentâŚ$this->get('serializer')
. We added normalization annotations on each Roadiz entities to prepare full JSON API in your themes.
description
field to Setting, because a bit of documentation never hurted anyone (except for the one who writes it).makeResponseCachable
is now using event dispatcher to alter Response cache headers and to remove headers set by active session.{{ path() }}
results according to NodeType. For example, a Link node path should not be generated as a real node but it should be generated against its linked node URL instead.
initEvents
method call to boot
allowing register
method to be overridden in your AppKernel
class.FirewallEntry::firewallAfterLogout
parameter to customize path after user logged out (available since v1.1.19) instead of redirecting on firewallâ entry point.themes:migrate
command to combine themes:install --data
, generate:nsentities
and orm:schema-tool:update
commands.ScriptHandler::rotateSecret
script to generate a new security.secret
at each composer install and update.Roadiz v1.2 is compatible with PHP 7.2 minimum. Itâs time to upgradeâŚ
validateAccessForRole()
method to use Symfony standard denyAccessUnlessGranted()
method in order to enable complex Voters
|url
twig filter was deprecated for NodeSource and Node and has been removed nowfindByXXXXAndFieldName
repository methods (custom-forms, node-sources, nodes, documents) because they are not safe when multiple fields exist with the same name.app/AppKernel
instead of your configuration (which can be volatile between different environments).additionalServiceProviders: { }
additionalCommands: { }
This update need many SQL changes then some migrations to populate missing new data. Make sure to backup your database before migrating! â bin/roadiz database:dump -c
ttl
field on node and new defaultTtl
on node-typeCREATE TABLE attribute_values (id INT AUTO_INCREMENT NOT NULL, attribute_id INT DEFAULT NULL, node_id INT DEFAULT NULL, position DOUBLE PRECISION NOT NULL, INDEX IDX_184662BCB6E62EFA (attribute_id), INDEX IDX_184662BC460D9FD7 (node_id), INDEX IDX_184662BC462CE4F5 (position), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB;
CREATE TABLE attributes (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(255) NOT NULL, searchable TINYINT(1) DEFAULT '0' NOT NULL, type INT NOT NULL, UNIQUE INDEX UNIQ_319B9E7077153098 (code), INDEX IDX_319B9E7077153098 (code), INDEX IDX_319B9E708CDE5729 (type), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB;
CREATE TABLE attribute_value_translations (id INT AUTO_INCREMENT NOT NULL, translation_id INT DEFAULT NULL, value VARCHAR(255) DEFAULT NULL, attributeValue_id INT DEFAULT NULL, INDEX IDX_1293849B9CAA2B25 (translation_id), INDEX IDX_1293849BFF82614D (attributeValue_id), INDEX IDX_1293849B1D775834 (value), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB;
CREATE TABLE attribute_translations (id INT AUTO_INCREMENT NOT NULL, attribute_id INT DEFAULT NULL, translation_id INT DEFAULT NULL, label VARCHAR(255) NOT NULL, options LONGTEXT DEFAULT NULL COMMENT '(DC2Type:simple_array)', INDEX IDX_4059D4A0B6E62EFA (attribute_id), INDEX IDX_4059D4A09CAA2B25 (translation_id), INDEX IDX_4059D4A0EA750E8 (label), UNIQUE INDEX UNIQ_4059D4A0B6E62EFA9CAA2B25 (attribute_id, translation_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB;
ALTER TABLE attribute_values ADD CONSTRAINT FK_184662BCB6E62EFA FOREIGN KEY (attribute_id) REFERENCES attributes (id) ON DELETE CASCADE;
ALTER TABLE attribute_values ADD CONSTRAINT FK_184662BC460D9FD7 FOREIGN KEY (node_id) REFERENCES nodes (id) ON DELETE CASCADE;
ALTER TABLE attribute_value_translations ADD CONSTRAINT FK_1293849B9CAA2B25 FOREIGN KEY (translation_id) REFERENCES translations (id) ON DELETE CASCADE;
ALTER TABLE attribute_value_translations ADD CONSTRAINT FK_1293849BFF82614D FOREIGN KEY (attributeValue_id) REFERENCES attribute_values (id) ON DELETE CASCADE;
ALTER TABLE attribute_translations ADD CONSTRAINT FK_4059D4A0B6E62EFA FOREIGN KEY (attribute_id) REFERENCES attributes (id) ON DELETE CASCADE;
ALTER TABLE attribute_translations ADD CONSTRAINT FK_4059D4A09CAA2B25 FOREIGN KEY (translation_id) REFERENCES translations (id) ON DELETE CASCADE;
ALTER TABLE settings DROP FOREIGN KEY FK_E545A0C550DDE1BD;
ALTER TABLE settings ADD description LONGTEXT DEFAULT NULL;
ALTER TABLE settings ADD CONSTRAINT FK_E545A0C550DDE1BD FOREIGN KEY (setting_group_id) REFERENCES settings_groups (id) ON DELETE SET NULL;
CREATE INDEX IDX_E545A0C58CDE5729 ON settings (type);
CREATE INDEX IDX_E545A0C55E237E06 ON settings (name);
CREATE INDEX IDX_E545A0C57AB0E859 ON settings (visible);
ALTER TABLE nodes ADD ttl INT DEFAULT 0 NOT NULL;
ALTER TABLE documents ADD imageWidth INT DEFAULT 0 NOT NULL, ADD imageHeight INT DEFAULT 0 NOT NULL;
CREATE INDEX IDX_A2B072882100AA2E ON documents (mime_type);
ALTER TABLE node_types ADD default_ttl INT DEFAULT 0 NOT NULL;
CREATE INDEX IDX_7C7DED6D2B36786B ON nodes_sources (title);
ROLE_ACCESS_ATTRIBUTES
in order to access new Attributes admin sections.bin/roadiz documents:size
command to migrate all documents images size to database if you want Twig filters imageSize
, imageRatio
and imageOrientation
to keep on working.bin/roadiz generate:nsentities
to update your NS classes and benefit from new proxy methods.composer.json
.At last, our first minor upgrade since the official Roadiz release. No worries about compatibilities but some great new features: especially with <picture>
support and automatic WebP convert.
Do not hesitate to share and submit your suggestion on our forum: https://ask.roadiz.io/
đ
No database migration to perform. âď¸
_format
parameter to NodeSourceRouting for matching and generating NodeSource responses in JSON and XML.apcu
.
RoleInterface
deprecation.sha512
, pbkdf2
, bcrypt
, argon2i
)roadiz/php73-runner
, roadiz/php73-nginx-alpine
CollectionType
which stores items with non-numeric keys. Using a new NodeSourceCollectionType
.composer.json
inside your themes but use Roadiz Standard edition and its root composer.json
for your dependencies.lazyload_class
option for picture element\DateTime
values in contact-form.emailType
field for EmailManager to allow custom email templates.HoneypotType
(available in v1.0.20 too) to prevent bot submit (not as efficient as a Recaptcha but no need to create an app key and secret).As said by semver specifications:
If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If youâre worrying a lot about backwards compatibility, you should probably already be 1.0.0.
So letâs be bold and letâs go to 1.0.0. We still have lots of enhancements and feature in mind to add to Roadiz, but we will keep on supporting backward compatibility on patch (hotfix) and minor releases. Weâre even bolder we increased minimum required PHP version to 7.1, itâs time to give up PHP 5 youâll never regret it after seeing the speed boost.
defaultValues
field to Settings to be able to create ChoiceList settings:ALTER TABLE settings ADD defaultValues LONGTEXT DEFAULT NULL;
bin/roadiz themes:generate
will update your app/conf/config.yml
file automatically:themes:
-
classname: \Themes\DefaultTheme\DefaultThemeApp
hostname: '*'
routePrefix: ''
mailer:
type: smtp
host: localhost
port: 1025
|replace('old', 'new')
must be used only with array syntax: |replace({'old': 'new'})
bags
and request
variables no longer need to be passed in your includes, theyâve been globalized.TextType::class
, plus you cannot use AbstractType constructors with parameters anymore since Symfony will instanciate your form types for you. Use form option resolver instead.$container
field has now protected
access. Every Standard Edition projects should update their clear_cache.php
entry point.$kernel->getContainer()->offsetSet('request', $request);
$kernel->get('requestStack')->push($request);
replace
filter and macro
handling.Swift_MailTransport
has been removed
ThemeResolverInterface
.render()
and controller()
Twig methods. Roadiz block rendering now inherits Symfonyâs FragmentHandler logic and sub-request routine.sentry/sentry
library in your composer.json
FormType
in your theme with any scalar fields and register it in your node-type field default value: Roadiz will create a CollectionType
form using your custom type and store it as an array.# AbstractType class name
entry_type: Themes\MyTheme\Form\FooBarType
EventSubscriber
to make it extendable from your themes. Just listen to RZ\Roadiz\Core\Events\CacheEvents::PURGE_REQUEST
event.QueryBuilderEvents::QUERY_BUILDER_BUILD_FILTER
event.preview.php
entry point$container
field has now protected
access. Use getContainer()
or get($service)
methodsROADIZ_ROOT
constant is deprecated, use Kernel::getProjectDir()
instead (needs a AppKernel
upgrade on your Standard-Edition projects)makeResponseCachable
method in controllers to set right headers for reverse proxies.preview.php
entry pointcreateNamedFormBuilder
method in your controllers.requestStack
when possible to prevent null
Request.searchBy
method when Nodes are ordered by nodes-source publication date.Kernel::CMS_VERSION
will now show master or develop branch, Kernel::$cmsVersion
still holds Roadiz semantic version.security:
session_name: roadiz_session_token
session_cookie_httponly: true
session_cookie_secure: false
debug:configuration
console commandEach user can set his locale, there is a new column/index on their table:
ALTER TABLE users ADD locale VARCHAR(7) DEFAULT NULL;
CREATE INDEX IDX_1483A5E94180C698 ON users (locale);
Rozier now use Webpack and inject its CSS and JS files into twig templates like any theme. Make sure to use namespaced imports in your themes! If not, your theme will try to load backoffice assets instead.
{% include '@MyTheme/partials/js-inject.html.twig' %}
{% include '@MyTheme/partials/css-inject.html.twig' %}
themes:info
commandthemes:install
and themes:assets:install
commands (useful to add a third-party theme located in vendor/
folder)locale
field on User entity. Be careful: language must be created as a Translation
.NotFoundHttpException
and ResourceNotFoundException
exceptionsRozier
back-office theme from @Gouterman. Switched to ES6 and Webpack
defaultTranslation
) and locale name in node tree.TagTranslation
entity, you have to execute some SQL migrations:CREATE TABLE tags_translations_documents (id INT AUTO_INCREMENT NOT NULL, tag_translation_id INT DEFAULT NULL, document_id INT DEFAULT NULL, position DOUBLE PRECISION NOT NULL, INDEX IDX_6E886F1F22010F1 (tag_translation_id), INDEX IDX_6E886F1FC33F7837 (document_id), INDEX IDX_6E886F1F462CE4F5 (position), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
ALTER TABLE tags_translations_documents ADD CONSTRAINT FK_6E886F1F22010F1 FOREIGN KEY (tag_translation_id) REFERENCES tags_translations (id) ON DELETE CASCADE;
ALTER TABLE tags_translations_documents ADD CONSTRAINT FK_6E886F1FC33F7837 FOREIGN KEY (document_id) REFERENCES documents (id) ON DELETE CASCADE;
ALTER TABLE users CHANGE picture_url picture_url LONGTEXT DEFAULT NULL;
bin/roadiz logs:cleanup
which delete logs entries older than 6 months from databaseNodesSources
to external objects such as API itemsTagTranslationDocuments
relation entity to add media to your tags translations (see migration above){{ path(nodeSource) }}
in templates or $this->generateUrl($nodeSource)
in PHP Controllers.--symlink
and --relative
options when generating your themes and copying assets to public directory. Default will be hard copy. #283# For MacOS and Unix
bin/roadiz themes:generate --symlink --relative FooBar
# For Windows (absolute symlink)
bin/roadiz themes:generate --symlink FooBar
# For Windows (hard copy)
bin/roadiz themes:generate FooBar
bin/roadiz themes:assets:install
command to copy or symlink a theme assets when it already exists. You can use it with Install, Debug and Rozier themes too.# For MacOS and Unix
bin/roadiz themes:assets:install --symlink --relative FooBar
# For Windows (absolute symlink)
bin/roadiz themes:assets:install --symlink FooBar
# For Windows (hard copy)
bin/roadiz themes:assets:install FooBar
Packages
BasicFirewallEntry
for front-end themesEntityListManager
order overrideNodeRepository
to really check if a nodeName exists no matter publication and security statusapcu
extension detection when no apcu_bc
is loadedExplorerProviderItemType
form component with min and max length options and a VueJS widgetcomposer.json
to prevent from downloading PHP 7.1 only vendor libraries (such as Doctrine ones).vue-draggable
packagecomposer update -o;
ALTER TABLE custom_form_fields ADD placeholder VARCHAR(255) DEFAULT NULL;
ALTER TABLE node_type_fields ADD placeholder VARCHAR(255) DEFAULT NULL;
ALTER TABLE custom_form_field_attributes CHANGE value value LONGTEXT DEFAULT NULL;
# Check if no data is deleted
bin/roadiz orm:schema-tool:update --dump-sql
# Apply migrations
bin/roadiz orm:schema-tool:update --dump-sql --force
# Empty caches
bin/roadiz cache:clear -e prod
bin/roadiz cache:clear-fpm -e prod
bin/roadiz cache:clear -e prod --preview
bin/roadiz cache:clear-fpm -e prod --preview
In order to remove Kernel
singleton disease from Doctrine entities and handlers, we chose to rebuild how entities are linked to their handlers and their repositories.
Kernel::getService
and Kernel::getInstance
static singleton methods have been removed. Kernel is now a classic instance. Make sure to update your entry points scripts to use new AppKernel
instead of AppKernel::getInstance
in the following files:
entities:
# remove previous AbstractEntities path and replace with
- vendor/roadiz/models/src/Roadiz/Core/AbstractEntities
getHandler
method on entities has been removed.
$this->get('factory.handler')->getHandler($entity)
in PHP controllers or entity|handler
Twig filter..handler
to |handler
in your Twig templates.NodesSourcesHandler::getParent()
method is deprecated. You can directly use NodesSources::getParent()
, no need to spawn a handler for that.nodeSource.handler.parent
or nodeSource|parent
to nodeSource.parent
in your Twig templates.getViewer
method on entities has been removed.
$this->get('xxxxx.viewer')
factory service in PHP controllers.document.viewer.embedFinder
is replaced by new document|embedFinder
filter.DocumentViewer::getDocumentUrlByArray
has been removed, use DocumentUrlGenerator
class instead.EntityRepository
has a new constructor signature! If you created custom Entity classes in your theme with their own repository class, you MUST adapt its constructor as we automatically inject DI container into Roadiz repositories.NodesSources
entity is now implementing Doctrine ObjectManagerAware
interface đ. We know thatâs a small gap from the usual MVC pattern but itâs needed to resolve related entities according to your translation, without sacrificing performances.getHandler
call from magic methods: bin/roadiz generate:nsentities
.DocumentFactory
constructor signature to use it from a service factory. File
and Folder
must be injected by setter, not in constructor anymore.Kernel::getService
and Kernel::getInstance
static methods have been removed.getHandler
method on entities has been removed.getViewer
method on entities has been removed.EntryPointsController
class has been removed.RolesBag
class has been removed.SettingsBag
class has been removed.Document
files methods have been removed
getAbsolutePath
getPublicAbsolutePath
getPrivateAbsolutePath
getFilesFolder
getPrivateFilesFolder
getFilesFolderName
getPrivateFilesFolderName
fileExists
getOrientation
getImageSize
getImageSizeRatio
Font
files methods have been removed
getEOTAbsolutePath
getWOFFAbsolutePath
getWOFF2AbsolutePath
getOTFAbsolutePath
getSVGAbsolutePath
getFilesFolder
getFilesFolderName
routes.yml
filesdump
messages, timeline, security and doctrine debug tools.Traits
to be able to reuse and customize them in your themes.country_iso
twig filter to display a Country name from ISO code 2-letters. No more need to implement it in your themes each time you deal with country names.Setting
and Role
bags now inherit from Symfony ParametersBag
with SQL performance improvement.NodeTypesBag
! You can access settings, roles and node-types in your Twig templates without assigning them before.Kernel
singleton from handlers methods using an AbstractHandler parent class, ready to switch to service factories.urlAliases
and node
relations eagerly during findBy
for better performances when generating URLs.clear_cache.php
environment choices.select
query creation in order to set DisMax rules from child classes.Node
and Newsletter
placeholder
field to CustomFormField
and NodeTypeField
.AuthenticationCredentialsNotFoundException
when querying nodes and node-sources in preview mode to prevent Roadiz to crash.AnonymousListener
is always before SecurityListener
.addDefaultFirewallEntry
static methodpublishedAt
date and time at nodeSource creation.publishedAt
value anyway.