[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Webmail: warn when drafts can't be saved to tracker item, save them to...

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68ca8d66135c2_2c836b486603b@gitlab-sidekiq-low-urgency-cpu-bound-v2-5dd8cccbbd-xxmgs.mail>

Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
68301d73 by Merci Jacob at 2025-09-17T10:21:16+00:00
[FIX] Webmail: warn when drafts can't be saved to tracker item, save them to IMAP as a fallback, and prevent notice color overwriting (so success, error, & warning are not confused)
---
* [FIX] Webmail: show a warning when drafts can't be saved to tracker item, but save it to imap

See merge request tikiwiki/tiki!8589

- - - - -


2 changed files:

- lib/cypht/modules/tiki/tracker_modules.php
- themes/base_files/scss/_cypht-tiki.scss


Changes:

=====================================
lib/cypht/modules/tiki/tracker_modules.php
=====================================
@@ -386,6 +386,29 @@ class Hm_Handler_tiki_presave_draft extends Hm_Handler_Module
         }
         $path = $this->request->get['list_path'];
         if (str_contains($path, 'tracker_folder_')) {
+            $path = str_replace('tracker_folder_', '', $path);
+            list ($itemId, $fieldId) = explode('_', $path);
+
+            $trk = TikiLib::lib('trk');
+
+            $item = $trk->get_item_info($itemId);
+            if (! $item) {
+                Hm_Msgs::add('Could not save draft to tracker item because the item was not found. id: ' . $itemId, 'warning');
+                return;
+            }
+
+            $field = $trk->get_field_info($fieldId);
+            if (! $field) {
+                Hm_Msgs::add('Could not save draft to tracker item because the field was not found.', 'warning');
+                return;
+            }
+
+            $fieldHandler = Tracker_Definition::get($item['trackerId'])->getFieldFactory()->getHandler($field);
+
+            if (! $fieldHandler->getTrackerFieldInstance()->getOption('useFolders')) {
+                Hm_Msgs::add('Could not save draft to tracker item because folders are not configured for the current field.', 'warning');
+                return;
+            }
             $this->out('save_draft_to_imap', false);
         }
     }
@@ -423,6 +446,12 @@ class Hm_Handler_tiki_save_draft extends Hm_Handler_Module
             return;
         }
 
+        $fieldHandler = Tracker_Definition::get($item['trackerId'])->getFieldFactory()->getHandler($field);
+        if (! $fieldHandler->getTrackerFieldInstance()->getOption('useFolders')) {
+            Hm_Msgs::add('Configure folders for this tracker field to save drafts', 'danger');
+            return;
+        }
+
         $fileId = $this->request->get['draft_id'];
 
         $headers = $mime->get_headers();


=====================================
themes/base_files/scss/_cypht-tiki.scss
=====================================
@@ -10,7 +10,7 @@
     .hide { display: none; }
     // override colors when not using cypht default theme
     img { opacity: 1 !important; max-width: 100%; }
-    i.bi, .folders li, .inner_list li { color: var(--bs-body-color) !important; }
+    a i.bi, .menu-toggle i.bi, .folders li, .inner_list li { color: var(--bs-body-color) !important; }
     .ui-widget-content { background-color: $tiki-ui-default-bg !important; }
     .ui-menu-item-wrapper { color: var(--bs-body-color) !important; }
     .ui-state-active { color: $tiki-ui-default-link-active-color !important; }



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/68301d73d906e83834b8e71d88154b9947182b64

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/68301d73d906e83834b8e71d88154b9947182b64
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.