Follow-up to #2826688: Link fields should pass the URL, not only the title

Problem/Motivation

When URLs are translated with Lingotek, we must validate them before storing. This is specially relevant when users are using automatic translations.

Proposed resolution

Validate the URIs before saving. If they are invalid, log a warning and store the same URI as the source.

Remaining tasks

Fix + tests

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

penyaskito created an issue. See original summary.

penyaskito’s picture

Work in progress, some tests fail with the fallback of the original source uris.

Status: Needs review » Needs work

The last submitted patch, 2: 2844532-2.patch, failed testing.

penyaskito’s picture

Found the problem, we were not assigning the original alias correctly. Also found some issues when an exception is thrown, the right message was not shown because we were returning TRUE.

The last submitted patch, 4: 2844532-uris-validation-4.only-tests.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: 2844532-uris-validation-4.patch, failed testing.

penyaskito’s picture

Fixed branch tests at #2846203: Fix build after Content Cloud Beta was committed, let's requeue them

penyaskito’s picture

Status: Needs work » Reviewed & tested by the community

Tests passed and failed as expected.

  • penyaskito committed 6da647e on 8.x-1.x
    Issue #2844532 by penyaskito: When URLs are translated with Lingotek, we...
penyaskito’s picture

Status: Reviewed & tested by the community » Fixed
FileSize
19.47 KB

Committed 6da647e and pushed to 8.x-1.x. Thanks!
Fixed phpcs errors on commit. Interdiff attached.

Status: Fixed » Closed (fixed)

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