feat(main): Make FAQ and slide entities translatable
This commit is contained in:
@@ -146,14 +146,18 @@ final class CustomHtmlBlockDataHandler implements FormDataHandlerInterface
|
||||
CustomHtmlFaq::deleteByBlockId($idBlock);
|
||||
|
||||
foreach (array_values($faqs) as $position => $faqData) {
|
||||
if (empty($faqData['question'])) {
|
||||
$question = $faqData['question'] ?? [];
|
||||
|
||||
if (empty(array_filter($question, static function ($value) {
|
||||
return trim((string) $value) !== '';
|
||||
}))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$faq = new CustomHtmlFaq();
|
||||
$faq->id_ws_customhtml = $idBlock;
|
||||
$faq->question = (string) $faqData['question'];
|
||||
$faq->answer = (string) ($faqData['answer'] ?? '');
|
||||
$faq->question = $question;
|
||||
$faq->answer = $faqData['answer'] ?? [];
|
||||
$faq->ordering = $position;
|
||||
$faq->add();
|
||||
}
|
||||
@@ -181,11 +185,11 @@ final class CustomHtmlBlockDataHandler implements FormDataHandlerInterface
|
||||
|
||||
$slide = new CustomHtmlSlide();
|
||||
$slide->id_ws_customhtml = $idBlock;
|
||||
$slide->title = (string) ($slideData['title'] ?? '');
|
||||
$slide->description = (string) ($slideData['description'] ?? '');
|
||||
$slide->extra_description = (string) ($slideData['extra_description'] ?? '');
|
||||
$slide->link = (string) ($slideData['link'] ?? '');
|
||||
$slide->link_text = (string) ($slideData['link_text'] ?? '');
|
||||
$slide->title = $slideData['title'] ?? [];
|
||||
$slide->description = $slideData['description'] ?? [];
|
||||
$slide->extra_description = $slideData['extra_description'] ?? [];
|
||||
$slide->link = $slideData['link'] ?? [];
|
||||
$slide->link_text = $slideData['link_text'] ?? [];
|
||||
$slide->image = $this->saveUploadedImage($slideData['image'] ?? null, $existingImage);
|
||||
$slide->ordering = $position;
|
||||
$slide->add();
|
||||
|
||||
Reference in New Issue
Block a user