I am struggling with the Image Load module in a Node.js project. It seems that dynamic expressions in the path field are not being parsed correctly inside a repeat loop.
The Issue: When I use the standard {{path}} or {{$value.path}}, I get: "image.load: path is required."
When I try to construct the path manually to bypass the scope issue, for example: '/public/assets/banner/test/' + $name or '/public/assets/banner/test/' + name
The debugger shows that Wappler tries to load the literal string "name" instead of the variable value: Error: Input file is missing: C:\...\public\assets\banner\test\name
Context:
-
The files are physically present in the folder.
-
The
uploadstep before the repeat is successful. -
It appears the Expression Handler is not resolving variables inside the Image Load "path" input.
{
"meta": {
"options": {
"linkedFile": "/views/web-admin/images.ejs",
"linkedForm": "form_image_upload"
},
"$_POST": [
{
"type": "text",
"fieldName": "assigned_id",
"name": "assigned_id"
},
{
"type": "text",
"fieldName": "assigned_type",
"name": "assigned_type"
},
{
"type": "text",
"fieldName": "is_partner",
"name": "is_partner"
},
{
"type": "file",
"fieldName": "image_file",
"multiple": true,
"options": {
"rules": {
"upload:accept": {
"param": "image/*"
}
}
},
"name": "image_file",
"sub": [
{
"name": "name",
"type": "text"
},
{
"name": "type",
"type": "text"
},
{
"name": "size",
"type": "number"
},
{
"name": "error",
"type": "text"
}
],
"outputType": "array"
}
]
},
"exec": {
"steps": [
{
"name": "multi_image_upload",
"module": "upload",
"action": "upload",
"options": {
"fields": "{{$_POST.image_file}}",
"template": "{name}{ext}",
"overwrite": true,
"path": "/public/assets/banner/test"
},
"meta": [
{
"name": "name",
"type": "text"
},
{
"name": "path",
"type": "text"
},
{
"name": "url",
"type": "text"
},
{
"name": "type",
"type": "text"
},
{
"name": "size",
"type": "text"
},
{
"name": "error",
"type": "number"
}
],
"outputType": "array",
"output": true
},
{
"name": "repeat",
"module": "core",
"action": "repeat",
"options": {
"outputFields": [],
"repeat": "{{multi_image_upload}}",
"exec": {
"steps": {
"name": "image",
"module": "image",
"action": "load",
"options": {
"path": "{{path}}"
},
"outputType": "object",
"meta": [
{
"name": "width",
"type": "number"
},
{
"name": "height",
"type": "number"
}
]
}
}
},
"output": true,
"meta": [
{
"name": "$index",
"type": "number"
},
{
"name": "$number",
"type": "number"
},
{
"name": "$name",
"type": "text"
},
{
"name": "$value",
"type": "object"
},
{
"name": "name",
"type": "text"
},
{
"name": "path",
"type": "text"
},
{
"name": "url",
"type": "text"
},
{
"name": "type",
"type": "text"
},
{
"name": "size",
"type": "text"
},
{
"name": "error",
"type": "number"
}
],
"outputType": "array"
}
]
},
"usedModules": {
"sharp": "^0.29.3"
}
}



