Skip to content

Change config UI#8

Open
Lainow wants to merge 7 commits into
mainfrom
change-config-ui
Open

Change config UI#8
Lainow wants to merge 7 commits into
mainfrom
change-config-ui

Conversation

@Lainow

@Lainow Lainow commented May 27, 2026

Copy link
Copy Markdown
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes # (issue number, if applicable)
  • Here is a brief description of what this PR does

Change to the configuration interface (switch from checkboxes to “Yes”/‘No’ options with the “Inheritance” option)

Screenshots (if appropriate):

image image

@Lainow Lainow requested a review from stonebuzz May 27, 2026 14:46
@Lainow Lainow self-assigned this May 27, 2026

@Rom1-B Rom1-B left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix CI

@Lainow Lainow requested a review from Rom1-B June 4, 2026 07:51
Comment thread src/Config.php
$migration->displayMessage("Installing $table");
$query = "CREATE TABLE IF NOT EXISTS `$table` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`is_active` tinyint NOT NULL DEFAULT '1',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should drop this column if table already exist

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plugin hasn't been released yet

Comment thread src/Config.php
`mandatory_task_group` tinyint NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `entities_id` (`entities_id`),
KEY `is_active` (`is_active`)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should drop this column if table already exist

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as is_active : the plugin hasn't been released yet

Comment thread src/Config.php
Comment thread tests/Units/ConfigTest.php
Comment thread src/Config.php
Comment on lines +198 to +203
'take_requester_group_ticket',
'take_requester_group_change',
'take_requester_group_problem',
'take_technician_group_ticket',
'take_technician_group_change',
'take_technician_group_problem',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be replaced by getActorGroupConfigFields

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test case where the child entity fields are set to Config::CONFIG_PARENT, verify that the inherited value from the parent propagates to Controller::checkTaskRequirements, and assert both the blocked (empty mandatory fields) and unblocked (filled mandatory fields) outcomes?

Comment thread src/Config.php
return self::getConfig($parentId, true);
$parentConfig = self::getConfig((int) $entity->fields['entities_id'], true);
$allFields = array_merge(
self::getItilConfigFields(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getConfig() merges getActorGroupConfigFields() into the CONFIG_PARENT resolution loop, but no code path ever stores CONFIG_PARENT in an actor group field: addConfig() (line 249) and install() (line 371) only set CONFIG_PARENT for getItilConfigFields() fields, and the UI dropdown getSelectableActorGroup() only exposes 0/1/2. The getActorGroupConfigFields() branch inside the resolution loop is therefore unreachable. Either remove getActorGroupConfigFields() from the merge or add CONFIG_PARENT as a selectable option in the dropdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants