Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed

- Fix the uploaded file name being lost after the client injection upload step
- Fix models using `Fields` plugin containers being hidden and their values not injected with `Fields` >= 1.24.7

## [2.15.12] - 2026-10-05

Expand Down
4 changes: 3 additions & 1 deletion inc/commoninjectionlib.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,9 @@ private function effectiveAddOrUpdate($injectionClass, $item, $values, $add = tr

//The plugin acts as the front controller here: rights must be checked before writing.
//Skipped without a session, as the lib is also a programmatic entry point for scripts.
if (Session::getLoginUserID() !== false) {
//Fields >= 1.24.7 containers always deny rights: their values are written
//as part of the parent item, whose rights have already been checked
if (Session::getLoginUserID() !== false && !is_a($item, 'PluginFieldsAbstractContainerInstance')) {
$input = is_array($values) ? $values : [];
if ($add) {
//Passing the input to can() makes the check cover the target entity
Expand Down
6 changes: 5 additions & 1 deletion inc/model.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,11 @@ public static function checkRightOnModel(int $models_id): bool
if ($itemtype == PluginDatainjectionInjectionType::NO_VALUE || !is_a($itemtype, CommonDBTM::class, true)) {
continue;
}

// Fields >= 1.24.7: container classes always deny canCreate()/canUpdate(),
// their values are written through the parent item, whose rights are checked instead
if (is_a($itemtype, 'PluginFieldsAbstractContainerInstance', true)) {
continue;
}
$item = new $itemtype();
if ($check_add && !$item->canCreate()) {
return false;
Expand Down
Loading