SafeMarkup::format() in RedirectLoopException.php is deprecated and scheduled for removal in Drupal 9.0.0. We should use \Drupal\Component\Render\FormattableMarkup instead.

CommentFileSizeAuthor
#2 deprecated_safemarkup_call-3005422-2.patch890 byteslaravz

Comments

LaravZ created an issue. See original summary.

laravz’s picture

StatusFileSize
new890 bytes
laravz’s picture

Status: Active » Needs review
berdir’s picture

Status: Needs review » Needs work

thanks, but this is a pretty bad pattern anyway, since we then use this dynamic message again and log it, resulting in translating it again there.

Using safe markup or formattable markup in exception messages deprecated anyway, what we should instead is add properties and getter methods for this information, so that in \Drupal\redirect\EventSubscriber\RedirectRequestSubscriber::onKernelRequestCheckRedirect, where we catch it, we log the it with the original message with placeholders.

The exception message itself then doesn't need to use % anymore and can just concatenate things together.

kristen pol’s picture

Issue tags: +Drupal 9 compatibility

Per a Slack discussion with Gábor Hojtsy regarding usage of D9 tags (Drupal 9, Drupal 9 compatibility, Drupal 9 readiness, etc.), "Drupal 9 compatibility" should be used for contributed projects that need updating and "Drupal 9" was the old tag for D8 issues before the D9 branch was ready. Doing tag cleanup here based on that discussion.

idebr’s picture

Status: Needs work » Closed (outdated)