Score:-2

how to debug a webform computed twig error

cn flag

I am working on an error that is being made in a webform that has some calculations that apparently were working in php 7 but give an error in php 8 , this is the error php Error TypeError: Unsupported operand types: string + string in __TwigTemplate_8094a737adc00d46b4b28a8e4ca8728f->doDisplay() (line 39 of /app/docroot/sites/default/files/php/twig/64f237df80199___

I believe the error is coming from the code in one of the build elements of the webform of type Computed twig , but what is the recommended way to debug this code so i can step through it or put out some kind of log messages to see what the variables are in each line ?

I didnt write this code nor did anyone in my company so i would like to be able to see line by line what the data is in each step so i can see which line doesnt have a string when a string is expected.

id flag
Does this answer your question? [Why does this Twig code not perform math operations as expected?](https://drupal.stackexchange.com/questions/315880/why-does-this-twig-code-not-perform-math-operations-as-expected)
cn flag
Trying to teach someone how to debug in a single question isn’t something we can support here I’m afraid. The docs are easy to find though: https://www.drupal.org/docs/theming-drupal/twig-in-drupal/debugging-twig-templates. If you get stuck somewhere specific, ask a new question with all the details
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.