Closed (fixed)
Project:
Services Views
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
16 Jul 2012 at 20:59 UTC
Updated:
9 Apr 2013 at 06:59 UTC
Jump to comment: Most recent file
We need to add validation if the path already exists in already defined resources.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | services_views-1688272-validate-resource-path-5.patch | 1.76 KB | asgorobets |
| #2 | services_views-1688272-validate-resource-path-2.patch | 1.94 KB | asgorobets |
Comments
Comment #1
asgorobets commentedComment #2
asgorobets commentedComment #3
ygerasimov commentedwhy do we need to implement has_path()?
Comment should end with dot.
No need for switch construction. Simple "if" will do the job here.
Why do we need this method?
Comment #4
asgorobets commentedfunction has_path() { return TRUE; }- this will say display parent validate function to validate empty paths. This is needed in case we create a new display, default path will be '/', we need to avoid empty paths.
switch statement was changed to if
we don't need to redeclare validate(), has been removed
added dots to comments
Comment #5
ygerasimov commentedCommitted. Thank you! c4dfac1
Comment #7
alex.skrypnykThe regexp in provided patch does not allow to add dot (.) as the part of the path (canonical name). This leads to the problem with a format of returned data in case if requester did not specify header 'Accept' and value.
To determine in which format to return results, Services uses either the extension of canonical name OR value of 'Accept' header. If none of them are set - the behaviour is not predictable.
Example of such problem would be a service path /services/rest/some-feed not returning correct results for IE6-9 and any other custom parsers that do not set header.
The solution is to add '.' into regular expression provided in the patch, so the line
becomes