Problem/Motivation
'alternate' links in CE API output have a URL pointing to the backend, e.g.
(imagine example JSON here: contains "href": "https://lupus-decoupled.ddev.site/....", should be "href": "https://lupus-nuxt.ddev.site/....")
These 'alternate' links (to the original node as well as its existing translations) are only added to the output of a node, if the node has a translation.
Steps to reproduce
- add translation to node
- view API output for node
Proposed resolution
See MR, test-only and with proposed fix.
Remaining tasks
Review. Please note:
- MR !74 is meant for review/merging -- but tests fail, just like they do on 1.x, until #3409409: Respect installations with base paths gets merged
- therefore MR!76 is exactly the same commits, but with #3409409 merged in, to prove the fix
- and MR!73 is the first test-only commit, but with #3409409 merged in, to prove the test failed before the fix.
#3409409
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3412044-alternate-links.patch | 1.49 KB | roderik |
Issue fork lupus_decoupled-3412044
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
roderikCreated 1 MR with phpunit test only (fail), 1 MR with the fix on top of it.
I had to include all of #3409409: Respect installations with base paths in order to make the phpunit output make sense, so for a review, you'll need to completely disregard the changes made to files
modules/lupus_decoupled_ce_api/src/BackendApiRequest.phpand (new)tests/src/Unit/LupusDecoupledBackendApiRequestTest.php(i.e. the first 10 commits)Only look at
tests/src/Functional/LupusDecoupledApiResponseTest.php(same commit == same changes in both MRs)modules/lupus_decoupled_ce_api/src/PathProcessor/LupusFrontendPathProcessor.php(in 'real' MR)Comment #5
roderikI guess not "needs review" until I comment the fix...
Comment #6
roderikIt's fine, I don't think it needs public comments because it was commented elsewhere internally.
Comment #7
roderikPatch file with just the actual code change from this issue - not the phpunit test or the stuff from #3409409: Respect installations with base paths
Comment #9
roderikComment #10
roderikI did not change the code since I originally opened the merge requests...
However, I realized that the original "tests green" MR is not for merging, because it contains #3409409: Respect installations with base paths.
So I created separate merge requests:
Comment #11
fagoComment #12
roderikComment #14
fagothanks, reviewed, green and merged!