Open freddyDOTCMS opened 1 month ago
Tested in dotcms/dotcms:trunk_e9c8559
After run curl command:
{"entity":"Ran the upgrade task: com.dotmarketing.startup.runonce.Task241007CreateUniqueFieldsTable","errors":[],"i18nMessagesMap":{},"messages":[],"pagination":null,"permissions":[]}
Logs:
dotcms-app-1 | 21:32:08.615 INFO system.UpgradeTaskResource - Running the upgrade task: com.dotmarketing.startup.runonce.Task241007CreateUniqueFieldsTable
dotcms-app-1 | 21:32:08.703 INFO system.UpgradeTaskResource - Ran the upgrade task: com.dotmarketing.startup.runonce.Task241007CreateUniqueFieldsTable
A Content Type was created with two fields: Title
and Site
. For the Title
field we defined a field variable called uniquePerSite
and it was set to true.
Created a new site.
Created two contents (of the recent created Content Type) one the demo.dotcms.com
site and the other in the new site.
Went to edit the Content Type and tried to delete uniquePerSite
field variable.
Error message when trying to delete the uniquePerSite
field variable when there was already a content with the same unique field in a different site.
SHA before changes: d5c4e3130c61fd48ef51f5ac666d590d6186b77e24bbf76667960a2aee4694ae
After manually removing the record holding the same unique field the deletion of the field variable was allowed and therefore the hash was recalculated.
SHA after changes: 8db02dab81f332cf6bb24babbb39253063ce6569db7e32c3ced5758b9789d9ec
JSON after changes
Approved: Tested on trunk_e15f58e, Docker, macOS 14.5, FF v126.0.1
Parent Issue
29459
User Story
If in a unique fields the uniquePerSite field variable is changed then be need recalculated the unique_key hash values for the unique_table, to include or exclude the host id according to the new value.
We need to create a API/Factory methods to do this.
Acceptance Criteria
Proposed Objective
Core Features
Proposed Priority
Priority 2 - Important
External Links... Slack Conversations, Support Tickets, Figma Designs, etc.
No response
Assumptions & Initiation Needs
No response
Quality Assurance Notes & Workarounds
Steps to Reproduce:
unique_field
table exists. So, run a CURL like this one:My CT
with two fields:Site
Title
, and marked asUnique
, and add a Field Variable nameduniquePerSite
with the value oftrue
.www.empty.com
.My CT
, with THE SAME VALUE for the unique field, but one living underdemo.dotcms.com
and the other one living underwww.empty.com
. They must be created without problem.Title
field, and delete theuniquePerSite
Field Variable.No response
Sub-Tasks & Estimates
No response