r3-team / r3

REI3 - Free and open low code
https://rei3.de
MIT License
341 stars 46 forks source link

ReferenceError: RELATION_NAME is not defined #32

Closed gizocz closed 1 year ago

gizocz commented 1 year ago

I have two Relations with the 1:1 relation and a Form with Fields from both Relations. The Form has a frontend Function assigned and inside the Function calls app.get_field_value() to read the values from both Relations.

It works well if both Relations are inside one Application. However, if the two Relations are in different dependent Applications, an error "ReferenceError: THE_OTHER_RELATION is not defined" occured.

r3-gabriel commented 1 year ago

I was able to replicate this issue and find the underlying cause:

image The screenshot above shows two field references (one internal and one external).

image Enabling the preview, we see that only the one referencing an internal attribute is resolved.

This is definitely a bug in the JS function editor. Once fixed, you will have to save the JS function again so that all placeholders are correctly resolved.

Thank you for this report!

r3-gabriel commented 1 year ago

I´ve found a good solution for this issue. It might take a short while for the next release to come out. Do you require this fix urgently?

gizocz commented 1 year ago

I have already rewritten my app to workaround this bug, so it is not urgent for me now. Better, please, implement the feature "custom validate function" #31 :) Thank you

r3-gabriel commented 1 year ago

Its planned to be part of the next release. It should come out with 3.3.