I can not filter based on the node resource 'url' property. I get a database error when trying to do this because it is meta data. When I print_r the array there is a 'getter callback' that I think needs to be used to somehow translate the value into something filterable.
What I want to do is say /node.json?url=http://www.mysite.com/my-url-alias
This will allow me to match url aliases on the client with those specified in Drupal.
I have managed to intercept the property and value then preprocess by doing a path lookup before it queries the db, changing the path to node ID... patch below..
I am sure there is a better way to do this? There are a couple of keys in node resources that throw DB errors if you try and filter against them
Comment | File | Size | Author |
---|---|---|---|
#1 | preprocess-filter-2388239-1.patch | 1.72 KB | rcaracaus |
Comments
Comment #1
rcaracaus CreditAttribution: rcaracaus commentedComment #2
rcaracaus CreditAttribution: rcaracaus commentedComment #3
jaskaran.nagra CreditAttribution: jaskaran.nagra commentedJust another way to do this (really depends on your personal taste which way you want to go with) is to add url aliases that point to node/[id].json.
For example: page/newpage.json ==> node/1.json
I have written a module, which is currently in sandbox stage, for this.
https://www.drupal.org/sandbox/jaskaran.nagra/2470461
Please review and help towards making it a full project.
https://www.drupal.org/node/2470483
Thanks,
Jask