Skip to content

Commit

Permalink
FIX Force refresh of Elemental brock on version state change
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Rainville committed May 30, 2024
1 parent 35c723d commit 7cbde1e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions client/src/components/ElementEditor/Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { compose } from 'redux';
class Content extends PureComponent {
render() {
const {
id,
element,
fileUrl,
fileTitle,
content,
Expand Down Expand Up @@ -48,7 +48,7 @@ class Content extends PureComponent {
<InlineEditFormComponent
extraClass={extraClass}
onClick={(event) => event.stopPropagation()}
elementId={id}
element={element}
activeTab={activeTab}
onFormInit={onFormInit}
handleLoadingError={handleLoadingError}
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ElementEditor/Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ const Element = (props) => {
onDragEnd={onDragEnd}
/>
<ContentComponent
id={element.id}
element={element}
fileUrl={element.blockSchema.fileURL}
fileTitle={element.blockSchema.fileTitle}
content={getSummary(element, type)}
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/ElementEditor/InlineEditForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ class InlineEditForm extends PureComponent {
}

render() {
const { elementId, extraClass, onClick, onFormInit, formHasState, notVisible } = this.props;
const { element, extraClass, onClick, onFormInit, formHasState, notVisible } = this.props;
const { loadingError } = this.state;

const classNames = classnames('element-editor-editform', extraClass);
const schemaUrl = loadElementSchemaValue('schemaUrl', elementId);
const schemaUrl = loadElementSchemaValue('schemaUrl', element.id) + `?isLiveVersion=${element.isLiveVersion}&isPublished=${element.isPublished}&=version=${element.version}`;

// formTag needs to be a form rather than a div so that the php FormAction that turns into
// a <button type="submit>" submits this <form>, rather than the <form> for the parent page EditForm
Expand Down Expand Up @@ -104,7 +104,7 @@ InlineEditForm.propTypes = {
};

function mapStateToProps(state, ownProps) {
const formName = loadElementFormStateName(ownProps.elementId);
const formName = loadElementFormStateName(ownProps.element.id);

return {
formHasState: state.form.formState && state.form.formState.element &&
Expand Down

0 comments on commit 7cbde1e

Please sign in to comment.