Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Recent GIT commit (http://cgit.drupalcode.org/varnish/commit/?id=c141cbe) brake the logic in syntax error style:
@@ -264,26 +249,46 @@ function theme_varnish_status($variables) {
foreach ($status as $terminal => $state) {
list($server, $port) = explode(':', $terminal);
if ($state == VARNISH_SERVER_STATUS_UP) {
- $icon = theme('image', array('path' => 'misc/watchdog-ok.png', 'alt' => t("Server OK: @server:@port", array('@server' => $server, '@port' => $port)), 'title' => "{$server}:{$port}"));
+ $icon = theme('image', array(
+ 'path' => 'misc/watchdog-ok.png',
+ 'alt' => t("Server OK: @server:@port", array(
+ '@server' => $server, '@port' => $port,
+ )
+ ),
+ 'title' => "{$server}:{$port}"),
+ );
$version = $variables['version'];
if ($version < 3) {
$items[] = t('!status_icon Varnish running. Observe more detailed statistics !link.',
- array('!status_icon' => $icon, '!link' => l(t('here'), 'admin/reports/varnish')));
+ array(
+ '!status_icon' => $icon,
+ '!link' => l(t('here'), 'admin/reports/varnish'),
+ )
+ );
}
else {
$items[] = t('!status_icon Varnish running.', array('!status_icon' => $icon));
}
}
else {
- $icon = theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t("Server down: @server:@port", array('@server' => $server, '@port' => $port)), 'title' => "{$server}:{$port}"));
- $items[] = t('!status_icon The Varnish control terminal is not responding at @server on port @port.', array('!status_icon' => $icon, '@server' => $server, '@port' => $port));
+ $icon = theme('image', array(
+ 'path' => 'misc/watchdog-error.png',
+ 'alt' => t("Server down: @server:@port", array(
+ '@server' => $server, '@port' => $port)
+ ),
+ 'title' => "{$server}:{$port}"));
+ $items[] = t('!status_icon The Varnish control terminal is not responding at @server on port @port.', array(
+ '!status_icon' => $icon,
+ '@server' => $server, '@port' => $port,
+ )
+ );
}
}
return theme('item_list', array('items' => $items));
}
/**
- * Helper function to parse the host from the global $base_url
+ * Helper function to parse the host from the global $base_url.
*/
function _varnish_get_host() {
global $base_url;
This patch fix this issue + double confirm/cleanup with phpcs/coder, tested with 7.x-1.x-dev
Comment | File | Size | Author |
---|---|---|---|
#1 | varnish-syntax_error-2455293-1.patch | 13.97 KB | hswong3i |
Comments
Comment #1
hswong3i CreditAttribution: hswong3i commentedComment #3
MiSc CreditAttribution: MiSc commentedLooks good, committed to latest dev.