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

Creation of Category permitted without a Category ID, however can't then Edit or Delete Category #15

Closed
andrewperry opened this issue Sep 12, 2012 · 1 comment

Comments

@andrewperry
Copy link

You can create a new category at /index.php/admin/categories/add without specifying a category id, however if you do, you can't then edit or delete the new category as you get the error:

Fatal error: Uncaught exception 'Exception' with message 'On the state "edit" the Primary key cannot be null' in /home/fms-endpoint/codeigniter/fms_endpoint/libraries/grocery_crud.php:2312 Stack trace: #0 /home/fms-endpoint/codeigniter/fms_endpoint/libraries/grocery_crud.php(3159): grocery_CRUD_States->getStateInfo() #1 /home/fms-endpoint/codeigniter/fms_endpoint/controllers/admin.php(92): grocery_CRUD->render() #2 [internal function]: Admin->categories('edit') #3 /home/fms-endpoint/codeigniter/codeigniter/CodeIgniter.php(236): call_user_func_array(Array, Array) #4 /home/fms-endpoint/web/index.php(117): require_once('/home/open311/f...') #5 {main} thrown in /home/fms-endpoint/codeigniter/fms_endpoint/libraries/grocery_crud.php on line 2312

Leaving the entry there will then cause problems out in the world such as in FMS where running ./bin/open311-populate-service-list will give the error:

DBIx::Class::ResultSet::create(): [SQL::Abstract::ANON] Warning: HASH ref as bind value in insert is not supported at /home/fmsalpha/fixmystreet/bin/../perllib/Open311/PopulateServiceList.pm line 158
Failed to create contact for service code HASH(0x74bcda0) for council 58: Cannot bind a reference

I will file this over on FMS as another issue, since FMS should handle bad Open311 servers gracefully.

@andrewperry
Copy link
Author

Please see our pull request for the issue on the fms-endpoint end.

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

No branches or pull requests

2 participants