Edit Tool Group dialog shows "already exists" message for every save error
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- java, javascript
Línea de trabajo
Empieza en dotCMS/src/main/webapp/html/portlet/ext/roleadmin/view_roles_js_inc.jsp en saveLayoutException y luego sigue dónde se usa el manejador en addNewLayout. Comprueba cómo se pasa el error del servidor al manejador y cómo se identifica el conflicto de nombres existente. El trabajo estará terminado cuando ambas rutas de guardado muestren el conflicto de nombres solo para esa excepción, se muestren los demás errores del servidor y un guardado correcto siga cerrando el diálogo y mostrando el mensaje de guardado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem Statement
In System > Roles & Tools > Tools, the Edit Tool Group dialog shows "Another Tool Group already exists in the system with the same name" (another-layout-already-exists) for every error that happens on Save, not only when the name is taken.
The cause is in saveLayoutException in dotCMS/src/main/webapp/html/portlet/ext/roleadmin/view_roles_js_inc.jsp:
function saveLayoutException(message, exception) {
if(exception.javaClassName = 'com.dotmarketing.business.LayoutNameAlreadyExistsException') {
dojo.byId('addLayoutErrorMessagesList').innerHTML = anotherLayoutAlreadyExistsMsg
return;
}
}
The condition uses = (assignment) instead of === (comparison), so it is always true and the real error is never shown.
This became easier to hit after https://github.com/dotCMS/core/pull/36345, which made RoleAjax.updateLayout require a CMS Administrator. A back-end user who can open Roles & Tools but is not a CMS Administrator can still open the dialog and click Save. The server correctly refuses with "User does not have permission to update layouts", but the dialog tells them the name is taken. They then try other names, when the real answer is that they are not allowed. Any other server error on Save (a database error, for example) is hidden the same way.
Impact: wrong message only. The server-side check works and nothing is saved.
Steps to Reproduce
- As a CMS Administrator, create a back-end user and a custom tool group that holds the Roles & Tools and Users portlets. Assign that tool group to the user's personal role.
- Create a second custom tool group, for example
Test-Group, holding any portlet. - Log in as the back-end user and go to System > Roles & Tools > Tools.
- Click
Test-Groupto open the Edit Tool Group dialog, change the name toTest-Group-Renamedand click Save.
Expected: the dialog shows the server's error: "User does not have permission to update layouts".
Actual: the dialog shows "Another Tool Group already exists in the system with the same name", although no group has that name. The group is not changed (correct).
Acceptance Criteria
- When Save fails because the name is already used by another tool group, the dialog still shows "Another Tool Group already exists in the system with the same name".
- When Save fails for any other reason (for example the permission refusal above), the dialog shows the error message returned by the server instead of the "name already exists" text.
- Creating a new tool group (
addNewLayout) uses the same handler and follows the same two rules. - A successful save by a CMS Administrator still closes the dialog and shows the "saved" message.
dotCMS Version
Seen on main (image dotcms/dotcms:trunk_16df8bd). The faulty check is older than that build.
Severity
Low - Minor issue or cosmetic
Links
NA
- Lenguaje dominante
- Java
- Estrellas
- 972
- Forks
- 489
- Merge medio
- 2 d 15 h
- PR fusionados (30 d)
- 206
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dotCMS/core
-
Escape the Binary field hint in the legacy content editor so an apostrophe doesn't break the fieldAbiertoOKR : Customer Support Team : Maintenance Type : Defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 2 días
-
OKR : Customer Support Team : Maintenance Type : Defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días
-
dotCMS : UVE OKR : Customer Support Team : Maintenance Type : Defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
dotCMS/core#38260 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Enable the Add to Bundle action in the Pages portlet row menu (hard-coded disabled since PR 34715)AbiertodotCMS : Push Publishing OKR : Customer Support Team : Maintenance Type : Defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 2 días
-
[TASK] Postman and Karate test stacks sleep 3 s after every writePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. AbiertoTeam : Platform Type : Test Automation
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
dotCMS/core#38225 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de dotCMS/core
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
build
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
MetricsHub/metricshub-community#1472 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
IdentityArrayObjectSet iterator remove may throw ArrayIndexOutOfBoundsExceptionPosiblemente ocupada @jiteshkhatri11 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
javapathfinder/jpf-core#660 · 1 comentario ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día