Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(binary field): Wrong naming and scope of variable #29603

Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@

<script type="text/javascript">

var binaryFieldCallbacksMap = {} // This is a map to store the callbacks for the binary fields, used to reload them when we publish or save a contentlet, look on dotCMS/src/main/webapp/html/portlet/ext/contentlet/edit_contentlet_js_inc.jsp on saveContentCallback function
const relationsLoadedMap = {};

function waitForRelation() {
Expand Down Expand Up @@ -137,10 +138,10 @@

<script language="javascript">
require(["vs/editor/editor.main"], function() {
// Hack to avoid MonacoEditorLoaderService to load the editor again
// Hack to avoid MonacoEditorLoaderService to load the editor again
// That service not works in `dojo` environment Dojo amdLoader. See docs: [https://dojotoolkit.org/reference-guide/1.7/loader/amd.html?highlight=packages%20location%20name%20main]
window.monacoEditorAlreadyInitialized = !!window.monaco;
});
});
</script>

<%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,6 @@
}
}
</style>

<script>
var binaryCallbacksMap = {} // This is a map to store the callbacks for the binary fields, used to reload them when we publish or save a contentlet, look on dotCMS/src/main/webapp/html/portlet/ext/contentlet/edit_contentlet_js_inc.jsp on saveContentCallback function
</script>


<div class="fieldWrapper" >
<div class="fieldName" id="<%=field.getVelocityVarName()%>_tag">
<% if (hint != null) {%>
Expand Down Expand Up @@ -882,9 +876,10 @@ var binaryCallbacksMap = {} // This is a map to store the callbacks for the bina

setBinaryFieldInputs(); // Initialize the binary Field


// This code covers the multiple binaries in a contentlet
if(!binaryCallbacksMap["<%=field.getVelocityVarName()%>"]) {
binaryCallbacksMap["<%=field.getVelocityVarName()%>"] = setBinaryFieldInputs; // Register the function to be called when the contentlet is saved
if(!binaryFieldCallbacksMap["<%=field.getVelocityVarName()%>"]) {
binaryFieldCallbacksMap["<%=field.getVelocityVarName()%>"] = setBinaryFieldInputs; // Register the function to be called when the contentlet is saved
}
</script>
<%}else{%>
Expand Down