Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7d39f44

Browse files
committed
fix bugs: Empty html attribute before validate & replace endpoints
1 parentf7c7a58 commit7d39f44

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

‎src/EditorJsWidget.php‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ class EditorJsWidget extends Widget
6565
/**
6666
* @var string|null Url to save editor data
6767
* $endpoints = [
68-
'saveJson' => '',
69-
'uploadImageByFile' => '',
70-
'uploadImageFetchUrl' => ''
71-
]
68+
'saveJson' => '',
69+
'uploadImageByFile' => '',
70+
'uploadImageFetchUrl' => ''
71+
]
7272
*/
7373
public$endpoints = [];
7474

@@ -143,8 +143,6 @@ protected function generateDefaultPlugins()
143143
'field' =>'image',
144144
'additionalRequestHeaders' => [],
145145
'endpoints' => [
146-
'byFile' => Url::to(['/editor-js/upload-file']),
147-
'byUrl' => Url::to(['/editor-js/fetch-url']),
148146
]
149147
]
150148
],
@@ -338,7 +336,7 @@ protected function buildPluginConfig($config, $defaultConfig) {
338336
if (!is_array($config['config']['endpoints'])) {
339337
$config['config']['endpoints'] = [];
340338
}
341-
$config['config']['endpoints']['byFile'] =$byFile;
339+
$config['config']['endpoints']['byUrl'] =$byUrl;
342340
}
343341
}
344342

@@ -393,4 +391,4 @@ protected function registerClientScripts()
393391
";
394392
$view->registerJs($js);
395393
}
396-
}
394+
}

‎src/behaviors/JsonToHtmlBehavior.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class JsonToHtmlBehavior extends Behavior
4343
publicfunctionevents()
4444
{
4545
return [
46+
ActiveRecord::EVENT_BEFORE_VALIDATE =>'beforeSave',
4647
ActiveRecord::EVENT_BEFORE_INSERT =>'beforeSave',
4748
ActiveRecord::EVENT_BEFORE_UPDATE =>'beforeSave',
4849
];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp