Skip to content
Merged
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 @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Fix prevent failure when attempting to delete an actor
- Fix form `path` for `tab` `container`
- Fix error during Forms migration when block is not on root entity

## [1.23.1] - 2025-11-20

Expand Down
4 changes: 3 additions & 1 deletion inc/questiontype.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ private function getAvailableBlocks(): array
{
$field_container = new PluginFieldsContainer();
$available_blocks = [];

$entity_restrict = isCommandLine() ? [] : getEntitiesRestrictCriteria(PluginFieldsContainer::getTable(), '', '', true);
$result = $field_container->find([
'is_active' => 1,
'type' => 'dom',
Expand All @@ -335,7 +337,7 @@ private function getAvailableBlocks(): array
['itemtypes' => ['LIKE', '%\"Change\"%']],
['itemtypes' => ['LIKE', '%\"Problem\"%']],
],
] + getEntitiesRestrictCriteria(PluginFieldsContainer::getTable(), '', '', true), 'name');
] + $entity_restrict, 'name');
foreach ($result as $id => $data) {
$available_blocks[$id] = $data['label'];
}
Expand Down
21 changes: 21 additions & 0 deletions tests/fixtures/formcreator.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@
-- -------------------------------------------------------------------------
--

DROP TABLE IF EXISTS `glpi_plugin_formcreator_formanswers`;
CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_formanswers` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`entities_id` int unsigned NOT NULL DEFAULT '0',
`is_recursive` tinyint(1) NOT NULL DEFAULT '0',
`plugin_formcreator_forms_id` int unsigned NOT NULL DEFAULT '0',
`requester_id` int unsigned NOT NULL DEFAULT '0',
`users_id_validator` int unsigned NOT NULL DEFAULT '0' COMMENT 'User in charge of validation',
`groups_id_validator` int unsigned NOT NULL DEFAULT '0' COMMENT 'Group in charge of validation',
`request_date` timestamp NULL,
`status` int(11) NOT NULL DEFAULT '101',
`comment` mediumtext,
PRIMARY KEY (`id`),
INDEX `plugin_formcreator_forms_id` (`plugin_formcreator_forms_id`),
INDEX `entities_id_is_recursive` (`entities_id`, `is_recursive`),
INDEX `requester_id` (`requester_id`),
INDEX `users_id_validator` (`users_id_validator`),
INDEX `groups_id_validator` (`groups_id_validator`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

DROP TABLE IF EXISTS `glpi_plugin_formcreator_categories`;
CREATE TABLE `glpi_plugin_formcreator_categories` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
Expand Down