Tagify $POST format errors

After I edit the entries in the new tagify extension, it appears to send through an array, the first element is a string containing all of the tags, followed by each of the individual tags as individual elements.

Is this as expected and do I need to develop a workaround or is this a bug in the $POST construct …

Thanks

Can you check how the Form Data (Payload) looks like. The post data should only contain the individual elements and not the concatenated string you have as first item.

Here’s the $POST variables written out. As you can see, the format is incorrect.

NOTE: The initial insert from a clean input is fine. It’s on subsequent edits that it goes awry

As described here:

So it only happens with an update, when you bind the old values to the input. How do you bind the value to the input?

Here’s the server connect design. It’s posting to Postgres JSONB field.

Incoming field is called tags. I’ve described it it as an array

And insert into JSONB field as follows:

Maybe the tags field definition is incorrect ?

I don’t mean the server action, the tagify component on the page, how did you bind the data there?

It’s in an onclick _event for a modal dialog.

I clear all values in the input,
Set values from a tags variable
then show the modal

Please check if the following update solves your problem.

dmxTagify.zip (2.9 KB)

thanks.

Where do I unzip this to ?

Depending on what project type you have it can differ.

With NodeJS project it is in public/dmxAppConnect/dmxTagify, with most other projects it is dmxAppConnect/dmxTagify. With mobile (cordova) project it is located in www/dmxAppConnect/dmxTagify.

Hi Patrick,

That hasn’t helped. Here’s some examples. I’ve simply added one tag to this and posted it. It’s sending 2 of the same value to the SC.

And here I add another, and it’s blended the 2 together into [0] and sent the individual array elemens

But this only happens on edit, not on insert?

Here a new update dmxTagify.zip (2.9 KB)

This with the latest update. It’s adding all the array elements into the element[0].Now on inserts and edits

Could you please show how your payload looks like, the data send to the server before it is being processed on the server, you see it in the payload tab.

image

Thx, I can now see where it actually goes wrong.

Here a new update dmxTagify.zip (2.9 KB)

Hi Patrick,

Yes that’s good now. The non-array list is no longer being sent.

Cheers!

Fixed in Wappler 4.7.0

1 Like