<instruction type="script">acp/post_install.php</instruction>
</instructions>
- <instructions type="update" fromversion="3.0.7">
+ <instructions type="update" fromversion="3.0.8">
<instruction type="acpTemplate" />
<instruction type="template" />
ALTER TABLE wcf1_bbcode_media_provider ADD COLUMN name VARCHAR(80) NOT NULL;
ALTER TABLE wcf1_bbcode_media_provider ADD COLUMN packageID INT(10) NOT NULL;
ALTER TABLE wcf1_bbcode_media_provider ADD COLUMN className varchar(255) NOT NULL DEFAULT '';
+
+-- remove default media providers (they'll be re-added later during the upgrade)
+DELETE FROM wcf1_bbcode_media_provider WHERE title IN ('YouTube', 'YouTube Playlist', 'Vimeo', 'Clipfish', 'Veoh', 'DailyMotion', 'github gist', 'Soundcloud', 'Soundcloud set');
+UPDATE wcf1_bbcode_media_provider SET name = CONCAT('com.woltlab.wcf.generic', providerID);
ALTER TABLE wcf1_bbcode_media_provider ADD UNIQUE KEY name (name, packageID);
ALTER TABLE wcf1_box ADD COLUMN lastUpdateTime INT(10) NOT NULL DEFAULT 0;
<?php
namespace wcf\acp\form;
+use wcf\data\bbcode\media\provider\BBCodeMediaProvider;
use wcf\data\bbcode\media\provider\BBCodeMediaProviderAction;
+use wcf\data\bbcode\media\provider\BBCodeMediaProviderEditor;
use wcf\form\AbstractForm;
use wcf\system\exception\UserInputException;
use wcf\system\Regex;
public function save() {
parent::save();
+ $name = 'placeholder_'.StringUtil::getRandomID();
+
// save media provider
$this->objectAction = new BBCodeMediaProviderAction([], 'create', ['data' => array_merge($this->additionalFields, [
'title' => $this->title,
'html' => $this->html,
'className' => $this->className
])]);
- $this->objectAction->executeAction();
+ $returnValues = $this->objectAction->executeAction();
$this->saved();
+ /** @var BBCodeMediaProvider $provider */
+ $provider = $returnValues['returnValues'];
+ (new BBCodeMediaProviderEditor($provider))->update([
+ 'name' => 'com.woltlab.wcf.generic' . $provider->providerID
+ ]);
+
// reset values
$this->title = $this->regex = $this->html = $this->className = '';