Quick Test Guide - Edit and Change Password Modals
Before Testing
-
Clear browser cache:
- Chrome/Edge:
Ctrl+Shift+Delete (Windows/Linux) or Cmd+Shift+Delete (Mac)
- Firefox:
Ctrl+Shift+Delete (Windows/Linux) or Cmd+Shift+Delete (Mac)
- Or open in Private/Incognito window
-
Make sure you're logged in as an Admin user
- Admin users in database: userId 1, 2
Test 1: Edit User Modal
Steps:
- Go to users.php page
- Click the "Edit" button on any user row
- In the Edit User modal:
- Verify the form pre-fills with current user data
- Verify the Status dropdown shows the correct value (Active or Inactive)
- Make a small change (e.g., change email to add a number)
- Click "Save Changes" button
- Expected:
- Success message: "User updated successfully"
- Modal closes automatically
- DataTable reloads with updated data
- NOT: "Error: Access denied"
Test 2: Change Password Modal
Steps:
- Go to users.php page
- Option A: Click the "Change Password" button on any user row
- OR Option B: Click "Change Password" in the header dropdown menu (top-right)
- In the Change Password modal:
- Enter a new password (must be 8+ characters)
- Re-enter the same password in Confirm field
- Click "Change Password" button
- Expected:
- Success message: "Password changed successfully"
- Modal closes automatically
- Form clears for next use
- NOT: "Error: Access denied"
Test 3: Status Dropdown Functionality
Purpose: Verify status values pre-fill correctly (fix from previous session)
Steps:
- Click "Edit" on any "Active" user
- Verify Status dropdown shows "Active" as selected (not blank)
- Click "Edit" on any "Inactive" user
- Verify Status dropdown shows "Inactive" as selected (not blank)
Test 4: Cascade Filtering
Purpose: Verify Vendor → Project → DC filtering works
Steps:
- Click "Edit" on any user
- Select a different Vendor from the Vendor dropdown
- Expected: Project dropdown repopulates with projects for that vendor
- Select a different Project
- Expected: DC dropdown repopulates with DCs for that project
Debugging if Issues Occur
If you still see "Error: Access denied"
- This means the current logged-in user is NOT an admin
- Check their role: Must be 'admin' (lowercase)
- Solution: Log in as a user with admin role
- User ID 1 (Admin) or User ID 2 (Yagati Vasavya) are confirmed admins
If you see "Error: undefined" or other errors
- Open browser console: F12 → Console tab
- Look for error messages
- Check Network tab: Look at API response for actual error
- Check browser console for JavaScript errors
- Verify API response contains expected data (Network → users-view.php response)
If modal doesn't close after save
- Success message appeared but modal still open?
- This might be a Bootstrap modal issue
- Try refreshing page (F5)
Success Checklist
- [ ] Edit modal opens without errors
- [ ] Status dropdown shows correct value
- [ ] Save Changes works without "Access denied"
- [ ] UserData updates in table
- [ ] Change Password modal opens
- [ ] Password change works without "Access denied"
- [ ] Modal closes after successful save/change
- [ ] No errors in browser console
What Was Fixed
This session fixed two issues:
- Status case mismatch: Database "Active" → Form "active" (FIXED in previous session)
- Session variable access: APIs using
$_SESSION['user'] → Now use get_user_info() (FIXED THIS SESSION)
Both are now resolved and ready for testing.