Show
Ignore:
Timestamp:
12/16/06 19:47:03 (2 years ago)
Author:
scorfield
Message:

Addresses #139 by adding validation of the relative attribute and fixing the repeated circuit bug.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • framework/trunk/fuseboxApplication.cfc

    r272 r276  
    9393                                        hint="I am the myFusebox data structure." /> 
    9494                 
    95                 <!--- fixed ticket 164 ---> 
     95                <!--- update to ticket 139 ---> 
    9696                <cfset var myVersion = "5.0.1.#REReplace('$LastChangedRevision$','[^0-9]','','all')#" /> 
    9797 
     
    650650                                <cfthrow type="fusebox.badGrammar.requiredAttributeMissing" 
    651651                                                message="Required attribute is missing" 
    652                                                 detail="The attribute 'path' is required, for a 'circuit' declaration in fusebox.xml." /> 
     652                                                detail="The attribute 'path' is required, for the declaration of circuit '#children[i].xmlAttributes.alias#' in fusebox.xml." /> 
    653653                        </cfif> 
    654654                        <cfif structKeyExists(children[i].xmlAttributes,"parent")> 
     
    660660                        </cfif> 
    661661                        <cfif structKeyExists(children[i].xmlAttributes,"relative")> 
    662                                 <!--- TODO: check it is boolean ---> 
     662                                <cfif listFind("true,false,yes,no",children[1].xmlAttributes.relative) eq 0> 
     663                                        <cfthrow type="fusebox.badGrammar.invalidAttributeValue" 
     664                                                        message="Attribute has invalid value"  
     665                                                        detail="The attribute 'relative' must either be ""true"" or ""false"", for the declaration of circuit '#children[i].xmlAttributes.alias#' in fusebox.xml." /> 
     666                                </cfif> 
    663667                                <cfset relative = children[i].xmlAttributes.relative /> 
    664668                                <cfset nAttrs = nAttrs + 1 /> 
    665669                        <cfelse> 
     670                                <cfset relative = true /> 
    666671                                <cfset parent = "" /> 
    667672                        </cfif> 
     
    669674                                <cfthrow type="fusebox.badGrammar.unexpectedAttributes" 
    670675                                                message="Unexpected attributes" 
    671                                                 detail="Attributes other than 'alias', 'path' and 'parent' were found in the declaration of the '#alias#' circuit in fusebox.xml." /> 
     676                                                detail="Attributes other than 'alias', 'path' and 'parent' were found for the declaration of circuit '#children[i].xmlAttributes.alias#' in fusebox.xml." /> 
    672677                        </cfif> 
    673678                        <cfset alias = children[i].xmlAttributes.alias />