Problem with [object Object] being added to links

Debug Report:

chrome_debug.zip (36.3 KB)

I have a strange behaviour when adding external links to a page, not sure if it is a bug or me but I am assuming bug for this report

I have a table which contains links to the forum

So here is a database table containing the link

So I start with a generated bootstrap table which lists these links


All good up till now

Now I add a link into the entry

image

and set its value to the link via dynamic attributes

image

resulting in code:

The link shows [object Object] after it

Clicking the link leads to an incorrect link

image

I have tried numerous variation on the code like

<td><a href="#" dmx-bind:href="{{link}}">Link</a></td>

But still the same problem

Is it possible that you have a component in the same scope with the name link. Try {{json(link)}} as expression, it should format it as json and could help us figure out what the second object is.

Now using

               <tr>
                  <td dmx-text="link">
                    <a href="#" dmx-bind:href="{{json{link}})">Your link title</a>
                  </td>
                </tr>

Still getting:

https://community.wappler.io/t/uploading-multiple-files-to-your-server/4412,[object Object]

Why are you using both dmx-text and content inside the <td>?
If you need the link, remove the dmx-text attribute.

That’s just one of the many combinations I have tried to debug this Teodor,

I am going to change the table field name in case we have a naming conflict with the HTML link attribute
Will report back on that one

Thanks for your time, partricks comment re link scope sent me in the correct direction.

It appears that the name “link” was the problem, i assume an object conflict with the HTML “link” tag
Changing the field name to “forumlink” solved the problem

Thanks for your time on this one, i should have thought of that myself

4 Likes