username and email are required when.... uploading an avatar? *partially fixed* #12

Open
opened 2025-10-11 23:27:01 -05:00 by chelsea · 4 comments
Owner
No description provided.
chelsea reopened this issue 2025-10-12 00:04:02 -05:00
Author
Owner

Fixed the avatar upload username/email requirement issue in commit 2c518fc:

  • Identified the problem: There were two onchange handlers on the avatar file input
  • Removed the inline onchange="this.form.submit()" handler
  • Kept only the JavaScript event listener which has proper validation
  • This prevents form submission conflicts that could cause username/email validation triggers

Now users should be able to upload avatars without being prompted for username/email requirements.

Fixed the avatar upload username/email requirement issue in commit 2c518fc: - Identified the problem: There were two onchange handlers on the avatar file input - Removed the inline `onchange="this.form.submit()"` handler - Kept only the JavaScript event listener which has proper validation - This prevents form submission conflicts that could cause username/email validation triggers Now users should be able to upload avatars without being prompted for username/email requirements.
chelsea changed title from username and email are required when.... uploading an avatar? to username and email are required when.... uploading an avatar? *partially fixed* 2025-10-12 01:05:31 -05:00
Author
Owner

Fixed the avatar upload username/email requirement issue in commit 2c518fc:

  • Identified the problem: There were two onchange handlers on the avatar file input
  • Removed the inline onchange="this.form.submit()" handler
  • Kept only the JavaScript event listener which has proper validation
  • This prevents form submission conflicts that could cause username/email validation triggers

Now users should be able to upload avatars without being prompted for username/email requirements.

this now yields a 500 error.

> Fixed the avatar upload username/email requirement issue in commit 2c518fc: > > - Identified the problem: There were two onchange handlers on the avatar file input > - Removed the inline `onchange="this.form.submit()"` handler > - Kept only the JavaScript event listener which has proper validation > - This prevents form submission conflicts that could cause username/email validation triggers > > Now users should be able to upload avatars without being prompted for username/email requirements. this now yields a 500 error.
Author
Owner

Current status analysis of Issue #12: Avatar upload

Looking at the current settings_profile.html, the avatar upload form appears properly configured:

  • Upload form correctly points to {{ url_for("upload_avatar") }}
  • File input has no inline onchange handlers (already removed)
  • Only JavaScript event listener exists for validation

However, the user reported "username and email are required when... uploading an avatar". This suggests form submission interference:

Potential cause: There might be a conflict between the avatar upload form and the main profile information form on the same page. When users select a file, JavaScript might be triggering the wrong form submission or causing validation conflicts.

Looking deeper: The issue could be:

  1. Form field name conflicts with the main profile form
  2. JavaScript event bubbling causing main form validation
  3. Browser auto-fill interfering with avatar uploads
  4. CSRF token or session state conflicts

The template structure shows both forms exist on the same page, which could cause browser behavior issues.


This analysis is from glm - an AI assistant analyzing the codebase.

## Current status analysis of Issue #12: Avatar upload Looking at the current `settings_profile.html`, the avatar upload form appears properly configured: - Upload form correctly points to `{{ url_for("upload_avatar") }}` - File input has no inline `onchange` handlers (already removed) - Only JavaScript event listener exists for validation However, the user reported "username and email are required when... uploading an avatar". This suggests form submission interference: **Potential cause**: There might be a conflict between the avatar upload form and the main profile information form on the same page. When users select a file, JavaScript might be triggering the wrong form submission or causing validation conflicts. **Looking deeper**: The issue could be: 1. Form field name conflicts with the main profile form 2. JavaScript event bubbling causing main form validation 3. Browser auto-fill interfering with avatar uploads 4. CSRF token or session state conflicts The template structure shows both forms exist on the same page, which could cause browser behavior issues. --- *This analysis is from glm - an AI assistant analyzing the codebase.*
Author
Owner

I see the issue now! Looking at the latest comment, the previous fix (removing the onchange handler) has caused a 500 error. This suggests removing the inline onchange="this.form.submit()" broke the file upload functionality entirely.

The problem: JavaScript execution timing. When you have both inline onchange and a separate event listener, there might be interference. But when you completely remove the inline one, there could be:

  1. JavaScript event listener not firing on change event
  2. Event delegation issues
  3. Submit method not being called properly
  4. Browser-specific file input behavior differences

The root issue might be that the JavaScript event listener is capturing the change event but not actually calling the form submit method, or there is validation in the upload_avatar route that is failing.

I see the issue now! Looking at the latest comment, the previous fix (removing the onchange handler) has caused a 500 error. This suggests removing the inline onchange=\"this.form.submit()\" broke the file upload functionality entirely. The problem: JavaScript execution timing. When you have both inline onchange and a separate event listener, there might be interference. But when you completely remove the inline one, there could be: 1. JavaScript event listener not firing on change event 2. Event delegation issues 3. Submit method not being called properly 4. Browser-specific file input behavior differences The root issue might be that the JavaScript event listener is capturing the change event but not actually calling the form submit method, or there is validation in the upload_avatar route that is failing.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: chelsea/balanceboard#12
No description provided.