Closed ErHaWeb closed 6 months ago
These files are generated automatically. So, if it is in the docblocks of the view helper classes, we have to investigate why they are not correct in the docs.
Ok, there seems to be a broader problem with different valid data types for ViewHelper arguments. string
and integer
are output correctly but it seems that almost all other data types such as object
or bool
are generally documented as mixed
. Could there be a general problem with the mapping of data types when rendering the documentation?
@linawolf Do you have insight in here?
With regard to the data type boolean
, the TemplateParser accepts both the designation bool
(as in the argument useNonce
of the CssViewHelper
) and boolean
(as in the argument priority
of the CssViewHelper
). The latter is output correctly in the documentation, the former is not.
https://github.com/TYPO3/Fluid/blob/main/src/Core/Parser/TemplateParser.php#L569
Thanks for investigating, just looking for the repo where this is handled.
This seems to be the place where the "mixed" comes from: https://github.com/TYPO3-Documentation/fluid-documentation-generator/blob/b00dd00a86e087f473b108f33fd711744ec9af67/src/Export/RstExporter.php#L173
There seems to be a schema.xsd to be loaded. I assume, this schema generator does not handle the bool. This one? https://github.com/TYPO3/Fluid.SchemaGenerator
This is where the type mapping is located when generating the XSD file:
https://github.com/TYPO3/Fluid.SchemaGenerator/blob/main/src/SchemaGenerator.php#L157-L175
and here are the corresponding test values
https://github.com/TYPO3/Fluid.SchemaGenerator/blob/main/tests/Unit/SchemaGeneratorTest.php#L54-L66
As you can see, only the type boolean
is handled there, not bool
as also accepted by the TemplateParser.
PR to add the correct interpretation of the "bool" notation in the SchemaGenerator has been created: https://github.com/TYPO3/Fluid.SchemaGenerator/pull/16
My PR to change the generated XSD file https://github.com/TYPO3/Fluid.SchemaGenerator/pull/16 has been merged. What will happen now? Will the documentation be recreated in the foreseeable future on the basis of the new XSD file or does this process still need to be explicitly initiated by someone?
The view helper reference was rendered recently:
But the change is not available, yet. I assume, we need a tag, so this change is picked up for the rendering chain.
Pinged Simon about tagging.
new tag is available
@linawolf Do you know, how to trigger a new commit of the changes? The content is still old: https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-ViewHelper/blob/main/Documentation/typo3/fluid/latest/Asset/Css.rst#usenonce
@brotkrueml we can trigger rerendering here: https://github.com/TYPO3-Documentation/t3docs-ci-deploy/actions/workflows/fluid-viewhelper.yml
If I read the workflow file correctly, it's also created once a day (at 1 am) via crontab.
The latest workflow however shows an error that seems to use PHP 8.1 instead of PHP 8.2 and I'm quite stumped how that happens; the "main" job does set-up PHP 8.2, so why isn't it available...
Good hint! I will investigate. I was recently making some other changes to the fluid-documentation-generator and they might have an effect here
So the rendering now worked and the nonce argument is displayed as boolean: https://docs.typo3.org/other/typo3/view-helper-reference/main/en-us/typo3/fluid/latest/Asset/Css.html#asset.css_usenonce
@ErHaWeb thanks a lot for supplying the patch in the schema generator!
According to
TYPO3\CMS\Fluid\ViewHelpers\Asset\CssViewHelper
andTYPO3\CMS\Fluid\ViewHelpers\Asset\ScriptViewHelper
the argumentuseNonce
should be of typeboolean
.