Javascript gets stripped from custom forms in programs

Hi,

We noted that javascript is getting stripped from custom forms in programs in 2.29 and 2.30 when saving. Is this an expected behavior or a bug? Replicated in play.dhis2.org

2 Likes

I have experienced the same with 2.29. I have to recopy the javascript every time I am doing the changes to the custom form.

2 Likes

@Pamod and @KMurumba; it’s nice of you to bring this to our attention. @Stian - is this something you are able to provide insight on?

1 Like

Hi,

as far as I can tell we don’t manipulate the payload we receive on the backend. @birkbjo is maintaining the maintenance app and might be able to provide some more information on this. This could potentially be a bug.

3 Likes

Has anyone made any progress on why this happens? It is being tracked in Jira since Nov 2018 but was set in status of “needs info”. I provided my experience in 2.32 with screenshots.

https://jira.dhis2.org/browse/DHIS2-5276

2 Likes

@chase.freeman - Thanks for the detailed bug report! Tagging @dhis2-apps so they can have a further look.

2 Likes

Thanks for the bug reports. I’ve looked into this. The problem does not seem to be with the javascript itself, but the ‘source’ mode in the editor. For changes to be saved while in ‘source’-mode you need to go back to HTML-mode before saving the form. This is due to the third-party ‘plugin’ we use for the editor.

I’m looking into fixing this so that it behaves similiary to the regular mode. However for now, this should be a workaround. Let me know if you still have problems.

1 Like

@birkbjo Thanks for your relatively prompt response on this! I’ve had issues with CKEditor in the past myself.

Thanks again for your effort and communication via Jira. Also thanks to @Karoline for elevating this issue promptly!

Best,

Chase

1 Like