Sulu Release 1.6.31 & 2.0.4
With Sulu 1.6.31 and 2.0.4 we have fixed quite a few bugs, especially in Sulu 2. In version 2 we have also added a lot of functionality that allows users to disable certain functionality in the administration interface. This is especially useful if some users are missing certain permissions and you want to show that in the administration interface.
Since most of the changes only affect one of both releases, this blog post will be split into a Sulu 1.6 part and an Sulu 2.0 part.
Fixing old bugs in Sulu 1.6
In Sulu 1.6 the content type for snippets was listing all available snippets when trying to assign them. This was very problematic since it caused the system to stall if many snippets are stored. For this reason we have included a pagination in this content type. Note that this was not happening in Sulu 2.0.
The second bug fixed in our LTS version was that our teaser selection did not show more than ten elements when using ElasticSearch, even if more than ten elements were assigned. This bug was caused by the default limit of ElasticSearch and also affected Sulu 2.0.
Better permission handling in Sulu 2.0
While working on a project, we realized that we need a lot more options to disable certain functionality. In Sulu 1.6 that was not really a problem, since every module of the system implemented their own forms and lists, and therefore offered a lot more extension points. The downside was that also lots of code was duplicated.
We have also realized that some of this functionality was missing in the core product as well, and its absence was harming the user experience. In many cases it was possible to click some buttons, but the user retrieved an error. The system feels much nicer now because such errors are prevented earlier by showing the user that the click is not possible.
Therefore we decided to add this functionality in a patch release. Doing so allowed us to fix a few annoyances from a user perspective:
- Disable add, delete and edit buttons in media collections generated by the system because these operations are not possible on them
- Disable the delete button in the toolbar of a list if no delete permission is granted
- Disable the template and type chooser in the form if no edit permission is granted
- Show a hint that permissions are missing in forms instead of crashing the UI
While we were at it, we also added similar functionality where it made sense:
- Allow to pass an item_disabled_condition to Selection and SingleSelection field types
- Allow to pass an itemDisabledCondition using jexl to the List view
- Allow to add more query parameters to requests sent by the Selection field type using the request_parameters and resource_store_properties_to_request parameters
In addition to that we also deprecated the display_condition of some toolbar actions, and introduced a new visible_condition instead. It practically does the same as the deprecated parameter, but it is more consistent since throughout the rest of the system where we more often used visible_condition.
Other changes affecting the UI
There are quite a few changes apart from the previously mentioned ones regarding permission handling, which also have an impact on the UI.
- A default sorting which represents the order of pages in the page tree has been added to the SmartContent (again).
- Many clicks within a short amount of time on pagination buttons in a list could lead to strange behavior, because requests might finish in a different order as they have been sent, which was fixed by cancelling requests when a new one is sent
- Show a conflict message when a references snippet is attempted to be deleted
- Fix overflown elements in form blocks
- Fix bug which crashed loading of a smart content with set properties parameter
- The SingleContactSelection triggered the save button after its content has been loaded
Changes improving the developer experience
Faithful to our concept of great user experience meets great developer experience, we have also improved the developer experience of Sulu. This includes the following improvements:
- Replace the host placeholder in a more generic place, so that no other code has to deal with them
- The scheme parameter in the sulu_content_path twig function is now optional, and taken from the current request if not given
- The Admin classes can now implement a getPriority function, which allows the Admin to decide on the execution order, which is useful if one Admin relies on another one (this works exactly like the priorities for event subscribers in Symfony)
- Fixed a Symfony regression affecting our TestUserProvider
- Make the sulu:admin:download-build command work on Windows
- Improve the output and usage of the sulu:admin:download-language command (mind the updated documentation)
- The system will fail sooner with a clearer error message if a reserved keyword is used in a page XML template
- All fields in the media form can now be completely deleted, previously some fields kept their old value in that case