M:n Relation broken when index is 0 (zero) => Solution here

UPDATE:
i debugged the code and found the following:
Actual code: if (!empty($mydevicetypelnkx))
To fix: if (!empty($mydevicetypelnkx) OR ($mydevicetypelnkx==0))

@line 3967 on the file i sent to bugs@netmake.com.br at 2021-02-21

What happens:
PHP function empty() returns false when the variable $mydevicetypelnkx is empty or when its 0! So, when the index should be 0, the code will not executed, because empty() is false, which is not right, then its not empty, its 0!

Please fix it!

i have a many to many Relationship in a form and i pick the keys from a table with the following query:

SELECT intvalue1, value1 FROM tbllookup WHERE type=‘SPGType’ ORDER BY intvalue1

intvalue1 can be 0,1,2,3,4,5,6.

Then i write with a double select field to a Link-Table (autoindex, chartid, intvalue1).

Everythhing works fine until the intvalue1, which i look up with the upper query, is 0 (zero). There is no insert query seen in debug mode for that, also no error. The relation got not written. And yes, 0 (zero, not null) is allowed in my link-Table for intvalue1. When i do the same query in SQL Editor, the entry is written. And as i told you: Before the update, everything works fine.