Skip to content

Commit

Permalink
fix filter for formula-sensitive-titles (ILIAS-eLearning#8758) (ILIAS…
Browse files Browse the repository at this point in the history
  • Loading branch information
iszmais authored Dec 19, 2024
1 parent fcabfed commit 38e8d54
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

declare(strict_types=1);

use ILIAS\Modules\DataCollection\Fields\Formula\FormulaParser\Token\Tokenizer;

use ILIAS\Modules\DataCollection\Fields\Formula\FormulaParser\Math\Functions;
use ILIAS\Modules\DataCollection\Fields\Formula\FormulaParser\Math\Operators;

class ilDclTable
{
Expand Down Expand Up @@ -530,7 +532,11 @@ public function getFirstTableViewId(int $ref_id, int $user_id = 0, bool $with_de
*/
public function getFieldsForFormula(): array
{
$syntax_chars = array_merge(Tokenizer::$operators, Tokenizer::$functions, ['(', ')', ',']);
$syntax_chars = array_merge(
array_map(static fn(Operators $function): string => $function->value, Operators::cases()),
array_map(static fn(Functions $function): string => $function->value, Functions::cases()),
['(', ')', ',']
);
foreach ($this->getFields() as $field) {
if (in_array($field->getDatatypeId(), ilDclFormulaFieldModel::SUPPORTED_FIELDS)) {
foreach ($syntax_chars as $element) {
Expand Down

0 comments on commit 38e8d54

Please sign in to comment.