[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] ItemsList: deal with empty field selection in link field id option
"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a73218f61b8_3819f1cc5419c@gitlab-sidekiq-low-urgency-cpu-bound-v2-6c9c76fb4f-hjfpz.mail> |
Victor Emanouilov pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki
Commits:
e6bd2a3f by Victor Emanouilov at 2026-08-05T14:41:59+03:00
[FIX] ItemsList: deal with empty field selection in link field id option
---
* [FIX] ItemsList: deal with empty field selection in link field id option
See merge request tikiwiki/tiki!10844
- - - - -
1 changed file:
- lib/core/Tracker/Field/ItemsList.php
Changes:
=====================================
lib/core/Tracker/Field/ItemsList.php
=====================================
@@ -277,7 +277,10 @@ $("input[name=ins_' . $this->getOption('fieldIdHere') . '], select[name=ins_' .
}
if ($this->getOption('editable') && $editmode) {
$trackerThere = Tracker_Definition::get($this->getOption('trackerId'));
- $fieldThere = $trackerThere->getField($this->getOption('fieldIdThere'));
+ if ($this->getOption('fieldIdThere')) {
+ $fieldThere = $trackerThere->getField($this->getOption('fieldIdThere'));
+ $data['otherFieldPermName'] = $fieldThere['permName'];
+ }
// trackerPerms overide field Options
$trackerPerms = Perms::get('tracker', $this->getOption('trackerId'));
$canCreate = $trackerPerms->create_tracker_items; // tracker/global permission; However canEdit and canRemove are Item permissions, see below
@@ -289,7 +292,6 @@ $("input[name=ins_' . $this->getOption('fieldIdHere') . '], select[name=ins_' .
}
$data['itemPermissions'] = $itemPermissions;
$data['addItemText'] = $canCreate ? $this->getOption('addItemText') : '';
- $data['otherFieldPermName'] = $fieldThere['permName'];
if (empty($this->getOption('fieldIdHere'))) {
$data['parentItemId'] = $this->getItemId();
} else {
@@ -447,17 +449,18 @@ $("input[name=ins_' . $this->getOption('fieldIdHere') . '], select[name=ins_' .
$fieldIdThere = $this->getOption('fieldIdThere');
$trackerIdThere = $this->getOption('trackerId');
$trackerThere = Tracker_Definition::get($trackerIdThere);
- $fieldThere = $trackerThere->getField($fieldIdThere);
- if ($fieldThere) {
- $queryFieldName = "tracker_field_{$fieldThere['permName']}";
- if ($fieldHere['type'] === 'r' && $fieldThere['type'] !== 'r') {
- $extraFieldName .= '_text';
+ if ($fieldIdThere) {
+ $fieldThere = $trackerThere->getField($fieldIdThere);
+ if ($fieldThere) {
+ $queryFieldName = "tracker_field_{$fieldThere['permName']}";
+ if ($fieldHere['type'] === 'r' && $fieldThere['type'] !== 'r') {
+ $extraFieldName .= '_text';
+ }
+ } else {
+ $queryFieldName = '';
}
- } else {
- $queryFieldName = '';
}
-
// cache the other tracker's items to test when importing
$itemsThereLookup = new Tracker\Tabular\Schema\CachedLookupHelper();
$tiki_tracker_items = TikiDb::get()->table('tiki_tracker_items');
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/e6bd2a3f04ba93782e0dee13f5229533f20a878a
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/e6bd2a3f04ba93782e0dee13f5229533f20a878a
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs