Specific app connect binding no longer working on 4.0

I’ve been using the below binding which I found on this forum a while back to convert a date to an easy-to-read format such as “1 day ago”, “1 hour ago”, etc. It has been working completely fine from Wappler 3.9.9 and through the Wappler 4.0 betas, however, after I have upgraded to 4.0 and save any page which contains it, it updates the expression which results in it no longer being recognized as an expression, thus, just printing it to the page.

It goes from:

{{date.minutesUntil(datetime.datetime) > 1440 ? date.daysUntil(datetime.datetime) + ' days ago' : date.minutesUntil(datetime.datetime) >= 60 ? date.hoursUntil(datetime.datetime)+' hours ago': date.minutesUntil(datetime.datetime)+' minutes ago'}}

To:

{{date.minutesUntil(datetime.datetime) > 1440 ? date.daysUntil(datetime.datetime) + ' days ago' : date.minutesUntil(datetime.datetime) >= 60 ? date.hoursUntil(datetime.datetime)+' hours ago':

                                                        date.minutesUntil(datetime.datetime)+' minutes ago'}}

Both of the above have been copied directly from the code editor. For whatever reason, it is forcing a new line as you can see in the example above which completely breaks it, and I can’t seem to find a way to save it without it breaking without reverting to the beta.

Is this related to Tags split onto several lines in Code View when formatting ?

I am having a similar issue at the moment with this binding

{{(sc_ad_job_q.data.sa_q_job_q.driv_rep_status == null) ? '[Repair Category: not selected in tab 9]' : (sc_menus.data.q_menus.where('menu_list_id', sc_menus.data.q_menus.where('menu_list_id', sc_ad_job_q.data.sa_q_job_q.driv_rep_status, '==')[0].list_ref, '==')[0].list_label)}}

It worked well, without any issues until I upgraded to 4.0.0.

This is what shows on the web page now

image

The only issue I can see is that the Server Connect Binding won’t allow me to select any part of the Server Action. As you can see, the drop-down arrow is missing.

image

I am in the process of trying to recreate this Server Action again from scratch. It is fairly complicated so may take me a little while as I am doing it in stages to see if there is any point at which it fails.

Does it still happen when you disable Format document on save?

I disabled “Format document on save”.

That displays correctly for me now.

image

I still cannot pick from the Server Connect Binding and so I will continue to rebuild this.

Im not sure if this will help but when I can’t see or update a output I turn it off then save then turn it back on and save again, you may have also already tried this but just incase

Guys please keep different issues in different topics.
The topic here is about long code line breaking in several lines breaks the page.

Hi Teodor, yes I understand that, and that is the issue I was having. I did mention that I had the same issue but I didn’t know if it was not displaying because of the line-breaks or because of a problem with the Server Connect. It would seem that Patrick resolved the immediate issue with the “Format document on save”, for me anyway. I now realise that the issue with the Server Connect Binding is something else and I am looking into that separately.

Confirming that this was fixed on 4.0.1 – Thank you for the quick fix.

This topic was automatically closed after 31 hours. New replies are no longer allowed.