Commit 40306f65 authored by Dmitrii Zadorozhnyi's avatar Dmitrii Zadorozhnyi Committed by Joseph Olstad
Browse files

Issue #3271990 by Dmitrii_Zadorozhnyi: PHP 8.0 compatibility. Expected an...

Issue #3271990 by Dmitrii_Zadorozhnyi: PHP 8.0 compatibility. Expected an object instance when accessing an instance property, but saw an expression $comment with type false
parent 17d6c819
Loading
Loading
Loading
Loading
+5 −3
Changes for modules/media_wysiwyg/media_wysiwyg.module: 5 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -240,12 +240,14 @@ function media_wysiwyg_form_wysiwyg_profile_form_alter(&$form, &$form_state) {
function media_wysiwyg_wysiwyg_button_element_validate($element, &$form_state) {
  if (!empty($element['#value'])) {
    $format = filter_format_load($form_state['build_info']['args'][0]->format);
    if (is_object($format)) {
      $filters = filter_list_format($format->format);
      if (empty($filters['media_filter']->status)) {
      form_error($element, t('The <em>Convert Media tags to markup</em> filter must be enabled for the <a href="@format-link">@format format</a> in order to use the Media browser WYSIWYG button.', array(
        '@format-link' => url('admin/config/content/formats/' . $format->format, array('query' => array('destination' => $_GET['q']))),
        form_error($element, t('The <em>Convert Media tags to markup</em> filter must be enabled for the <a href="@format-link">@format format</a> in order to use the Media browser WYSIWYG button.', [
          '@format-link' => url('admin/config/content/formats/' . $format->format, ['query' => ['destination' => $_GET['q']]]),
          '@format' => $format->name,
      )));
        ]));
      }
    }
  }