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

When editing or validating a content a proposal date on "1911-03-12" is set

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 4.3.0
    • None
    • None
    • None
    • 4.3 M7

      When calling setProposalDate(null) on a content, a proposal date on "1911-03-12" is stored instead of removing or clear the value.

      So as soon as a content is edited or validated, a proposal date to "1911-03-12" is set.

      As a consequence, the search for content awaiting validation since X days returns all the content being edited or validated.
      If alerts on contents awaiting validation is activate, it could send a lot of (wrong) emails !!

          [CMS-10215] When editing or validating a content a proposal date on "1911-03-12" is set

          Here the script to execute to fix the concerned contents

          let count = 0;
            jcrXPathQuery("//element(*, ametys:content)[ametys-internal:unversioned/@ametys:proposalDate< xs:dateTime('1912-01-01T00:00:00.000+01:00')]").forEach(function(content) {
                count++;
                content.getNode().getNode('ametys-internal:unversioned').getProperty("ametys:proposalDate").remove();
            });
            
            if (count > 0)
            {
           	  session.save();
            }
            print(`${count} content(s) has been fixed`);
          

          Laurence Aumeunier added a comment - Here the script to execute to fix the concerned contents let count = 0; jcrXPathQuery( " //element(*, ametys:content)[ametys-internal:unversioned/@ametys:proposalDate< xs:dateTime( '1912-01-01T00:00:00.000+01:00' )]" ).forEach(function(content) { count++; content.getNode().getNode( 'ametys-internal:unversioned' ).getProperty( "ametys:proposalDate" ).remove(); }); if (count > 0) { session.save(); } print(`${count} content(s) has been fixed`);

            Unassigned Unassigned
            laurence Laurence Aumeunier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: