Hey guys,
I had in a folder, a server action with an input parameter cat_id (number). Executing some steps based on this cat_id (category_id) value…
I had to duplicate this server action and move it to another folder and in this a changed the input parameter to product_id . I needed to have the same output (get product variations) structure but based on the product_id (and not the category_id as it was).
I managed to do it and have the outpur that I want and it works.
But today I get an error in console when I select a product (and execute this server action).
I selected this server action and see that the input parameter is missing…
I deleted and added from scratch… the same result!
I checked the server action file and i think that the input parameter (product_id) is there indeed…
Here are some screenshots:
The serverAction…
The UI missing the input parameter…
And the content of my serverAction file (JSON)…
$app->define(<<<'JSON'
{
"meta": {
"$_GET": [
{
"type": "text",
"name": "sort"
},
{
"type": "text",
"name": "dir"
},
{
"type": "number",
"name": "product_id"
}
]
},
"exec": {
"steps": [
{
"name": "queryProd",
"module": "dbconnector",
"action": "select",
"options": {
"connection": "conn_stock",
"sql": {
"type": "select",
"columns": [
{
"table": "products",
"column": "prd_id"
},
{
"table": "products",
"column": "prd_Name"
},
{
"table": "prod_details",
"column": "prd_dtl_id"
}
],
"params": [
{
"operator": "equal",
"type": "expression",
"name": ":P1",
"value": "{{$_GET.product_id}}",
"test": ""
}
],
"table": {
"name": "products"
},
"primary": "prd_id",
"joins": [
{
"table": "product_details",
"column": "*",
"alias": "prod_details",
"type": "INNER",
"clauses": {
"condition": "AND",
"rules": [
{
"table": "prod_details",
"column": "prd_dtl_Prod_id",
"operator": "equal",
"operation": "=",
"value": {
"table": "products",
"column": "prd_id"
}
}
]
},
"primary": "prd_dtl_id",
"sub": {
"prod_variations": {
"type": "select",
"table": {
"name": "product_detail_prod_variations",
"alias": "prod_variations"
},
"key": "product_detail_id",
"columns": [
{
"table": "prod_variations",
"column": "prod_var_id"
},
{
"table": "prod_variations",
"column": "prod_var_Options"
},
{
"table": "prodVar_details",
"column": "var_Name"
},
{
"table": "prodVar_details",
"column": "var_RelCat"
}
],
"params": [],
"primary": "prod_variations_id",
"joins": [
{
"table": "product_variations",
"column": "*",
"alias": "prodVar_details",
"type": "INNER",
"clauses": {
"condition": "AND",
"rules": [
{
"table": "prodVar_details",
"column": "var_id",
"operator": "equal",
"operation": "=",
"value": {
"table": "prod_variations",
"column": "prod_var_id"
}
}
]
},
"primary": "var_id"
}
],
"query": "select `prod_variations`.`prod_var_id`, `prod_variations`.`prod_var_Options`, `prodVar_details`.`var_Name`, `prodVar_details`.`var_RelCat` from `product_detail_prod_variations` as `prod_variations` inner join `product_variations` as `prodVar_details` on `prodVar_details`.`var_id` = `prod_variations`.`prod_var_id`"
}
}
}
],
"query": "select `products`.`prd_id`, `products`.`prd_Name`, `prod_details`.`prd_dtl_id` from `products` inner join `product_details` as `prod_details` on `prod_details`.`prd_dtl_Prod_id` = `products`.`prd_id` where `products`.`prd_id` = ?",
"wheres": {
"condition": "AND",
"rules": [
{
"id": "products.prd_id",
"field": "products.prd_id",
"type": "double",
"operator": "equal",
"value": "{{$_GET.product_id}}",
"data": {
"table": "products",
"column": "prd_id",
"type": "number",
"columnObj": {
"type": "increments",
"primary": true,
"nullable": false,
"name": "prd_id"
}
},
"operation": "="
}
],
"conditional": null,
"valid": true
}
}
},
"output": false,
"meta": [
{
"type": "number",
"name": "prd_id"
},
{
"type": "text",
"name": "prd_Name"
},
{
"type": "number",
"name": "prd_dtl_id"
},
{
"name": "prod_variations",
"type": "array",
"sub": [
{
"type": "number",
"name": "prod_var_id"
},
{
"type": "object",
"name": "prod_var_Options"
},
{
"type": "text",
"name": "var_Name"
},
{
"type": "number",
"name": "var_RelCat"
}
]
}
],
"type": "dbconnector_select",
"outputType": "array"
},
{
"name": "query",
"module": "core",
"action": "repeat",
"options": {
"repeat": "{{queryProd[0].prod_variations}}",
"outputFields": [],
"exec": {
"steps": [
{
"name": "var_id",
"module": "core",
"action": "setvalue",
"options": {
"value": "{{prod_var_id}}"
},
"meta": [],
"outputType": "number",
"output": true
},
{
"name": "var_Name",
"module": "core",
"action": "setvalue",
"options": {
"value": "{{var_Name}}"
},
"meta": [],
"outputType": "text",
"output": true
},
{
"name": "varoptions_Array",
"module": "core",
"action": "setvalue",
"options": {
"value": "{{prod_var_Options.parseJSON().split(',')}}"
},
"meta": [],
"outputType": "number",
"output": false
},
{
"name": "variation_options",
"module": "core",
"action": "repeat",
"options": {
"repeat": "{{varoptions_Array}}",
"outputFields": [],
"outputFilter": "exclude",
"exec": {
"steps": [
{
"name": "varOption",
"module": "core",
"action": "setvalue",
"options": {
"value": "{{$value}}"
},
"meta": [],
"outputType": "number",
"output": false
},
{
"name": "curVarOption",
"module": "core",
"action": "setvalue",
"options": {
"value": "{{varOption}}"
},
"meta": [],
"outputType": "number",
"output": false,
"disabled": true
},
{
"name": "queryOptions",
"module": "dbconnector",
"action": "single",
"options": {
"connection": "conn_stock",
"sql": {
"type": "select",
"columns": [
{
"table": "product_variation_variation_options",
"column": "var_opt_id"
},
{
"table": "product_variation_variation_options",
"column": "var_opt_Name"
},
{
"table": "product_variation_variation_options",
"column": "var_opt_ExtraPrice"
}
],
"params": [
{
"operator": "equal",
"type": "expression",
"name": ":P1",
"value": "{{varOption}}",
"test": ""
}
],
"table": {
"name": "product_variation_variation_options"
},
"primary": "var_opt_id",
"joins": [],
"wheres": {
"condition": "AND",
"rules": [
{
"id": "product_variation_variation_options.var_opt_id",
"field": "product_variation_variation_options.var_opt_id",
"type": "double",
"operator": "equal",
"value": "{{varOption}}",
"data": {
"table": "product_variation_variation_options",
"column": "var_opt_id",
"type": "number",
"columnObj": {
"type": "increments",
"primary": true,
"nullable": false,
"name": "var_opt_id"
}
},
"operation": "="
}
],
"conditional": null,
"valid": true
},
"query": "select `var_opt_id`, `var_opt_Name`, `var_opt_ExtraPrice` from `product_variation_variation_options` where `product_variation_variation_options`.`var_opt_id` = ?"
}
},
"output": false,
"meta": [
{
"type": "number",
"name": "var_opt_id"
},
{
"type": "text",
"name": "var_opt_Name"
},
{
"type": "number",
"name": "var_opt_ExtraPrice"
}
],
"type": "dbconnector_single",
"outputType": "object"
},
{
"name": "var_opt_id",
"module": "core",
"action": "setvalue",
"options": {
"value": "{{queryOptions.var_opt_id}}"
},
"meta": [],
"outputType": "number",
"output": true
},
{
"name": "var_opt_Name",
"module": "core",
"action": "setvalue",
"options": {
"value": "{{queryOptions.var_opt_Name}}"
},
"meta": [],
"outputType": "text",
"output": true
},
{
"name": "var_opt_ExtraPrice",
"module": "core",
"action": "setvalue",
"options": {
"value": "{{queryOptions.var_opt_ExtraPrice}}"
},
"meta": [],
"outputType": "number",
"output": true
}
]
}
},
"output": true,
"meta": [
{
"name": "$index",
"type": "number"
},
{
"name": "$number",
"type": "number"
},
{
"name": "$name",
"type": "text"
},
{
"name": "$value",
"type": "object"
},
{
"name": "var_opt_id",
"type": "number",
"sub": []
},
{
"name": "var_opt_name",
"type": "text",
"sub": []
},
{
"name": "var_opt_ExtraPrice",
"type": "number",
"sub": []
}
],
"outputType": "array"
},
{
"name": "",
"options": {}
}
]
}
},
"output": true,
"meta": [
{
"name": "$index",
"type": "number"
},
{
"name": "$number",
"type": "number"
},
{
"name": "$name",
"type": "text"
},
{
"name": "$value",
"type": "object"
},
{
"name": "prod_var_id",
"type": "number"
},
{
"name": "prod_var_Options",
"type": "object"
},
{
"name": "var_Name",
"type": "text"
},
{
"name": "var_RelCat",
"type": "number"
},
{
"name": "var_id",
"type": "number",
"sub": []
},
{
"name": "var_Name",
"type": "text",
"sub": []
},
{
"name": "variation_options",
"type": "array",
"sub": [
{
"name": "var_opt_id",
"type": "number",
"sub": []
},
{
"name": "var_opt_name",
"type": "text",
"sub": []
},
{
"name": "var_opt_ExtraPrice",
"type": "number",
"sub": []
},
{
"name": "var_opt_Name",
"type": "text",
"sub": []
}
]
}
],
"outputType": "array"
}
]
}
}
JSON
);
?>
-Php
-Wappler 6.0 beta 3 - STABLE
Any ideas what to search and how to fix it would be appreciated!