# Fix for Project Edit Button and Parent Project Update
## Issue Description
Two issues were encountered when trying to edit a project from the project details page:
1. Error message when clicking the Edit button:
```
Project with ID ARRAY(0x63cdc68e7090) not found
```
2. Parent project changes were not being saved when updating a project.
## Solution
The solution involved several changes:
1. **Changed the Edit Project button in projectdetails.tt**:
- Replaced the form with a direct link using an anchor tag
- Added the project_id as a query parameter in the URL
- Added CSS to style the button link properly
2. **Fixed the project_list.tt template**:
- Changed the dropdown name from `project_id` to `parent_id` to avoid conflict with the project being edited
- This ensures the parent project selection is properly submitted
3. **Enhanced the `update_project` method in Project.pm**:
- Added handling for the case where project_id is an array reference
- Added parent_id to the list of fields to update
- Added proper handling for empty parent_id values
- Added comprehensive error handling and logging
- Improved success message and redirect
4. **Added success and error message display**:
- Added message containers to projectdetails.tt
- Added CSS styling for success and error messages
## Technical Details
There were two main issues:
1. When using a form with method="GET" and a hidden input field, the project_id was being sent as an array reference instead of a scalar value. This was causing the error when trying to find the project in the database.
2. The parent_id was not being included in the update operation, and there was a naming conflict between the project being edited and the parent project selection.
The solution was to:
1. Replace the form with a direct link using an anchor tag
2. Change the parent project dropdown name to avoid conflicts
3. Add parent_id handling in the update_project method
4. Add proper success and error message display
## Benefits
- More robust project editing
- Parent project changes are now properly saved
- Better error handling and logging
- Improved user experience with success and error messages
- Fixed security issues with form methods
This fix ensures that users can edit projects and change parent projects without encountering errors.