Fix saving new media providers without `html` via GUI
authorMatthias Schmidt <gravatronics@live.com>
Wed, 17 Oct 2018 17:01:48 +0000 (19:01 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 17 Oct 2018 17:01:48 +0000 (19:01 +0200)
See #2545

wcfsetup/install/files/lib/system/package/plugin/MediaProviderPackageInstallationPlugin.class.php

index 77bea3bbc15d98e21fa0688cdaee82e2874c566a..46ee6dbf1c3976ebe13a4441f32b1601650a48a1 100644 (file)
@@ -193,6 +193,10 @@ class MediaProviderPackageInstallationPlugin extends AbstractXMLPackageInstallat
                if ($html !== null) {
                        $data['html'] = $html->nodeValue;
                }
+               else if ($saveData) {
+                       // when saving data, `html` has to be present
+                       $data['html'] = '';
+               }
                
                $className = $element->getElementsByTagName('className')->item(0);
                if ($className !== null) {