NOW MANAGED ON CODEBERG
Comment Mentions: Fixed and tweaks during review of changes
Dan Brown51f9b63db0b9
diff --git a/app/Config/database.php b/app/Config/database.phpindex 5edafa777..86bae5f5b 100644--- a/app/Config/database.php+++ b/app/Config/database.php@@ -81,7 +81,7 @@ return ['strict' => false,'engine' => null,'options' => extension_loaded('pdo_mysql') ? array_filter([- PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),+ (PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),]) : [],],diff --git a/database/migrations/2025_12_15_140219_create_mention_history_table.php b/database/migrations/2025_12_15_140219_create_mention_history_table.phpindex 2ab522dd8..ff7b6a981 100644--- a/database/migrations/2025_12_15_140219_create_mention_history_table.php+++ b/database/migrations/2025_12_15_140219_create_mention_history_table.php@@ -15,7 +15,7 @@ return new class extends Migration$table->increments('id');$table->string('mentionable_type', 50)->index();$table->unsignedBigInteger('mentionable_id')->index();- $table->unsignedInteger('from_user_id')->index();+ $table->unsignedInteger('from_user_id');$table->unsignedInteger('to_user_id');$table->timestamps();});diff --git a/lang/en/settings.php b/lang/en/settings.phpindex 1b5f9ce14..c68605fe1 100644--- a/lang/en/settings.php+++ b/lang/en/settings.php@@ -197,11 +197,13 @@ return ['role_import_content' => 'Import content','role_editor_change' => 'Change page editor','role_notifications' => 'Receive & manage notifications',+ 'role_permission_note_users_and_roles' => 'These permissions will technically also provide visibility & searching of users & roles in the system.','role_asset' => 'Asset Permissions','roles_system_warning' => 'Be aware that access to any of the above three permissions can allow a user to alter their own privileges or the privileges of others in the system. Only assign roles with these permissions to trusted users.','role_asset_desc' => 'These permissions control default access to the assets within the system. Permissions on Books, Chapters and Pages will override these permissions.','role_asset_admins' => 'Admins are automatically given access to all content but these options may show or hide UI options.','role_asset_image_view_note' => 'This relates to visibility within the image manager. Actual access of uploaded image files will be dependant upon system image storage option.',+ 'role_asset_users_note' => 'These permissions will technically also provide visibility & searching of users in the system.','role_all' => 'All','role_own' => 'Own','role_controlled_by_asset' => 'Controlled by the asset they are uploaded to',diff --git a/resources/views/settings/roles/parts/form.blade.php b/resources/views/settings/roles/parts/form.blade.phpindex a77b80e4c..5a9eca7d2 100644--- a/resources/views/settings/roles/parts/form.blade.php+++ b/resources/views/settings/roles/parts/form.blade.php@@ -30,10 +30,10 @@<label class="setting-list-label">{{ trans('settings.role_system') }}</label><a href="#" refs="permissions-table@toggle-all" class="text-small text-link">{{ trans('common.toggle_all') }}</a>- <div class="toggle-switch-list grid half mt-m">+ <div class="toggle-switch-list grid half my-m"><div>- <div>@include('settings.roles.parts.checkbox', ['permission' => 'restrictions-manage-all', 'label' => trans('settings.role_manage_entity_permissions')])</div>- <div>@include('settings.roles.parts.checkbox', ['permission' => 'restrictions-manage-own', 'label' => trans('settings.role_manage_own_entity_permissions')])</div>+ <div>@include('settings.roles.parts.checkbox', ['permission' => 'restrictions-manage-all', 'label' => trans('settings.role_manage_entity_permissions')]) <sup>1</sup></div>+ <div>@include('settings.roles.parts.checkbox', ['permission' => 'restrictions-manage-own', 'label' => trans('settings.role_manage_own_entity_permissions')]) <sup>1</sup></div><div>@include('settings.roles.parts.checkbox', ['permission' => 'templates-manage', 'label' => trans('settings.role_manage_page_templates')])</div><div>@include('settings.roles.parts.checkbox', ['permission' => 'access-api', 'label' => trans('settings.role_access_api')])</div><div>@include('settings.roles.parts.checkbox', ['permission' => 'content-export', 'label' => trans('settings.role_export_content')])</div>@@ -48,6 +48,10 @@<p class="text-warn text-small mt-s mb-none">{{ trans('settings.roles_system_warning') }}</p></div></div>++ <p class="mb-none text-small text-muted">+ <sup>1</sup> {{ trans('settings.role_permission_note_users_and_roles') }}+ </p></div><div>@@ -75,7 +79,7 @@@include('settings.roles.parts.asset-permissions-row', ['title' => trans('entities.books'), 'permissionPrefix' => 'book'])@include('settings.roles.parts.asset-permissions-row', ['title' => trans('entities.chapters'), 'permissionPrefix' => 'chapter'])@include('settings.roles.parts.asset-permissions-row', ['title' => trans('entities.pages'), 'permissionPrefix' => 'page'])- @include('settings.roles.parts.related-asset-permissions-row', ['title' => trans('entities.images'), 'permissionPrefix' => 'image', 'refMark' => '1'])+ @include('settings.roles.parts.related-asset-permissions-row', ['title' => trans('entities.images'), 'permissionPrefix' => 'image'])@include('settings.roles.parts.related-asset-permissions-row', ['title' => trans('entities.attachments'), 'permissionPrefix' => 'attachment'])@include('settings.roles.parts.related-asset-permissions-row', ['title' => trans('entities.comments'), 'permissionPrefix' => 'comment'])</div>@@ -83,6 +87,8 @@<div><p class="text-muted text-small p-m"><sup>1</sup> {{ trans('settings.role_asset_image_view_note') }}+ <br>+ <sup>2</sup> {{ trans('settings.role_asset_users_note') }}</p></div></div>diff --git a/resources/views/settings/roles/parts/related-asset-permissions-row.blade.php b/resources/views/settings/roles/parts/related-asset-permissions-row.blade.phpindex 62fdd6b74..b9bf5427f 100644--- a/resources/views/settings/roles/parts/related-asset-permissions-row.blade.php+++ b/resources/views/settings/roles/parts/related-asset-permissions-row.blade.php@@ -6,16 +6,19 @@<div class="flex py-s px-m min-width-xxs"><small class="hide-over-m bold">{{ trans('common.create') }}<br></small>@include('settings.roles.parts.checkbox', ['permission' => $permissionPrefix . '-create-all', 'label' => ''])+ @if($permissionPrefix === 'comment')<sup class="text-muted">2</sup>@endif</div><div class="flex py-s px-m min-width-xxs"><small class="hide-over-m bold">{{ trans('common.view') }}<br></small>- <small class="faded">{{ trans('settings.role_controlled_by_asset') }}@if($refMark ?? false)<sup>{{ $refMark }}</sup>@endif</small>+ <small class="faded">{{ trans('settings.role_controlled_by_asset') }}@if($permissionPrefix === 'image')<sup class="text-muted">1</sup>@endif</small></div><div class="flex py-s px-m min-width-xxs"><small class="hide-over-m bold">{{ trans('common.edit') }}<br></small>@include('settings.roles.parts.checkbox', ['permission' => $permissionPrefix . '-update-own', 'label' => trans('settings.role_own')])+ @if($permissionPrefix === 'comment')<sup class="text-muted">2</sup>@endif<br>@include('settings.roles.parts.checkbox', ['permission' => $permissionPrefix . '-update-all', 'label' => trans('settings.role_all')])+ @if($permissionPrefix === 'comment')<sup class="text-muted">2</sup>@endif</div><div class="flex py-s px-m min-width-xxs"><small class="hide-over-m bold">{{ trans('common.delete') }}<br></small>diff --git a/tests/Activity/CommentDisplayTest.php b/tests/Activity/CommentDisplayTest.phpindex 01a4643be..798ea16ee 100644--- a/tests/Activity/CommentDisplayTest.php+++ b/tests/Activity/CommentDisplayTest.php@@ -1,6 +1,6 @@<?php-namespace Activity;+namespace Tests\Activity;use BookStack\Activity\Models\Comment;use Tests\TestCase;