]> BookStack Code Mirror - website/blob - content/blog/bookstack-release-v22-09.md
abf7f498631241b475f6b7ca8e6d24c19841d268
[website] / content / blog / bookstack-release-v22-09.md
1 +++
2 categories = ["Releases"]
3 tags = ["Releases"]
4 title = "BookStack Release v22.09"
5 date = 2022-09-08T13:30:00Z
6 author = "Dan Brown"
7 image = "/images/blog-cover-images/sheep-mountain-luke-ellis-craven.jpg"
8 slug = "bookstack-release-v22-09"
9 draft = false
10 +++
11
12 The BookStack September release is here with a variety of desired features that build upon,
13 and enhance, existing BookStack systems. As usual, it also includes language updates
14 and a bunch of tweaks & fixes.
15
16 TODO - Update/remove video link
17
18 * [Release video overview](https://youtu.be/m0iCq2MFynI)
19 * [Update instructions](https://www.bookstackapp.com/docs/admin/updates)
20 * [GitHub release page](https://github.com/BookStackApp/BookStack/releases/tag/v22.09)
21
22
23 **Upgrade Notices**
24
25 - **Security** - This release cycle contained a security release that added detail that's important to consider when BookStack content is used externally. See the [v22.07.3 post](/blog/bookstack-release-v22-07-3/) for more detail.
26 - **Revision Visibility** - This update fixes a permission disparity with revisions. Revision content has always been accessible to those with page-view permissions, but the links to the revisions list previously required page-edit permission to show. This has been aligned, which may mean page revision links may now show to those that did not previously see them.
27 - **Revision Limit Change** - The default, per-page, revision limit has been doubled from 50 to 100, to account for new system-content updates that may occur. If desired, you can [configure this to a custom value](/docs/admin/other-config/#revision-limit).
28 - **Reference Index** - New features have been added to track links between content in BookStack, which uses an internal reference index. Upon upgrade from an older BookStack version, this index will need to be rebuilt. This can be done with the ["Regenerate References" command](/docs/admin/commands/#regenerate-reference-index) or via the "Regenerate References" maintenance action within BookStack.
29
30 ### Page Content References
31
32 When you edit and save pages within the system, BookStack will now attempt to identify links 
33 to other pages, chapters, books and shelves in the system.
34 A new item will show when viewing one of those items, reflecting a count of pages that link
35 to the currently viewed item:
36
37 ![Text within a "Details" section showing "Referenced on 3 pages"](/images/2022/09/references_link.png)
38
39 When clicked, this will take you to a new references view which lists the all pages
40 leading to the this current item:
41
42 ![Screenshot of a "Reference" view with a list of page items](/images/2022/09/references_view.png)
43
44 This new feature should help provide some insight to how content is interlinked within the system, 
45 while also providing an indexed that we can use within BookStack's systems to make some operating more efficient.
46
47 When upgrading an existing BookStack instance no references will be indexed until you start saving content.
48 To index and detect existing cross-content links, you can use the new "Regenerate References"
49 admin maintenance action:
50
51 ![A card within the interface showing a "Regenerate References" section and action button](/images/2022/09/regen_references_action.png)
52
53 Alternatively, this action has also been added as a terminal command which 
54 you can [find in our documentation here](/docs/admin/commands/#regenerate-reference-index).
55
56 ### Auto Link Updating
57
58 Making use of our new reference indexing system, as detailed above, BookStack will now
59 auto-update internal page links to shelves, books, chapter and other pages when those 
60 items experience a change in URL.
61
62 BookStack already had a system to handle some changes, it would attempt to find pages using 
63 their old URLs by looking up against page revisions, but this would not work for books, chapters & shelves
64 or for pages if revisions were deleted.
65 Now, upon changes to an item's URL, BookStack will lookup pages referencing that item and auto-update
66 such links to be current. This will be done in a fully transparent manner, with a revision
67 being logged for the change with a "System auto-update of internal links" changelog message.
68 To support this addition, the default per-page revision limit has increased from 50 to 100 entries.
69
70 There may still be some logical gaps that will produce old links, such as restoring old page revision, 
71 but this should handle most costs to ensure internal links stay current.
72
73 ### OIDC Group Sync Support
74
75 OIDC authentication was added to BookStack almost a year ago, as part of v21.10.
76 Since then I've been [taking feedback](https://github.com/BookStackApp/BookStack/issues/3004)
77 to understand how group syncing would operate. Within v22.09 we're putting that feedback
78 into action with the addition of OIDC group sync support.
79
80 To work with BookStack, your OIDC system will need to provide groups within the OIDC ID token
81 it provides back to BookStack. To support this in BookStack, we've added options to
82 define custom authentication request scopes (Needed for groups in some scenarios)
83 while also supporting accessing nested properties in the ID token JSON data.
84
85 Read the new ["Group Sync" section](/docs/admin/oidc-auth/#group-sync) of our OIDC documentation for more details.
86
87 ### New "Local (Secure - Restricted)" Image Storage Option
88
89 A long while ago we added a `local_secure` storage option for images which required user login
90 before serving an image, as a layer of access control.
91 This release takes this further with a `local_secure_restricted` storage option which
92 will check the user's permissions to access the item that an image was uploaded to.
93 This means that image file access for page images can be controlled by the page they're uploaded to, providing
94 a whole new layer of control for environments that need it.
95
96 This new option does have some caveats, mainly that it can introduce various logical scenarios
97 that cause image visibility anomalies, in cases where an images are re-used across different permissions contexts.
98
99 Full details of this permission option can be found [in our docs here](/docs/admin/upload-config/#local-secure---restricted).
100
101 ### "Page Include Parse" Logical Theme Event
102
103 Our [logical theme system](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/logical-theme-system.md)
104 has received a new event to customise handling of the [page include system](/docs/user/reusing-page-content).
105 The page include system allows dynamic import of page content into the body of a page.
106 Using this event, you can now extensively customize the handling of page includes.
107
108 As an example, the below `functions.php` code would replace "dog" with "cat" in included content:
109
110 ```php
111 <?php
112
113 use BookStack\Entities\Models\Page;
114 use BookStack\Facades\Theme;
115 use BookStack\Theming\ThemeEvents;
116
117 Theme::listen(ThemeEvents::PAGE_INCLUDE_PARSE, function(string $tagReference, string $replacementHTML, Page $currentPage, ?Page $referencedPage) {
118     return str_replace('dog', 'cat', $replacementHTML);
119 });
120 ```
121
122 Of course there are much more practical examples for this, such as defining fallback content or adding extra permission control.
123
124 Find the details of the event [in the source code here](https://github.com/BookStackApp/BookStack/blob/98aed794cc7272687720c4f4c42a4f540390c0af/app/Theming/ThemeEvents.php#L73-L86).
125
126 ### Visual Theme System - Export Template Partials
127
128 As part of v22.07.2 we added a couple of export-specific template files
129 that could be used with the [visual theme system](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/visual-theme-system.md), found at:
130
131 - `layouts/parts/export-body-start.blade.php`
132 - `layouts/parts/export-body-end.blade.php`
133
134 These can be used to add custom HTML code to the start & end of the HTML content used for
135 HTML and PDF exports within BookStack.
136
137 As a usage example I published a video on the BookStack YouTube channel showing 
138 how to leverage these new templates to add a custom header and footer
139 to PDF exports:
140
141 {{< yt 5bZ7zlNEphc >}}
142
143 ### Translations
144
145 This release of BookStack adds Romanian as an available language. 
146 A massive thanks to Mihai Ochian (soulstorm19) on Crowdin for their amazing effort
147 of translating of 6k words in this release cycle to add this language.
148
149 As usual, a range of our existing languages have received updates from our terrific translators
150 since v22.07, so a big thanks to all listed below:
151
152 TODO - language list
153
154 - User - *Language*
155
156 ### Next Steps
157
158 For the next release cycle I'll probably re-focus back on the permission system, to start
159 development of the features intended on the related road-map item, such as an overhaul of
160 item-level permission management to be more intuitive.
161
162 We're approaching a milestone of 10k GitHub stars so there may be a minor detour to 
163 celebrate that little achievement. 
164
165 ### Full List of Changes
166
167 **Released in v22.09**
168
169 * Added cross-item link reference tracking & updating. ([#3656](https://github.com/BookStackApp/BookStack/pull/3656), [#3683](https://github.com/BookStackApp/BookStack/issues/3683), [#1969](https://github.com/BookStackApp/BookStack/issues/1969))
170 * Added OIDC group sync functionality. ([#3616](https://github.com/BookStackApp/BookStack/pull/3616), [#3004](https://github.com/BookStackApp/BookStack/issues/3004))
171 * Added reference view to shelves, chapters, books & pages. ([#2864](https://github.com/BookStackApp/BookStack/issues/2864))
172 * Added new `local_secure_restricted` image storage option. ([#3693](https://github.com/BookStackApp/BookStack/pull/3693))
173 * Added "page_include_parse" theme event. ([#3698](https://github.com/BookStackApp/BookStack/pull/3698))
174 * Updated API docs to add detail for the request format. ([#3652](https://github.com/BookStackApp/BookStack/issues/3652))
175 * Updated revision link visibility to show to users. ([#2946](https://github.com/BookStackApp/BookStack/issues/2946))
176 * Updated shelf naming to be consistent across system. ([#3553](https://github.com/BookStackApp/BookStack/issues/3553))
177 * Updated translations with latest Crowdin changes. ([#3643](https://github.com/BookStackApp/BookStack/pull/3643), [#3701](https://github.com/BookStackApp/BookStack/pull/3701))
178 * Updated role edit/create form with clarification upon image access permissions. ([#3688](https://github.com/BookStackApp/BookStack/issues/3688))
179 * Fixed dates not using the correct encoding on some systems. ([#3590](https://github.com/BookStackApp/BookStack/issues/3590))
180 * Fixed image delete button showing to those without permission to delete. ([#3697](https://github.com/BookStackApp/BookStack/issues/3697))
181 * Fixed incorrect comment counts on Chinese language options. ([#3554](https://github.com/BookStackApp/BookStack/issues/3554))
182 * Fixed list indentation when next to floated images. ([#3672](https://github.com/BookStackApp/BookStack/issues/3672))
183 * Fixed various RTL text interface issues. ([#3702](https://github.com/BookStackApp/BookStack/issues/3702))
184 * Fixed WYSIWYG drawing update not triggering draft save. ([#3682](https://github.com/BookStackApp/BookStack/issues/3682))
185 * Fixed some additional SVG-based script cases not being filtered. ([#3705](https://github.com/BookStackApp/BookStack/issues/3705))
186
187 **Released in v22.07.3**
188
189 * Added API documentation section to advise of content security. ([#3636](https://github.com/BookStackApp/BookStack/issues/3636))
190 * Updated Persian translations. Thanks to [@samadha56](https://github.com/BookStackApp/BookStack/pull/3639). ([#3639](https://github.com/BookStackApp/BookStack/pull/3639))
191 * Updated code block rendering to help prevent blank blocks on fresh cache. ([#3637](https://github.com/BookStackApp/BookStack/issues/3637))
192 * Updated HTML filtering to prevent SVG animate case. ([#3636](https://github.com/BookStackApp/BookStack/issues/3636))
193 * Updated translations with latest changes from Crowdin. ([#3635](https://github.com/BookStackApp/BookStack/pull/3635))
194 * Updated revision list view to help prevent system memory exhaustion. ([#3633](https://github.com/BookStackApp/BookStack/issues/3633))
195 * Fixed issue with permission checking prevent certain actions where permission should have allowed. ([#3632](https://github.com/BookStackApp/BookStack/pull/3632))
196
197 **Released in v22.07.2**
198
199 * Added body-start/end partials to export template, for easier export customization via the visual theme system. ([#3630](https://github.com/BookStackApp/BookStack/pull/3630))
200 * Added activity recording for revision delete/restore. ([#3628](https://github.com/BookStackApp/BookStack/issues/3628))
201 * Updated translations with latest changes from Crowdin. ([#3625](https://github.com/BookStackApp/BookStack/pull/3625))
202 * Updated user validation with sensible limit to name input. ([#3614](https://github.com/BookStackApp/BookStack/issues/3614))
203 * Fixed issue where activity type could not be selected in the audit log. ([#3623](https://github.com/BookStackApp/BookStack/issues/3623))
204 * Fixed possibility of breaking page load due to bad user language input. ([#3615](https://github.com/BookStackApp/BookStack/issues/3615))
205
206 **Released in v22.07.1**
207
208 * Fixed issue where old WYSIWYG editor code would be cached, preventing the editor from showing. ([#3611](https://github.com/BookStackApp/BookStack/issues/3611))
209 * Updated translations with latest Crowdin changes. ([#3605](https://github.com/BookStackApp/BookStack/pull/3605))
210
211 ----
212
213 <span style="font-size: 0.8em;opacity:0.9;">Header Image Credits: <span>Photo by <a href="https://unsplash.com/@lukeelliscraven?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Luke Ellis-Craven</a> on <a href="https://unsplash.com/s/photos/sheep?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a></span></span>