History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: FC-1585
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Frank Brea
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
FarCry Core Framework

When creating draft object container rules are not created correctly if rule has a property type of category

Created: 05/Nov/08 06:16 PM   Updated: 09/Jul/09 10:22 AM
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

Time Tracking:
Not Specified

Environment: all


 Description  « Hide
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 --->"


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Frank Brea - 12/Nov/08 04:02 PM
changes deployed to trunk 4 and 5