Opened 9 years ago

Closed 9 years ago

#629 closed defect (fixed)

[patch] ChangeManipulator does not correctly display <select> when the data is an id type

Reported by: wgunadi@… Owned by: adrian
Component: Core (Other) Version:
Severity: normal Keywords: change manipulator
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When a field in a Change Manipulator form is a relation to another object/table, the __dict__ stores:

field_name + "_id"

as the key to the dictionary entry. For example:

{'name': 'CCN_PRJ1_PROD_R2', 'appname_id': 2, 'id': 5}
Notice that the appname field is keyed as 'appname_id'

So, when the Change Manipulator code in formfields.py:getitem() tries to get the data, it won't find it.

Attachments (1)

fix_patch.txt (702 bytes) - added by wgunadi@… 9 years ago.
Suggested fix

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by wgunadi@…

Suggested fix

comment:1 Changed 9 years ago by wgunadi_at_nextcoder.net

SUGGESTED FIX:
When the data is percieved as None, I've inserted a simple check if using the "fieldname_id" will yield a different result than blank. If it is, then we know that this data is a relation to an existing object. So the <select> will be rendered correctly.

Diff containing the fix is attached.

comment:2 Changed 9 years ago by anonymous

  • Summary changed from ChangeManipulator does not correctly display <select> when the data is an id type to [patch] ChangeManipulator does not correctly display <select> when the data is an id type

comment:3 Changed 9 years ago by rjwittams

This is fixed correctly in new-admin.

comment:4 Changed 9 years ago by wgunadi@…

  • milestone Version 1.0 deleted

Yes but applications that uses the Change Manipulators will still have this problem if not fixed on the formfield.py. This patch (or something else) need to be applied.

comment:5 Changed 9 years ago by rjwittams

Yes, the plan is to merge the new-admin branch back to trunk.
There is no point adding an incompatible fix to trunk before that.

comment:6 Changed 9 years ago by rjwittams

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in new-admin merge.

Note: See TracTickets for help on using tickets.
Back to Top