Hello,
It seems that the path of the node in node.retrieve is unavailable, at least through XMLRPC.
My node as URL alias/path of : my_url_test
This is what I get through the call of node.retrieve (3)
{'body': {'und': [{'format': 'full_html',
'safe_summary': '',
'safe_value': "
,'Body test
\n",
'summary': '',
'value': "Body test"}]},
'changed': '1299685730',
'cid': '0',
'comment': '1',
'comment_count': '0',
'created': '1299677960',
'data': '',
'field_description': [],
'field_keywords': [],
'language': 'en',
'last_comment_name': '',
'last_comment_timestamp': '1299677960',
'last_comment_uid': '0',
'log': '',
'name': '',
'nid': '3',
'picture': '0',
'promote': '0',
'rdf_mapping': {'body': {'predicates': ['content:encoded']},
'changed': {'callback': 'date_iso8601',
'datatype': 'xsd:dateTime',
'predicates': ['dc:modified']},
'comment_count': {'datatype': 'xsd:integer',
'predicates': ['sioc:num_replies']},
'created': {'callback': 'date_iso8601',
'datatype': 'xsd:dateTime',
'predicates': ['dc:date', 'dc:created']},
'last_activity': {'callback': 'date_iso8601',
'datatype': 'xsd:dateTime',
'predicates': ['sioc:last_activity_date']},
'name': {'predicates': ['foaf:name']},
'rdftype': ['foaf:Document'],
'title': {'predicates': ['dc:title']},
'uid': {'predicates': ['sioc:has_creator'], 'type': 'rel'}},
'revision_timestamp': '1299685730',
'revision_uid': '1',
'status': '1',
'sticky': '0',
'title': 'Title test',
'tnid': '0',
'translate': '0',
'type': 'page',
'uid': '0',
'uri': '',
'vid': '3'}
Are the path still accessible via Services 3.x as they were with Services 2.x?
This happens with both 3.x-dev and 3.x-rc1.
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 1086526-path-property-node-resource-retrieve-method-entity_uri.patch | 987 bytes | ygerasimov |
| #4 | uri.patch | 1.44 KB | marcingy |
| #3 | 1086526-path-property-node-resource-retrieve-method.patch | 796 bytes | ygerasimov |
Comments
Comment #1
fe_lix_ commentedI guess that the main reason is that the function used in the module : node_load does not return the path of the node anymore.
Comment #2
marcingy commentedNot really up to speed on 3.x but I don't understand this line in 7.3.x
As this seems like we are forcing every serve to implement a uri callback shouldn't we simple be mapping to
Comment #3
ygerasimov commentedI think (actually I can only guess) that this comes from REST server. Like if you do node index call and receive a list of nodes you can then call links provided in uri propery of each node to get full details of this particular node.
But of course it is useless in case of xmlrpc as there is only one link that should be used for every call.
Regarding this particular case when we call already retireve method it makes no sense to return same path to retrieve the node.
I would remove this uri property comletely from the answer and would add path that is link to this node.
See attached patch.
Comment #4
marcingy commentedBit of a variation on #3 I think we should be using entity uri to allow for implementations that have overridden the default uri on node/nid. Also shouldn't the path returned be absolute. The callback is used in a number of other places specifical in _node_resource_index which should the same logic as _node_resource_retrieve.
_node_resource_update and _node_resource_create also update this field, logically this should be left to core, so I believe the uri operations there should be removed.
New version of patch attached.
Comment #5
ygerasimov commentedWell, I am not quite agree on removing uri from all other calls. I am not sure what uri is for. In my understanding in case of REST server this property is to know url to call in order to get full object. So I would keep uri in all other methods.
If we decide that we do not need uri at all I am sure there is more code should be removed.
Here patch that adds path property and does it with entity_uri.
Comment #6
marcingy commentedAh ok that makes sense, coming from an xmlrpc background I wasn't thinking about endpoints to grab each node in an index, directly via rest. I'm happy to mark this as rtbc now that it is using entity_uri.
Comment #7
kylebrowning commentedComitted.