Skip to content

Commit

Permalink
support for CKEditor field type
Browse files Browse the repository at this point in the history
  • Loading branch information
markmiddleton committed Oct 17, 2024
1 parent 9c55939 commit 0f8dadd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/services/AlgoliaSyncService.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,10 @@ public function prepareAlgoliaSyncElement($element, $action = 'save', $algoliaMe

$rawData = AlgoliaSync::$plugin->algoliaSyncService->getFieldData($element, $field, $fieldHandle);

if (isset($rawData['type']) && in_array($rawData['type'],$arrayFieldTypes)) {
if ($rawData instanceof \craft\ckeditor\data\FieldData) {
$recordUpdate['attributes'][$fieldName] = $rawData->getRawContent();;
}
elseif (isset($rawData['type']) && in_array($rawData['type'], $arrayFieldTypes)) {
$recordUpdate['attributes'][$fieldName] = $rawData['titles'];
$idsFieldName = $fieldName.'Ids';
$recordUpdate['attributes'][$idsFieldName] = $rawData['ids'];
Expand Down

0 comments on commit 0f8dadd

Please sign in to comment.