Is your enhancement request related to a problem? Please describe.
CI:5015
We have a particular use case where we want to allow no more than 1 file per directory of a particular content type, and that file name should always be "root" (so it ends in "/root.xml"). We set the file-name field to be read-only, and set a default value of "root" to enforce this. This works for the initial creation, however, if you try to add a second content item to the same directory, the field validation on the file-name field doesn't run and doesn't prevent duplicates like if the field weren't readonly. The form then successfully submits and the new file replaces the existing one.
This can be reproduced with the following steps:
Create a new site from Editorial BP
Update the Header content type to have the file-name with a default root value and in readonly mode:
Create a new Header content type, notice that the Component ID is /components/headers/root which is correct and in read-only mode
After the component is created in step 3, create a new Header component:
Save the component in step 4, notice that it overrides the component in step 3 which is not an expected behavior
Describe the solution you'd like
My expectation is the form would be prevented from submitting, or at the very least there'd be a warning that the file would be overwritten.
Latest version
Duplicates
Is your enhancement request related to a problem? Please describe.
CI:5015
We have a particular use case where we want to allow no more than 1 file per directory of a particular content type, and that file name should always be "root" (so it ends in "/root.xml"). We set the file-name field to be read-only, and set a default value of "root" to enforce this. This works for the initial creation, however, if you try to add a second content item to the same directory, the field validation on the file-name field doesn't run and doesn't prevent duplicates like if the field weren't readonly. The form then successfully submits and the new file replaces the existing one.
This can be reproduced with the following steps:
file-name
with a defaultroot
value and inreadonly
mode:/components/headers/root
which is correct and in read-only modeDescribe the solution you'd like
My expectation is the form would be prevented from submitting, or at the very least there'd be a warning that the file would be overwritten.