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

Fields with default values do not exist within the database #503

Open
RaduNico opened this issue Nov 20, 2023 · 2 comments
Open

Fields with default values do not exist within the database #503

RaduNico opened this issue Nov 20, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@RaduNico
Copy link

Attempting to reference the affected field in a template if the affected resource has the default empty value results in an error when generating a report. (see picture) The field "scope" does not appear to be created in the database for newly created findings. The reason I am attempting to access the field in the template is to add a TODO in the report if the field does not have a value set. I am using the following text in the report template:

{#affected == ''}TODO{/affected == ''}

The same behavior is present in the case of custom text (Editor) fields with the default value.

To Reproduce

  1. Create new finding
  2. Use a template containing {#affected == ''}TODO{/affected == ''}
  3. Attempt to create a report

Expected behavior
Create a report and correctly evaluate the affected resources / custom text field as being empty

image

@RaduNico RaduNico added the bug Something isn't working label Nov 20, 2023
@yeln4ts
Copy link
Contributor

yeln4ts commented Dec 22, 2023

Is the {affected} tag inside a {findings} tag ?

@RaduNico
Copy link
Author

RaduNico commented Dec 25, 2023

In my attempt to create a very simple way to reproduce the issue I forgot to add the {affected} tag inside a {findings} tag. Using the structure {#affected == ''}TODO{/affected == ''} is correctly evaluated by pwndoc. The test template I created was not correctly formatted and I red herringed myself.

The way I am trying to use the affected tag is like this:

{#findings}
{#affected == ''}TODO EMPTY AFFECTED{/affected == ''}{@affected | convertHTML: ‘AffectedResources’}
{/findings}

And this does result in an the above mentioned error. The expected behavior would be to put the placeholder text 'TODO EMPTY AFFECTED' if the affected textbox is empty or to use the content if it's not empty. Both structures work correctly when used independently, but when both are used it results in an error.

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