#14858: Bug in admin change_form template produces javascript error when adding 
new
object with first_field of type DateTimeField.
-------------------------------------------+--------------------------------
          Reporter:  mkelley33             |         Owner:  nobody             
             
            Status:  new                   |     Milestone:  1.3                
             
         Component:  django.contrib.admin  |       Version:  1.2                
             
        Resolution:                        |      Keywords:  admin templates 
javascript error
             Stage:  Unreviewed            |     Has_patch:  1                  
             
        Needs_docs:  0                     |   Needs_tests:  0                  
             
Needs_better_patch:  0                     |  
-------------------------------------------+--------------------------------
Changes (by ramiro):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Old description:

> '''Scenario:'''
>
> 1. User fires up admin site in browser (bug is not browser specific), and
> goes to admin/app_name/model_name/
> 2. User clicks the add button in upper-right-hand corner.
> 3. The change_form.html template is rendered, and ready to add a new
> object.
> 4. Then the user's browser complains and throws an error, because the
> user
>    (for whatever--probably strange and arguably wrong--reason) made
> created_datetime
>    of type DateTimeField be the first_field.
>

> '''Error or Bug:'''
>
> {{{
> Error: document.getElementById("id_created_date") is null
> Source File: http://127.0.0.1:8000/admin/app_name/model_name/add/
> }}}
>

> '''Cause:'''
>
> The DateTimeField outputs two fields:
>
> 1. created_date_0
> 2. created_date_1
>
> '''Solution:'''
>
> See attached patch file.

New description:

 '''Scenario:'''

  1. User fires up admin site in browser (bug is not browser specific), and
 goes to admin/app_name/model_name/
  2. User clicks the add button in upper-right-hand corner.
  3. The change_form.html template is rendered, and ready to add a new
 object.
  4. Then the user's browser complains and throws an error, because the
 user (for whatever--probably strange and arguably wrong--reason) made
 created_datetime of type DateTimeField be the first_field.


 '''Error or Bug:'''

 {{{
 Error: document.getElementById("id_created_date") is null
 Source File: http://127.0.0.1:8000/admin/app_name/model_name/add/
 }}}


 '''Cause:'''

 The DateTimeField outputs two fields:

  1. created_date_0
  2. created_date_1

 '''Solution:'''

 See attached patch file.

Comment:

 This had already been reported as #14364. Will try to reproduce with the
 more detailed instructions above before deciding final triage status.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14858#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to