Better implementation of CMS_API.source_of_path_alias (a_alias).

That now returns the path, only if the alias exists, otherwise returns Void.
Improved path alias validation.
This commit is contained in:
2015-07-07 17:40:12 +02:00
parent cc94c59eed
commit 85cff0b139
3 changed files with 16 additions and 8 deletions

View File

@@ -122,8 +122,10 @@ feature -- Forms ...
else
-- TODO: implement full path alias validation
end
if attached a_response.api.location_alias (f_path_alias) as l_aliased_location then
fd.report_invalid_field ("path_alias", "Path is already aliazed to location %"" + l_aliased_location + "%" !")
if
attached a_response.api.source_of_path_alias (f_path_alias) as l_aliased_location
then
fd.report_invalid_field ("path_alias", "Path is already aliased to location %"" + a_response.link (Void, l_aliased_location, Void) + "%" !")
end
end
end(?, response)