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 text area fields alignment
- 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
10 changes: 10 additions & 0 deletions inc/questiontype.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,16 @@ private function getAvailableBlocks(): array
$available_blocks = [];

$entity_restrict = isCommandLine() ? [] : getEntitiesRestrictCriteria(PluginFieldsContainer::getTable(), '', '', true);

// If entity restriction contains an empty string value, it means no valid session
// is active. Running the query would produce a MySQL
// warning (1292: Truncated incorrect DECIMAL value)
foreach ($entity_restrict as $criterion) {
if (is_array($criterion) && in_array('', $criterion, true)) {
return $available_blocks;
}
}

Comment thread
RomainLvr marked this conversation as resolved.
$result = $field_container->find([
'is_active' => 1,
'type' => 'dom',
Expand Down