groupoffice
groupoffice copied to clipboard
25.0.18 - Resources delete problems
Hi,
I have found two problems about the resources.
First, there is no option to delete just one resource. There is only option to delete a group of resources.
When I try to delete a group, it loads endlessly and block the UI.
Error in the console :
Uncaught (in promise) TypeError: e.map is not a function
confirmDestroy http://agenda-test.pibomulti.com/views/goui/dist/goui/script/index.js:1
index.js:1:119237
Thanks,
Hi,
I tried on the V25.0.20 and I can now delete a resource. But the group delete doesn't work. An error window appear with an error :
Here new debug log :
CONSOLE :
{
"message": "Database exception. Check server logs for details.",
"type": "dbException",
"debugMessage": "go\\core\\db\\DbException in /usr/share/groupoffice/go/core/db/Statement.php at line 193: Database exception: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`groupoffice`.`calendar_calendar`, CONSTRAINT `fk_calendar_calendar_calendar_resource_group` FOREIGN KEY (`groupId`) REFERENCES `calendar_resource_group` (`id`) ON DELETE RESTRICT), Full SQL: DELETE FROM `rg` USING `calendar_resource_group` AS `rg` \nWHERE \n `rg`.`id` = '3'",
"previous": "SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`groupoffice`.`calendar_calendar`, CONSTRAINT `fk_calendar_calendar_calendar_resource_group` FOREIGN KEY (`groupId`) REFERENCES `calendar_resource_group` (`id`) ON DELETE RESTRICT)",
"trace": [
"#0 /usr/share/groupoffice/go/core/orm/Property.php(2100): go\\core\\db\\Statement->execute()",
"#1 /usr/share/groupoffice/go/core/jmap/Entity.php(396): go\\core\\orm\\Property::internalDelete()",
"#2 /usr/share/groupoffice/go/core/orm/Entity.php(560): go\\core\\jmap\\Entity::internalDelete()",
"#3 /usr/share/groupoffice/go/core/jmap/EntityController.php(920): go\\core\\orm\\Entity::delete()",
"#4 /usr/share/groupoffice/go/core/jmap/EntityController.php(680): go\\core\\jmap\\EntityController->destroyEntities()",
"#5 /usr/share/groupoffice/go/modules/community/calendar/controller/ResourceGroup.php(57): go\\core\\jmap\\EntityController->defaultSet()",
"#6 [internal function]: go\\modules\\community\\calendar\\controller\\ResourceGroup->set()",
"#7 /usr/share/groupoffice/go/core/jmap/Router.php(251): call_user_func()",
"#8 /usr/share/groupoffice/go/core/jmap/Router.php(112): go\\core\\jmap\\Router->callAction()",
"#9 /usr/share/groupoffice/go/core/jmap/Router.php(70): go\\core\\jmap\\Router->callMethod()",
"#10 /usr/share/groupoffice/api/jmap.php(21): go\\core\\jmap\\Router->run()",
"#11 {main}"
]
}
DEBUG :
[2025-05-12 12:57:39][JMAP ResourceGroup/set][log][go\core\jmap\Router:106] Method ResourceGroup/set, ID: ResourceGroup_2
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\ErrorHandler:70]
go\core\db\DbException in /usr/share/groupoffice/go/core/db/Statement.php at line 193: Database exception: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fail>
WHERE
`rg`.`id` = '3'
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\ErrorHandler:74] Previous: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`groupoffice`.`calendar_>
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\ErrorHandler:79] #0 /usr/share/groupoffice/go/core/orm/Property.php(2100): go\core\db\Statement->execute()
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\ErrorHandler:79] #1 /usr/share/groupoffice/go/core/jmap/Entity.php(396): go\core\orm\Property::internalDelete()
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\ErrorHandler:79] #2 /usr/share/groupoffice/go/core/orm/Entity.php(560): go\core\jmap\Entity::internalDelete()
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\ErrorHandler:79] #3 /usr/share/groupoffice/go/core/jmap/EntityController.php(920): go\core\orm\Entity::delete()
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\ErrorHandler:79] #4 /usr/share/groupoffice/go/core/jmap/EntityController.php(680): go\core\jmap\EntityController->destroyEntities()
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\ErrorHandler:79] #5 /usr/share/groupoffice/go/modules/community/calendar/controller/ResourceGroup.php(57): go\core\jmap\EntityController->defaultSet()
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\ErrorHandler:79] #6 [internal function]: go\modules\community\calendar\controller\ResourceGroup->set()
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\ErrorHandler:79] #7 /usr/share/groupoffice/go/core/jmap/Router.php(251): call_user_func()
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\ErrorHandler:79] #8 /usr/share/groupoffice/go/core/jmap/Router.php(112): go\core\jmap\Router->callAction()
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\ErrorHandler:79] #9 /usr/share/groupoffice/go/core/jmap/Router.php(70): go\core\jmap\Router->callMethod()
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\ErrorHandler:79] #10 /usr/share/groupoffice/api/jmap.php(21): go\core\jmap\Router->run()
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\ErrorHandler:79] #11 {main}
[2025-05-12 12:57:39][JMAP ResourceGroup/set][error][go\core\jmap\Response:58]
Array
(
[message] => Database exception. Check server logs for details.
[type] => dbException
[debugMessage] => go\core\db\DbException in /usr/share/groupoffice/go/core/db/Statement.php at line 193: Database exception: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a forei>
WHERE
`rg`.`id` = '3'
[previous] => SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`groupoffice`.`calendar_calendar`, CONSTRAINT `fk_calendar_calendar_calendar_resource_>
[trace] => Array
(
[0] => #0 /usr/share/groupoffice/go/core/orm/Property.php(2100): go\core\db\Statement->execute()
[1] => #1 /usr/share/groupoffice/go/core/jmap/Entity.php(396): go\core\orm\Property::internalDelete()
[2] => #2 /usr/share/groupoffice/go/core/orm/Entity.php(560): go\core\jmap\Entity::internalDelete()
[3] => #3 /usr/share/groupoffice/go/core/jmap/EntityController.php(920): go\core\orm\Entity::delete()
[4] => #4 /usr/share/groupoffice/go/core/jmap/EntityController.php(680): go\core\jmap\EntityController->destroyEntities()
[5] => #5 /usr/share/groupoffice/go/modules/community/calendar/controller/ResourceGroup.php(57): go\core\jmap\EntityController->defaultSet()
[6] => #6 [internal function]: go\modules\community\calendar\controller\ResourceGroup->set()
[7] => #7 /usr/share/groupoffice/go/core/jmap/Router.php(251): call_user_func()
[8] => #8 /usr/share/groupoffice/go/core/jmap/Router.php(112): go\core\jmap\Router->callAction()
[9] => #9 /usr/share/groupoffice/go/core/jmap/Router.php(70): go\core\jmap\Router->callMethod()
[10] => #10 /usr/share/groupoffice/api/jmap.php(21): go\core\jmap\Router->run()
[11] => #11 {main}
)
)
[2025-05-12 12:57:39][JMAP ResourceGroup/set][log][go\core\orm\EntityType:593] Pushing 2 JMAP sync changes
[2025-05-12 12:57:42][sse.php][log][go\core\model\PushDispatcher:143] Closing DB connection: 9679
Maybe because of attached event to user ?
You can only delete empty resource groups at the moment. I will create a popup asking to delete all the remaining resources in the group as well.