Open rossjones opened 7 years ago
Is the problem with xmlrpclib or with the response from Drupal? I guess you could dig into the code or use wireshark to see the actual request it makes. I suspect Drupal is returning an error message rather than XML.
I can't find anything wrong with Drupal API, this can be tested with curl on prod3:
curl -d '<?xml version="1.0"?><methodCall><methodName>user.retrieve</methodName><params><param><value><string>431275</string></value></param></params></methodCall>' https://data.gov.uk/services/xmlrpc
I've checked the response and it looks like valid XML.
Looking deeper at this it does come back malformed for a different user (431167)
curl --user AUTH:AUTH -d '<?xml version="1.0"?><methodCall><methodName>user.retrieve</methodName><params><param><value><string>431167</string></value></param></params></methodCall>' https://data.gov.uk/services/xmlrpc
When I run it through xmlvalidation.com it says
The element type "struct" must be terminated by the matching end-tag "</struct>".
I can't see any obvious cause, it's probably a bug in a contributed module. I can look at this in depth or alternatively there is REST endpoint available: https://data.gov.uk/services/rest/user/431167 What do you think?
I'd rather fix it properly if we can. The same user has been having issues with being logged out unexpectedly and it's currently blocking me adding a user who needs to publish soon.
I can fix it locally by mangling our database and manually deleted records, but that isn't ideal because I'm not sure of what any knock on effects might be.
I've also noted an issue where a user is allowed to enter a vertical tab character (0xb) in their description. When it is added to XML it makes the XML invalid because it is not encoded.
@ratajczak I've fixed this now by deleting the problematic user from the organisastion, and then removing the vertical tabs from the description of the other user I want to add.
Really we should fix this, but at least we now know what to look for, and should be able to resolve if that happens again - so you may as well leave this until you have free time.
I get a server error whenever I try to add "[user_d431275]" to https://data.gov.uk/publisher/users/traffic-wales
This appears to be an XML validation error when getting user properties from Drupal. I think this is because of the Welsh chars in their user description.
Stacktrace below: