Skip to content

Commit

Permalink
Fix hidden errors after structure adjustment
Browse files Browse the repository at this point in the history
Return explicitely False when needed
  • Loading branch information
e-marchand committed Aug 23, 2023
1 parent 6a07244 commit b6277b2
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 25 deletions.
8 changes: 5 additions & 3 deletions Project/Sources/Classes/ACTIONS_PARAMS.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,8 @@ Function checkFormat($name : Text) : Boolean
End if
End if

return False:C215

//=== === === === === === === === === === === === === === === === === === === === ===
// Show current format on disk
Function showFormatOnDisk
Expand Down Expand Up @@ -1998,9 +2000,9 @@ Function dataSourceMenuManager()
Function editList()

/*
$form:=New object(\
"static"; $static; \
"host"; This.path.hostInputControls(True))
$form:=New object(\
"static"; $static; \
"host"; This.path.hostInputControls(True))
$form.folder:=This.path.hostInputControls()
$manifest:=$form.folder.file("manifest.json")
Expand Down
37 changes: 20 additions & 17 deletions Project/Sources/Classes/catalog.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Function verifyStructureAdjustments($publishedTableNames : Collection) : Boolean
If ($dataclass=Null:C1517)

This:C1470.errors.push("The table \""+SHARED.deletedRecordsTable.name+"\" doesn't exists")
return
return False:C215

End if

Expand Down Expand Up @@ -176,7 +176,7 @@ Function verifyStructureAdjustments($publishedTableNames : Collection) : Boolean
//______________________________________________________
End case

return
return False:C215

End if

Expand All @@ -203,7 +203,7 @@ Function verifyStructureAdjustments($publishedTableNames : Collection) : Boolean
//______________________________________________________
End case

return
return False:C215

End if
End for each
Expand All @@ -220,7 +220,7 @@ Function verifyStructureAdjustments($publishedTableNames : Collection) : Boolean
|| ($dataclass[SHARED.stampField.name]=Null:C1517)\
|| ($dataclass[SHARED.stampField.name].type#SHARED.stampField._type)

return
return False:C215

End if
End for each
Expand Down Expand Up @@ -260,7 +260,7 @@ Function checkServerStructure($publishedTableNames : Collection; $rest : Object)
If ($dataclass=Null:C1517)

This:C1470.errors.push("The dataclass \""+SHARED.deletedRecordsTable.name+"\" is missing or is not exposed")
return
return False:C215

End if

Expand All @@ -272,19 +272,19 @@ Function checkServerStructure($publishedTableNames : Collection; $rest : Object)
: ($pk=Null:C1517)

This:C1470.errors.push("The dataclass \""+SHARED.deletedRecordsTable.name+"\" attribute ID is missing")
return
return False:C215

//______________________________________________________
: (Not:C34(Bool:C1537($pk.identifying)))

This:C1470.errors.push("The dataclass \""+SHARED.deletedRecordsTable.name+"\" primary key is not the \"ID\" attribute")
return
return False:C215

//______________________________________________________
: (Not:C34(Bool:C1537($pk.exposed)))

This:C1470.errors.push("The dataclass \""+SHARED.deletedRecordsTable.name+"\" primary key is not exposed")
return
return False:C215

//______________________________________________________
End case
Expand All @@ -305,19 +305,19 @@ Function checkServerStructure($publishedTableNames : Collection; $rest : Object)
: ($field=Null:C1517)

This:C1470.errors.push("The attribute \""+$o.name+"\" of the dataclass \""+SHARED.deletedRecordsTable.name+"\" is missing or not exposed")
return
return False:C215

//______________________________________________________
: (Not:C34(Bool:C1537($field.exposed)))

This:C1470.errors.push("The attribute \""+$o.name+"\" of the dataclass \""+SHARED.deletedRecordsTable.name+"\" is not exposed")
return
return False:C215

//______________________________________________________
: ($map[$field.type]#$o.type)

This:C1470.errors.push("The type of the attribute \""+$o.name+"\" is not correct")
return
return False:C215

//______________________________________________________
End case
Expand All @@ -337,19 +337,19 @@ Function checkServerStructure($publishedTableNames : Collection; $rest : Object)
: ($dataclass=Null:C1517)

This:C1470.errors.push("The publishing dataclass \""+$table+"\" is missing on the server")
return
return False:C215

//______________________________________________________
: ($dataclass[SHARED.stampField.name]=Null:C1517)

This:C1470.errors.push("The attribute \""+SHARED.stampField.name+"\" of the dataclass \""+$table+"\" is missing or not exposed")
return
return False:C215

//______________________________________________________
: ($map[$dataclass[SHARED.stampField.name].type]#SHARED.stampField.type)

This:C1470.errors.push("The type of the attribute \""+SHARED.stampField.name+"\" of the dataclass \""+$table+"\" is not correct")
return
return False:C215

//______________________________________________________
End case
Expand Down Expand Up @@ -415,7 +415,8 @@ Function doStructureAdjustments($publishedTableNames : Collection) : Boolean
If ($error.withError())

This:C1470.errors.push(JSON Stringify:C1217($error.errors())+" ("+DOCUMENT+")")
return
$error.release()
return False:C215

End if
End for each
Expand Down Expand Up @@ -446,7 +447,8 @@ Function doStructureAdjustments($publishedTableNames : Collection) : Boolean
Else

This:C1470.errors.push(JSON Stringify:C1217($error.errors())+" ("+DOCUMENT+")")
return
$error.release()
return False:C215

End if
End if
Expand Down Expand Up @@ -506,7 +508,8 @@ Function doStructureAdjustments($publishedTableNames : Collection) : Boolean
Else

This:C1470.errors.push(JSON Stringify:C1217($error.errors())+" ("+DOCUMENT+")")
return
$error.release()
return False:C215

End if
End if
Expand Down
2 changes: 1 addition & 1 deletion Project/Sources/Classes/dev.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Function _doAssert($data : Object) : Boolean

If ($data=Null:C1517)

return // Force
return False:C215 // Force

End if

Expand Down
8 changes: 4 additions & 4 deletions Project/Sources/Classes/http.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ Function ping($url : Text) : Boolean

return True:C214

Else

This:C1470._decodeError()

End if

This:C1470._decodeError()

return False:C215

//=== === === === === === === === === === === === === === === === === === === === === === === === === ===
// Returns the methods allowed on the server
Function allow($url : Text) : Collection
Expand Down
2 changes: 2 additions & 0 deletions Project/Sources/Classes/project.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,8 @@ Function isLink($field : cs:C1710.field) : Boolean
End if
End for each

return False:C215

//=== === === === === === === === === === === === === === === === === === === === === === === === === === === ===
Function checkRestQueryFilter($table : Object)

Expand Down

0 comments on commit b6277b2

Please sign in to comment.