From 20ecbeb09cdf05ca3ffd44980e9070b34c2b71ec Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 14 Oct 2025 11:01:23 +0200 Subject: Fix drag&drop of user query losing information (#8113) * Fix drag&drop of user query losing information Information about RSS sharing was lost after a drag&drop * Fix related type cast --- app/Controllers/configureController.php | 7 ++++++- app/Models/UserConfiguration.php | 3 ++- app/views/configure/queries.phtml | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index bcda947ff..aedb7a2e6 100644 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -346,7 +346,8 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_View::appendScript(Minz_Url::display('/scripts/draggable.js?' . @filemtime(PUBLIC_PATH . '/scripts/draggable.js'))); if (Minz_Request::isPost()) { - /** @var array $params */ + /** @var array $params */ $params = Minz_Request::paramArray('queries'); $queries = []; @@ -358,6 +359,10 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { if (!empty($query['search'])) { $query['search'] = urldecode($query['search']); } + $shareRss = $query['shareRss'] ?? null; + $query['shareRss'] = (is_string($shareRss) && ctype_digit($shareRss)) ? (bool)$shareRss : false; + $shareOpml = $query['shareOpml'] ?? null; + $query['shareOpml'] = (is_string($shareOpml) && ctype_digit($shareOpml)) ? (bool)$shareOpml : false; $queries[$key] = (new FreshRSS_UserQuery($query, FreshRSS_Context::categories(), FreshRSS_Context::labels()))->toArray(); } FreshRSS_Context::userConf()->queries = $queries; diff --git a/app/Models/UserConfiguration.php b/app/Models/UserConfiguration.php index 2cb11bbe4..88263e1ad 100644 --- a/app/Models/UserConfiguration.php +++ b/app/Models/UserConfiguration.php @@ -44,7 +44,8 @@ declare(strict_types=1); * @property bool $onread_jump_next * @property string $passwordHash * @property int $posts_per_page - * @property array $queries + * @property array $queries * @property bool $reading_confirm * @property int $since_hours_posts_per_rss * @property bool $show_fav_unread diff --git a/app/views/configure/queries.phtml b/app/views/configure/queries.phtml index 1e925d19c..bd1e0b370 100644 --- a/app/views/configure/queries.phtml +++ b/app/views/configure/queries.phtml @@ -21,8 +21,8 @@

getName() ?>

- - + + -- cgit v1.2.3