Wappler v6 Beta Bug #27 - Error From api.php

======== TEMPLATE BUG FORM ========

Wappler Version : v6 Beta 13
Operating System :
Server Model: PHP 8.1
Database Type: MySQL 8
Hosting Type: AWS

Expected behavior

What do you think should happen?

The following server action should work without issues, as it does under Wappler 3.9.7 and PHP 7.4.

The action is a few basic Set Value statements, followed by an API call to another server action:

The value of the single input is {{subscriber_user.identity}}

Here it is running under 3.9.7 and PHP 7.4:

Actual behavior

What actually happens?

The API call fails with the following in the dev console:

{
  "code": 0,
  "file": "/var/app/current/dmxConnectLib/modules/api.php",
  "line": 77,
  "message": "Object of class stdClass could not be converted to string",
  "trace": "#0 /var/app/current/dmxConnectLib/modules/api.php(77): curl_setopt(Object(CurlHandle), 10015, Object(stdClass))\n#1 /var/app/current/dmxConnectLib/lib/App.php(206): modules\\api->send(Object(stdClass), 'crontab_command...', NULL)\n#2 /var/app/current/dmxConnectLib/lib/App.php(178): lib\\App->execSteps(Object(stdClass))\n#3 /var/app/current/dmxConnectLib/lib/App.php(146): lib\\App->execSteps(Array)\n#4 /var/app/current/dmxConnectLib/lib/App.php(113): lib\\App->exec(Array)\n#5 /var/app/current/dmxConnect/api/crontab/test_crontab_commands.php(8): lib\\App->define(Array)\n#6 {main}"
}

How to reproduce

I’m not quite sure what to say here… maybe @patrick can tell me what part of the API call this message is referrring to? :thinking:

I have a load of other server actions calling other server actions via an API call, and they all seem to run just fine!

Hey Antony,

My eye cought this set value…
The api_base is inside the curly brackets and the rest string is out of them…

Is this normal?

Yes, this is normal… {{api_base}} resolves to your calling domain’s location of your server actions, eg “http://localhost/dmxConnect/api”

weird…
First time I see the representation of a Set Value the half to be inside the curly brackets and the other half outside.
I thought it should be like that:
image

and what we see after that is:
image

@Teodor, can you folks take a look at this please? Thank you!

Hello, Did you find the solution?

I don’t know if it’s normal when you change the data type to text it says object Object, if that helps to understand why it ends up with this data type

No… but hopefully will now @patrick is copied in!

You can test if this update fixes it: api.zip (2.8 KB)


Here a new update: api.zip (2.8 KB)

Is the api server expecting a form encoded post or something else?

No, not particularly, it seems to work, I’ll look more

I’m travelling at the moment @patrick, so can’t test this until mid next week…

Fixed in Wappler 6 beta 16