This is probably just an issue for people that have updated from a previous version, not installing/configuring for the first time.

A recent update to the module provides configurable error messages. The default messages contain some HTML. Because we updated the module and did not need to update the configurations, these new error messages display using the plain text format, resulting in the actual HTML being displayed in the message rather than the rendered HTML.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kevincrafts created an issue. See original summary.

iamEAP’s picture

Thanks for the report Kevin.

Since the original, default values contained HTML, we ended up going with a formatted HTML field for those configuration messages. The markup eventually gets run through check_markup(). And it looks like that function will eventually pull a fallback filter if no filter is configured.

It's possible that either your fallback filter is somehow unset, or you have your fallback filter is set to "plain text," which I suppose is a totally reasonable fallback depending on your site's use-case.

Suggestions on setting better default format values for those error message variables, welcome!

bander2’s picture

Is it not a good idea to just set SGA_DEFAULT_ERROR_GSA_NO_RESULTS_FORMAT to 'filtered_html'?

iamEAP’s picture

Status: Active » Needs review

My only concern there is that the filtered text format may not even exist... This could be for a variety of reasons: didn't install with the standard profile, D7 site was upgraded from D6 site, etc.

Probably rare. And even in those cases, it'd most likely fall back to plain text (current experience) anyway. So it might be fine?

bander2’s picture

Right. filtered_html can be absent so we can't rely on it. I deleted it, enabled the module and got this error:

Missing text format: filtered_html.

And the display is messed up too.

Could we rely on filter_default_filter to just give us the default of the current logged in user? That way we kind of punt this to Drupal?

iamEAP’s picture

Hmm... That ends up happening by default if you pass in NULL to check_markup(). Maybe instead of calling that ourselves, we can conditionally pass in NULL if the format doesn't exist... Something like:

define('SGA_DEFAULT_ERROR_GSA_NO_RESULTS_FORMAT', 'filtered_html');

// ...

function _google_appliance_get_settings() {
  // ...
  if (!filter_format_load($settings['error_curl_error_format'])) {
    $settings['error_curl_error_format'] = NULL;
  }
  // And the same for the other two message formats.