Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text - Dynamic Fields #4

Open
fabbaum opened this issue Sep 1, 2024 · 1 comment
Open

Text - Dynamic Fields #4

fabbaum opened this issue Sep 1, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@fabbaum
Copy link

fabbaum commented Sep 1, 2024

If I want to output dynamic fields in the text, the values are output as 0.

image

In the Docker log, ‘Argument “” isn't numeric in subtraction (-) at input text line 1. ’ is output.

The error message occurs with this part of the code:

        # collect text to print
        my @TextData;

        if ( $Self->{Config}{Text} ) {
            for my $TextLine ( $Self->{Config}{Text}->@* ) {

                push @TextData, $LayoutObject->Output(
                    Template => $TextLine,
                    Data     => \%ReadableConfigItemData,
                );
            }
        }

Presumably because the hyphen is handled as a subtraction in the Hardware-SerialNumber string.

@stefanhaerter
Copy link
Contributor

Hi @fabbaum ,

you're completely correct - the issue is that the rendering engine, Template::Toolkit, interprets the hyphen as substraction. We are aware of it, but currently, you will need a workaround.

In the system configuration entry, you may put something like this:

S/N: [% DFName = "DynamicField_Hardware-SerialNumber" %][% Data.$DFName %]

I hope this helps. I will update the issue when we fix the problem.

Kind regards,
Stefan

@stefanhaerter stefanhaerter self-assigned this Oct 29, 2024
@stefanhaerter stefanhaerter added the bug Something isn't working label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants