
| Key: |
FC-1585
|
| Type: |
Bug
|
| Status: |
Closed
|
| Resolution: |
Fixed
|
| Priority: |
Minor
|
| Assignee: |
Unassigned
|
| Reporter: |
Frank Brea
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
|
| Component/s: |
None
|
| Affects Version/s: |
FarCry 5.0 (Fortress),
4.0.10,
4.0.11,
5.0.1,
5.0.2
|
| Fix Version/s: |
FarCry 5.1
|
|
|
When creating a draft object then rules defined within live objects container are not completely created if rule has a property type of category. What happens when user edits such a rule the category tree has no selected categories, even though they are defined within the rule object.
This is because when the rule is create via the create draft process the refCategories table is not updated since the "copyContainers" method of containers.cfc only duplicates the rules object data and doesnt bother adding the category ids to refCategories, since refCategories is only used to render the category tree when editing a rule no categories are selected.
To fix edit function "copyContainers" under /core/packages/rule/container.cfc
add the following code
<!--- if rule has a property of ftType category then create relevant entries in refCategories --->
<cfloop list="#structKeyList(application.stCoapi[ruletype].stProps)#" index="propertyName">
<cfif structKeyExists(application.stCoapi[ruletype].stProps[propertyName].metadata,"ftType") AND application.stCoapi[ruletype].stProps[propertyName].metadata.ftType EQ "category">
<cfset oCategories = createObject("component","#application.packagepath#.farcry.category") />
<cfset temp = oCategories.copyCategories(srcObjectID=st.aRules[x],destObjectID=stRule.objectID) />
</cfif>
</cfloop>
below line "<cfset stRule = application.coapi.coapiUtilities.createCopy(objectid=st.aRules[x]) />"
and above line "<!--- //create the rule --->"
|
|
Description
|
When creating a draft object then rules defined within live objects container are not completely created if rule has a property type of category. What happens when user edits such a rule the category tree has no selected categories, even though they are defined within the rule object.
This is because when the rule is create via the create draft process the refCategories table is not updated since the "copyContainers" method of containers.cfc only duplicates the rules object data and doesnt bother adding the category ids to refCategories, since refCategories is only used to render the category tree when editing a rule no categories are selected.
To fix edit function "copyContainers" under /core/packages/rule/container.cfc
add the following code
<!--- if rule has a property of ftType category then create relevant entries in refCategories --->
<cfloop list="#structKeyList(application.stCoapi[ruletype].stProps)#" index="propertyName">
<cfif structKeyExists(application.stCoapi[ruletype].stProps[propertyName].metadata,"ftType") AND application.stCoapi[ruletype].stProps[propertyName].metadata.ftType EQ "category">
<cfset oCategories = createObject("component","#application.packagepath#.farcry.category") />
<cfset temp = oCategories.copyCategories(srcObjectID=st.aRules[x],destObjectID=stRule.objectID) />
</cfif>
</cfloop>
below line "<cfset stRule = application.coapi.coapiUtilities.createCopy(objectid=st.aRules[x]) />"
and above line "<!--- //create the rule --->"
|
Show » |
|