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

### Fixed

- Fix SQL warning when no user session is active during plugin init
- Fix error when submitting a form with an hidden question of type `Field`
- Fixed a bug where a field was deleted when at least one question in a form was linked to another field

Expand Down
2 changes: 1 addition & 1 deletion inc/questiontype.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ private function getAvailableBlocks(): array
$field_container = new PluginFieldsContainer();
$available_blocks = [];

$entity_restrict = isCommandLine() ? [] : getEntitiesRestrictCriteria(PluginFieldsContainer::getTable(), '', '', true);
$entity_restrict = (isCommandLine() || !Session::getLoginUserID()) ? [] : getEntitiesRestrictCriteria(PluginFieldsContainer::getTable(), '', '', true);
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.

Normally, you're either in CLI mode or logged in as an authenticated user. It seems to be neither, so I don't think this should be allowed, to avoid creating a security issue

$result = $field_container->find([
'is_active' => 1,
'type' => 'dom',
Expand Down