The token [entity_legal_document:url] used in the Acceptance Label field on the /admin/structure/legal/manage/terms_conditions/manage/xxxx page doesn't exist.

This works if [entity_legal_document:published-version:url], it seemed the best choice to use as I couldn't think of a real case where it wouldn't be the right document to link to. Patch to follow shortly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AndyD328 created an issue. See original summary.

AndyD328’s picture

Assigned: AndyD328 » Unassigned
Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: url-token-doesnt-exist-2789031-2.patch, failed testing.

The last submitted patch, 2: url-token-doesnt-exist-2789031-2.patch, failed testing.

The last submitted patch, 2: url-token-doesnt-exist-2789031-2.patch, failed testing.

The last submitted patch, 2: url-token-doesnt-exist-2789031-2.patch, failed testing.

The last submitted patch, 2: url-token-doesnt-exist-2789031-2.patch, failed testing.

Christopher Riley’s picture

This patch fixed part of my issue with setting a url alias however its not passing tests and it is not giving the correct URL when you select checkbox on signup form. For example I have mine at /about/privacy but it instead shows: http://staging.website.com/user/url] as the link.

Can we do something officially about this please?

Thanks in advance

codesidekick’s picture

Assigned: Unassigned » alex.skrypnyk

Assigning to Alex as I'm on a Drupal holiday for the time being.

svendecabooter’s picture

The patch in #2 seems to work, but does not return the path alias that is set for the legal document.
Attached is a patch that provides token logic for the originally-set [entity_legal_document:url] token.
It sets the Url correctly in the acceptance label, and uses the path alias if one is set.

Status: Needs review » Needs work

The last submitted patch, 11: url_token_doesn_t_exist-2789031-11.patch, failed testing.

svendecabooter’s picture

Status: Needs work » Needs review

Retested failing tests, and now everything is green.

tormi’s picture

Status: Needs review » Reviewed & tested by the community

RTBC

jcandan’s picture

This is still not quite right, and given this is marked RTBC I am unsure if a new ticket is needed. [entity_legal_document:published-version:url] links to the revision, not the published content itself. Note, this page displays the breadcrumb of the parent, published content.

Two possible improvements: either [entity_legal_document:url] be created to point to the published content, or [entity_legal_document:published-version:url] be made to point to the published content, and not the revision.

neerajsingh’s picture

Let us have a follow up issue to work on #15.

neerajsingh’s picture

Status: Reviewed & tested by the community » Fixed

committed the patch to 8.x-2.x branch, also a follow up issue for #15 created at #2956032: URL token .

Status: Fixed » Closed (fixed)

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