Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-6564

Edition of a metadata in the edit contents grid failed for some widgets

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.1.0
    • None
    • None
    • None
    • 4.1 RC1

        [CMS-6564] Edition of a metadata in the edit contents grid failed for some widgets

        Resolved this issue and open two more issue CMS-9000 and CMS-9001 for reference and url widget

        Laurence Aumeunier added a comment - Resolved this issue and open two more issue CMS-9000 and CMS-9001 for reference and url widget

        file, geocode and user widgets are now ok.

        Missing widgets:

        • reference
        • url

        Laurence Aumeunier added a comment - file, geocode and user widgets are now ok. Missing widgets: reference url

        The proposed pull request fixes the issue CMS-8526

        File and reference widgets are still disabled in edition grid.
        See #isEditionAllowed method in DefaultMetadataSearchUIColumn class, the edition is volontary disabled until this issue was fixed.
        See FIXME https://issues.ametys.org/browse/CMS-6564 in code.

        Laurence Aumeunier added a comment - The proposed pull request fixes the issue CMS-8526 File and reference widgets are still disabled in edition grid. See #isEditionAllowed method in DefaultMetadataSearchUIColumn class, the edition is volontary disabled until this issue was fixed. See FIXME https://issues.ametys.org/browse/CMS-6564 in code.

        This will be partially solved when integrating branch of CMS-8401 thanks to #convertSubmiValue method.
        The geocode widget was fixed into the git branch

        Laurence Aumeunier added a comment - This will be partially solved when integrating branch of CMS-8401 thanks to #convertSubmiValue method. The geocode widget was fixed into the git branch

        Laurence Aumeunier added a comment - - edited

        Identified widgets that do not work :

        • file
        • reference
        • geocode

        Widgets verified and ok :

        • string
        • date
        • datetime
        • content
        • enumerated string (multiple or not)
        • long
        • double

        The unworking types are temporarily unactive:
        See // FIXME https://issues.ametys.org/browse/CMS-6564 in DefaultMetadataSearchUIColumn and remove

        Laurence Aumeunier added a comment - - edited Identified widgets that do not work : file reference geocode Widgets verified and ok : string date datetime content enumerated string (multiple or not) long double The unworking types are temporarily unactive: See // FIXME https://issues.ametys.org/browse/CMS-6564 in DefaultMetadataSearchUIColumn and remove

        Laurence Aumeunier added a comment - - edited

        When submiiting grid edition, widget.getValue is called instead of widget.getSubmitValue

        For exemple, for a reference metadata :

        • from form edition, the submitted value is "{"type":"__external","value":"http://www.ametys.org"}"
        • from search grid, the submiited value is {type: __external, value: http://www.ametys.org}
           

        From search grid, the edition failed in EditContentFunction because we can not parse value

        Caused by: java.lang.IllegalArgumentException: The json string {type=__external, value=http://www.ametys3.org} can not be parsed as a Map.
        	at org.ametys.core.util.JSONUtils.convertJsonToMap(JSONUtils.java:96)
        	at org.ametys.cms.workflow.EditContentFunction._bindReferenceField(EditContentFunction.java:2211)
        	at org.ametys.cms.workflow.EditContentFunction._bindAndValidateReferenceMetadata(EditContentFunction.java:2180)
        	at org.ametys.cms.workflow.EditContentFunction._bindAndValidateMetadata(EditContentFunction.java:843)
        	at org.ametys.cms.workflow.EditContentFunction._bindAndValidateMetadataSetElement(EditContentFunction.java:618)
        	at org.ametys.cms.workflow.EditContentFunction._bindAndValidateContent(EditContentFunction.java:568)
        	at org.ametys.cms.workflow.EditContentFunction.execute(EditContentFunction.java:331)
        	at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:483)
        

        Laurence Aumeunier added a comment - - edited When submiiting grid edition, widget.getValue is called instead of widget.getSubmitValue For exemple, for a reference metadata : from form edition, the submitted value is "{"type":"__external","value":"http://www.ametys.org"}" from search grid, the submiited value is {type: __external, value: http://www.ametys.org }   From search grid, the edition failed in EditContentFunction because we can not parse value Caused by: java.lang.IllegalArgumentException: The json string {type=__external, value=http://www.ametys3.org} can not be parsed as a Map. at org.ametys.core.util.JSONUtils.convertJsonToMap(JSONUtils.java:96) at org.ametys.cms.workflow.EditContentFunction._bindReferenceField(EditContentFunction.java:2211) at org.ametys.cms.workflow.EditContentFunction._bindAndValidateReferenceMetadata(EditContentFunction.java:2180) at org.ametys.cms.workflow.EditContentFunction._bindAndValidateMetadata(EditContentFunction.java:843) at org.ametys.cms.workflow.EditContentFunction._bindAndValidateMetadataSetElement(EditContentFunction.java:618) at org.ametys.cms.workflow.EditContentFunction._bindAndValidateContent(EditContentFunction.java:568) at org.ametys.cms.workflow.EditContentFunction.execute(EditContentFunction.java:331) at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483)

        It seems like the edited metadata and the displayed metadata are not the same

        Quentin Glinel-Mortreuil (Inactive) added a comment - It seems like the edited metadata and the displayed metadata are not the same

          laurence Laurence Aumeunier
          quentin Quentin Glinel-Mortreuil (Inactive)
          Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

            Created:
            Updated:
            Resolved: