+ removed inline var for older delphi versions still supported

This commit is contained in:
Daniele Teti 2021-11-05 09:27:28 +01:00
parent a5a147c91d
commit eceefb2366
3 changed files with 17 additions and 3 deletions

View File

@ -583,7 +583,7 @@ The current beta release is named 3.2.2-nitrogen. If you want to stay on the-edg
- Uniformed behavior in `Update` and `Delete` method in `TMVCActiveRecord`. Now these methods raise an exception if the record doesn't exists anymore in the table (update or delete statements return `AffectedRows` = 0). The behavior can be altered using the new parameter in the call, which by default is `true`. WARNING! This change could raise some incompatibilities with the previous version, however this is the correct behavior. Consider the previous one a "incorrect behavior to fix". - Uniformed behavior in `Update` and `Delete` method in `TMVCActiveRecord`. Now these methods raise an exception if the record doesn't exists anymore in the table (update or delete statements return `AffectedRows` = 0). The behavior can be altered using the new parameter in the call, which by default is `true`. WARNING! This change could raise some incompatibilities with the previous version, however this is the correct behavior. Consider the previous one a "incorrect behavior to fix".
- Fix https://github.com/danieleteti/delphimvcframework/issues/489 - Fix https://github.com/danieleteti/delphimvcframework/issues/489
- Fix https://github.com/danieleteti/delphimvcframework/issues/518 (Thanks to [Microcom-Bjarne](https://github.com/Microcom-Bjarne)) - Fix https://github.com/danieleteti/delphimvcframework/issues/518 (Thanks to [Microcom-Bjarne](https://github.com/Microcom-Bjarne))
- Fix https://github.com/danieleteti/delphimvcframework/issues/526 (Thanks to [David Moorhouse](https://github.com/fastbike) - Fix https://github.com/danieleteti/delphimvcframework/issues/526 (Thanks to [David Moorhouse](https://github.com/fastbike))
## Older Releases ## Older Releases

View File

@ -805,18 +805,21 @@ procedure SplitContentMediaTypeAndCharset(const aContentType: string;
var aContentMediaType: string; var aContentCharSet: string); var aContentMediaType: string; var aContentCharSet: string);
var var
lContentTypeValues: TArray<string>; lContentTypeValues: TArray<string>;
I,J: Integer;
begin begin
if not aContentType.IsEmpty then if not aContentType.IsEmpty then
begin begin
lContentTypeValues := aContentType.Split([';']); lContentTypeValues := aContentType.Split([';']);
aContentCharSet := ''; aContentCharSet := '';
for var I := low(lContentTypeValues) to high(lContentTypeValues) do for I := low(lContentTypeValues) to high(lContentTypeValues) do
begin begin
if lContentTypeValues[I].Trim.StartsWith('charset', True) then if lContentTypeValues[I].Trim.StartsWith('charset', True) then
begin begin
aContentCharSet := lContentTypeValues[I].Trim.Split(['='])[1].Trim; aContentCharSet := lContentTypeValues[I].Trim.Split(['='])[1].Trim;
for var J := I + 1 to high(lContentTypeValues) do for J := I + 1 to high(lContentTypeValues) do
begin
lContentTypeValues[J - 1] := lContentTypeValues[J]; lContentTypeValues[J - 1] := lContentTypeValues[J];
end;
SetLength(lContentTypeValues, Length(lContentTypeValues) - 1); SetLength(lContentTypeValues, Length(lContentTypeValues) - 1);
Break; Break;
end; end;

View File

@ -325,6 +325,10 @@ type
[MVCHTTPMethod([httpGET])] [MVCHTTPMethod([httpGET])]
[MVCPath('/issues/406')] [MVCPath('/issues/406')]
procedure TestIssue406; procedure TestIssue406;
[MVCHTTPMethod([httpGET])]
[MVCPath('/issues/526')]
procedure TestIssue526;
end; end;
[MVCPath('/private')] [MVCPath('/private')]
@ -782,6 +786,13 @@ begin
Render(HTTP_STATUS.UnprocessableEntity, TMVCErrorResponseItem.Create('The Message')); Render(HTTP_STATUS.UnprocessableEntity, TMVCErrorResponseItem.Create('The Message'));
end; end;
procedure TTestServerController.TestIssue526;
begin
ContentType := 'application/fhir+xml; fhirVersion=4.0';
ResponseStream.Append('OK');
RenderResponseStream;
end;
procedure TTestServerController.TestJSONArrayAsObjectList; procedure TTestServerController.TestJSONArrayAsObjectList;
var var
lUsers: TObjectList<TCustomer>; lUsers: TObjectList<TCustomer>;