Currently when we take the json, we get the node id of the content.

It would be nice to add an option of get the Url Alias of the content if the url alias exists.

like "/friendly/url" instaed of just the option of "/node/201"

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dimr created an issue. See original summary.

alexecus’s picture

I've added a patch that adds that functionality

alexecus’s picture

Status: Active » Needs review

fabianderijk’s picture

Thanks! I have committed your patch!

fabianderijk’s picture

Status: Needs review » Fixed
fschwic’s picture

Hello, I installed the current dev version. I see the 'alias' entry but it contains the same as 'uri'. Should the alias work in dev version? The respective alias I set in "URL path settings", field "URL alias" for the nodes.

"uri": "node/183",
"alias": "node/183",
dimr’s picture

Status: Fixed » Active
FileSize
3.73 KB

Hi,

thanks for the functionality!, I have checked it but as fschwic the value of "alias" is the same as "uri". I had a look into the code and I found a tiny bug that I have resolved, I made the change in the #2 patch.

I have changed

+ 'alias' => ltrim($uri, '/'),
to
+ 'alias' => ltrim($alias, '/'),

dimr’s picture

Status: Active » Needs review
andrechun’s picture

Can confirm the change in #8 fixed the error.

pavlosdan’s picture

Status: Needs review » Reviewed & tested by the community

#8 works for me as well.

  • fabianderijk committed 449ff4c on 8.x-1.x authored by dimr
    Issue #2850484 by dimr, alexecus: Add option to get Url Alias
    
fabianderijk’s picture

Status: Reviewed & tested by the community » Fixed

The change has been added to the dev release of this module.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.