SK/FB: Labelling a SK Form Builder form identically to a packaged search overwrites it
If you create two Search Forms with the same label, the machine name of the second one will automatically be changed. Eg. two forms labelled "Example" will create afSearchExample
and afSearchExample1
.
However, if one of the forms is a packaged form, this is NOT true.
Steps to Replicate
- Enable an extension that provides a packaged SK form (e.g. CiviGrant provides
afSearchGrants
. - Create a minimal Search Kit search.
- Create a form from that search and name it
Grants
.
Expected Result
The new FB form is named afSearchGrants1
and is separate from the packaged FB search form.
Actual Result
The new FB form is named afSearchGrants
and replaces the old form. You can't revert this without CLI access to rename the .html
and .json
files in [civicrm.files]/ang
.
This came about when a client created a new FB search form and named it "Grants", causing their Grants tab to disappear.
I suspect that the naming behavior looks at other files in the same folder, and appends the 1
if it finds a file of the same name. It should be comparing against all .aff.*
files. It should provide a warning that you're going to replace a core FB form.