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-platform 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.

2 Likes

@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

2 Likes