cancel
Showing results for 
Search instead for 
Did you mean: 

Why these fields are always read only

zengqingyi12
Champ in-the-making
Champ in-the-making
Creator:*
Created Date:*
Modifier:*
Modified Date:*

Why these fields are always read only even after I configured them in the share-form-config.xml
and change : <show id="cm:created" for-mode="edit" /> to edit .

and changed in share-config-custom.xml
<show id="cm:modifier" for-mode="edit" />  , which also changed to edit.

But the result are still read only .

I am use alfresco 3.3G, any recommendation ?  Thanks in advance !
3 REPLIES 3

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

If you take a look at the definition of the auditable aspect you will see that these properties are marked as protected.  This means the forms framework will not allow them to be edited regardless of the configuration set.  They are marked as protected, because their values are calculated by the repository (during creation and update of the node) therefore it wouldn't make sense for their values to be edited directly.


<aspect name="cm:auditable">
         <title>Auditable</title>
         <properties>
            <property name="cm:created">
               <title>Created</title>
               <type>d:datetime</type>
               <protected>true</protected>
               <mandatory enforced="true">true</mandatory>
            <index enabled="true">
              <atomic>true</atomic>
              <stored>false</stored>
                  <tokenised>both</tokenised>
               </index>
            </property>
            <property name="cm:creator">
               <title>Creator</title>
               <type>d:text</type>
               <protected>true</protected>
               <mandatory enforced="true">true</mandatory>
            </property>
            <property name="cm:modified">
               <title>Modified</title>
               <type>d:datetime</type>
               <protected>true</protected>
               <mandatory enforced="true">true</mandatory>
            <index enabled="true">
              <atomic>true</atomic>
              <stored>false</stored>
                  <tokenised>both</tokenised>
               </index>
            </property>
            <property name="cm:modifier">
               <title>Modifier</title>
               <type>d:text</type>
               <protected>true</protected>
               <mandatory enforced="true">true</mandatory>
            </property>
            <property name="cm:accessed">
               <title>Accessed</title>
               <type>d:datetime</type>
               <protected>true</protected>
            <index enabled="true">
              <atomic>true</atomic>
              <stored>false</stored>
                  <tokenised>both</tokenised>
               </index>
            </property>
         </properties>
      </aspect>

Cheers,
Roy

mrogers
Star Contributor
Star Contributor
And if you were to simply make then unprotected then that would not work either since any value you set would get over-ridden. 😎

There is a special "back door" way to set these properties which is to disable the auditable aspect for the current transaction.

isaacrojas
Champ in-the-making
Champ in-the-making
Very helpful. Thanks.