Changeset 2652

Show
Ignore:
Timestamp:
09/22/07 18:49:02 (1 year ago)
Author:
osimons
Message:

Fixing a bug in CustomFieldAdminPlugin - ref. #1834 where a first empty line (indicating optional) would disappear when editing a select field.

The 0.11 (Genshi) version needed two newlines to work, while the 0.10 (ClearSilver) only needed one. Strange, but I hope this is just an issue of the different templating systems, and that both versions now work OK.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • customfieldadminplugin/0.10/customfieldadmin/customfieldadmin.py

    r2250 r2652  
    5757            currentcf = cfapi.get_custom_fields(self.env, {'name': customfield}) 
    5858            if currentcf.has_key('options'): 
    59                 currentcf['options'] = "\n".join(currentcf['options']) 
     59                optional_line = '' 
     60                if currentcf.get('optional', False): 
     61                    optional_line = "\n" 
     62                currentcf['options'] = optional_line + "\n".join(currentcf['options']) 
    6063            req.hdf['admin.customfield'] = currentcf 
    6164        else: 
  • customfieldadminplugin/0.11/customfieldadmin/customfieldadmin.py

    r2389 r2652  
    6060            currentcf = cfapi.get_custom_fields(self.env, {'name': customfield}) 
    6161            if currentcf.has_key('options'): 
    62                 currentcf['options'] = "\n".join(currentcf['options']) 
     62                optional_line = '' 
     63                if currentcf.get('optional', False): 
     64                    optional_line = "\n\n" 
     65                currentcf['options'] = optional_line + "\n".join(currentcf['options']) 
    6366            cfadmin['customfield'] = currentcf 
    6467            cfadmin['display'] = 'detail'