FluidTYPO3 / vhs

TYPO3 extension VHS: Fluid ViewHelpers
https://fluidtypo3.org
Other
190 stars 229 forks source link

v:asset.script doesn’t work anymore after update to 6.1.3 #1862

Closed klodeckl closed 1 month ago

klodeckl commented 12 months ago

After updating vhs from 6.1.2 to 6.1.3 the viewhelper v:asset.script does not work anymore. Downgrading resolves the problem. TYPO3 10.4.36 (11 not tested). Non composer mode.

jgreiner commented 11 months ago

In typo3 11.5.26 I am getting this error message

` (1/2) Symfony\Component\PropertyAccess\Exception\InvalidArgumentException

Expected argument of type "array", "string" given at property path "dependencies".

........ ........ .......

in /var/www/html/vendor/symfony/property-access/PropertyAccessor.php line 179 at Symfony\Component\PropertyAccess\PropertyAccessor->setValue(object(FluidTYPO3\Vhs\Asset), 'dependencies', 'jquery')

in /var/www/html/public/typo3/sysext/extbase/Classes/Reflection/ObjectAccess.php line 183 at TYPO3\CMS\Extbase\Reflection\ObjectAccess::setProperty(object(FluidTYPO3\Vhs\Asset), 'dependencies', 'jquery')

in /var/www/html/public/typo3conf/ext/vhs/Classes/Asset.php line 106 at FluidTYPO3\Vhs\Asset::createFromSettings(array('path' => 'EXT:greiner_core/Resources/Public/js/frontend/cookies/greinerCore.privacy-hint.js', 'rewrite' => '0', 'external' => '0', 'group' => 'main', 'standalone' => '1', 'dependencies' => 'jquery', 'movable' => '1', 'type' => 'js', 'name' => 'gccookie'))

`

It seems that the property "dependencies" is passed to Symfony's PropertyAccessor as string but should be converted to an array before?

NamelessCoder commented 11 months ago

@jgreiner Your problem is almost certainly not the same as @klodeckl (yours is about TS-defined assets, his is about ViewHelper-defined assets). Regardless: the linked commit should solve your issue.

@klodeckl Can you elaborate a bit about how the ViewHelper doesn't work?

NamelessCoder commented 1 month ago

Closing as probably solved and due to lack of feedback on request for specifics.