[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] importing tracker fields keeping the fieldId catch the exception and continue importing
"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6891d675211bc_2cd5ca0389dc@gitlab-sidekiq-low-urgency-cpu-bound-v2-68d57f6d77-cc9mj.mail> |
Victor Emanouilov pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki
Commits:
60360aa2 by Victor Emanouilov at 2025-08-05T13:01:17+03:00
[FIX] importing tracker fields keeping the fieldId catch the exception and continue importing
- - - - -
1 changed file:
- lib/core/Services/Tracker/Utilities.php
Changes:
=====================================
lib/core/Services/Tracker/Utilities.php
=====================================
@@ -198,7 +198,16 @@ class Services_Tracker_Utilities
$definition = Tracker_Definition::get($trackerId);
//$fieldId = 0 when is a new field, e.g. when importing tracker structure
- $field = ($fieldId === 0) ? [] : $definition->getField($fieldId);
+ try {
+ $field = ($fieldId === 0) ? [] : $definition->getField($fieldId);
+ } catch (RuntimeException $e) {
+ if ($fieldId > 0) {
+ // importing tracker field keeping the fieldId
+ $field = [];
+ } else {
+ throw $e;
+ }
+ }
$trklib = TikiLib::lib('trk');
$trklib->replace_tracker_field(
$trackerId,
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/60360aa254d44df67ffe28373426cb6ca52c9d07
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/60360aa254d44df67ffe28373426cb6ca52c9d07
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