Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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"
Comment | File | Size | Author |
---|---|---|---|
#8 | rest-menu-fix-with-alias-8.patch | 3.73 KB | dimr |
#2 | rest-menu-fix-with-alias.patch | 3.73 KB | alexecus |
Comments
Comment #2
alexecus CreditAttribution: alexecus as a volunteer commentedI've added a patch that adds that functionality
Comment #3
alexecus CreditAttribution: alexecus as a volunteer commentedComment #5
fabianderijkThanks! I have committed your patch!
Comment #6
fabianderijkComment #7
fschwic CreditAttribution: fschwic commentedHello, 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.
Comment #8
dimr CreditAttribution: dimr commentedHi,
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, '/'),
Comment #9
dimr CreditAttribution: dimr commentedComment #10
andrechun CreditAttribution: andrechun commentedCan confirm the change in #8 fixed the error.
Comment #11
pavlosdan CreditAttribution: pavlosdan commented#8 works for me as well.
Comment #13
fabianderijkThe change has been added to the dev release of this module.