Legacy Knowledge Base
Published Jul. 2, 2025

Javascript errors and disabled elements when editing or saving Web Contents

Written By

Cristina Rodriguez

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • When editing or creating new web contents based on a custom structure, the information may be inconsistent, fields may be disabled and non editable, or related errors may be observed.

  • This is an example of a web content that needs to be edited but its contents are disabled:

    mceclip0.png

  • We can also see a javascript error in the console that looks like:

    mceclip1.png

    Uncaught SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at component.getParsedValue (?browserId=other&minifierType=&languageId=en_US&b=7210&t=1598515940278&/o/frontend-js-web/aui/aui-tree-io/aui-tree-io-min.js&/o/frontend-js-web/aui/aui-tree-paginator/aui-tree-paginator-min.js&/o/frontend-js-web/aui/aui-tree-node/aui-tree-node-min.js&/o/frontend-js-web/aui/aui-tree-view/aui-tree-view-min.js&/o/layout-taglib/layouts_tree/js/layouts_tree.js&/o/layout-taglib/layouts_tree/js/layouts_tree_node_radio.js&/o/layout-taglib/layouts_tree/js/layouts_tree_radio.js&/o/layout-taglib/layouts_tree/js/layouts_tree_node_task.js&/o/layout-taglib/layouts_tree/js/layouts_tree_selectable.js&/o/dynamic-data-mapping-web/js/ddm_form.js&/o/frontend-js-web/aui/autocomplete-sources/autocomplete-sources-min.js&/o/frontend-js-web/aui/autocomplete-list/lang/autocomplete-list_en.js&/o/frontend-js-web/aui/shim-plugin/shim-plugin-min.js&/o/frontend-js-web/aui/autocomplete-list/autocomplete-list-min.js&/o/frontend-js-web/aui/autocomplete-list-keys/autocomplete-list-keys-min.js:96)
    {...}

     

Environment

  • Liferay DXP 7.1
  • Liferay DXP 7.2

Resolution

  • In some of the cases the root cause of these errors is within the code of the custom structure. In many occasions the empty string is not correctly specified and then javascript parsing errors occur, leading to the observed problematic scenarios.

  • This is an example of a structure's field with an incorrect format for the empty strings:
    {
                "label": {
                    "es_ES": " Version pdf "
                },
              "predefinedValue": {
                  "es_ES": " "
                },
                "style": {
                    "es_ES": ""
                },
              "tip": {
                  "es_ES": " "
                },
                "dataType": "document-library",
    ...
                "type": "ddm-documentlibrary"
          }
    }        
  • The correct one should be:
    {
                "label": {
                    "es_ES": " Version pdf "
                },
              "predefinedValue": {
                  "es_ES": ""
                },
                "style": {
                    "es_ES": ""
                },
              "tip": {
                  "es_ES": ""
                },
              "dataType": "document-library",
    ...
                "type": "ddm-documentlibrary"
          }
    }
  • As a summary, empty strings must be specified as "", with no blank spaces inside.

 

 

Did this article resolve your issue ?

Legacy Knowledge Base