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

[dev.icinga.com #13109] Cannot edit or delete timeperiods #586

Closed
icinga-migration opened this issue Nov 9, 2016 · 3 comments
Closed

[dev.icinga.com #13109] Cannot edit or delete timeperiods #586

icinga-migration opened this issue Nov 9, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/13109

Created by dzalewski on 2016-11-09 14:30:27 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-11-09 15:32:24 +00:00 (in Redmine)


Hi,

I've defined wrong time period range "00:00:-24:00" instead of "00:00-24:00" (notice extra full colon after 00). When I try to change it, nothing happens and I'm getting a yellow notification a the bottom saying that object has not been modified (see attached screenshot)

In addition to that when I try to delete this timeperiod , director doesn't allow me to that and comes back with an error:

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails ("director"."director_job", CONSTRAINT "director_job_period" FOREIGN KEY ("timeperiod_id") REFERENCES "icinga_timeperiod" ("id") ON UPDATE CASCADE), query was: DELETE FROM icinga_timeperiod WHERE (id = '1')


#0 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute(Array)
#1 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute(Array)
#2 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php(232): Zend_Db_Adapter_Abstract->query('DELETE FROM ici...', Array)
#3 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(652): Zend_Db_Adapter_Pdo_Abstract->query('DELETE FROM ici...')
#4 /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php(790): Zend_Db_Adapter_Abstract->delete('icinga_timeperi...', 'id = '1'')
#5 /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php(912): Icinga\Module\Director\Data\Db\DbObject->deleteFromDb()
#6 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/DirectorObjectForm.php(644): Icinga\Module\Director\Data\Db\DbObject->delete()
#7 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/DirectorObjectForm.php(586): Icinga\Module\Director\Web\Form\DirectorObjectForm->deleteObject(Object(Icinga\Module\Director\Objects\IcingaTimePeriod))
#8 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(450): Icinga\Module\Director\Web\Form\DirectorObjectForm->onRequest()
#9 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(462): Icinga\Module\Director\Web\Form\QuickForm->setRequest(Object(Icinga\Web\Request))
#10 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(322): Icinga\Module\Director\Web\Form\QuickForm->getRequest()
#11 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectController.php(166): Icinga\Module\Director\Web\Form\QuickForm->handleRequest()
#12 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectController.php(104): Icinga\Module\Director\Web\Controller\ObjectController->editAction()
#13 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Director\Web\Controller\ObjectController->indexAction()
#14 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('indexAction')
#15 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#16 /usr/share/php/Icinga/Application/Web.php(384): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#17 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
#18 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#19 {main}
I'm using following versions:

Icinga2 2.5.4
Icingaweb2 2.5.4
Director (github checkout from Nov 4th)
MariaDB 5.5.50
RHEL 7.2

Thanks

Dominik

Attachments

@icinga-migration
Copy link
Author

Updated by dzalewski on 2016-11-09 14:38:00 +00:00

I was editing ranges under wrong tab! They can be changed under Ranges tab and not under Timeperiod tab.

It is bit confusing that all fields under Timeperiod tab look like can be edited but actually you can change Timeperiod and Display Name fields only.

I think it would make more sense for ranges filed under Timeperiod tab to be locked and not editable fields.

@icinga-migration
Copy link
Author

Updated by tgelf on 2016-11-09 15:32:24 +00:00

You're right. a) the exception shouldn't happen and b) the whole thing is confusing. We are currently working on support for dictionaries, and my personal plan is to replace this whole range-madness with a single form control once it is available.

@Thomas-Gelf Thomas-Gelf self-assigned this Aug 22, 2017
@Thomas-Gelf Thomas-Gelf added this to the 1.4.0 milestone Aug 22, 2017
@Thomas-Gelf
Copy link
Contributor

There where still some related bugs that should have been fixed this (or last?) week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants