Skip to content

Commit

Permalink
fix(performance): use cloneDeepSchema for cloning the schema to avoid…
Browse files Browse the repository at this point in the history
… potential errors
  • Loading branch information
ichim-david committed Nov 15, 2023
1 parent 4243468 commit 725ed0d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/manage/Blocks/Accordion/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import {
getBlocksLayoutFieldname,
withBlockExtensions,
} from '@plone/volto/helpers';
import { cloneDeepSchema } from '@plone/volto/helpers/Utils/Utils';
import helpSVG from '@plone/volto/icons/help.svg';
import { isEmpty, without, cloneDeep, pickBy } from 'lodash';
import { isEmpty, without, pickBy } from 'lodash';
import React, { useState } from 'react';
import { Button, Segment } from 'semantic-ui-react';
import { defineMessages, useIntl } from 'react-intl';
Expand Down Expand Up @@ -131,8 +132,12 @@ const Edit = (props) => {
schemaEnhancer = activeItem?.['schemaEnhancer'];

schema = schemaEnhancer
? schemaEnhancer({ schema: cloneDeep(originalSchema), formData, intl })
: cloneDeep(originalSchema);
? schemaEnhancer({
schema: cloneDeepSchema(originalSchema),
formData,
intl,
})
: cloneDeepSchema(originalSchema);

return schema;
};
Expand Down

0 comments on commit 725ed0d

Please sign in to comment.