drupal_set_message($this->t('You must have at least one <a href=":url">image styles</a> defined that uses a focal point effect in order to preview.', array(':url' => '/admin/config/media/image-styles')), 'warning');

This should use the URL class to generate URLs, and ideally generate it from the route name rather than the path.

Currently, this URL is broken if Drupal is running in a subfolder.

Comments

joachim created an issue. See original summary.

bleen’s picture

Status: Active » Needs review
StatusFileSize
new1.23 KB

This should do it

idebr’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
  1. Patch no longer applies to 8.x-1.x
  2. A url placeholder still takes a string, so $image_styles_url = Url::fromRoute('entity.image_style.collection'); will have to be called with ->toString() first. This matches the documentation at #2571689: New :variable placeholder for URLs in HTML attributes added to SafeMarkup::format() and t()
  3. Let's implement the short array syntax.
rajeshwari10’s picture

Assigned: Unassigned » rajeshwari10
rajeshwari10’s picture

Assigned: rajeshwari10 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.23 KB

Hi,

I have made the changes as per said in #3. Please Review the patch.

Thanks.

  • bleen committed 3337c27 on 8.x-1.x authored by rajeshwari10
    Issue #2808659 by rajeshwari10, bleen, idebr: incorrectly formed URL in...
bleen’s picture

Status: Needs review » Fixed

Committed (and fixed a tiny grammatical error that some idiot (read: me) introduced ....

Status: Fixed » Closed (fixed)

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