Ticket #1817 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Flexible compound widgets destruction doesn't recurse

Reported by: gracinet Assigned to: fguillaume
Priority: P3 Milestone: CPS 3.4.4
Component: CPSDocument Version: TRUNK
Severity: minor Keywords: flexible widget
Cc:

Description

It seems that deletion of a flexible widget through the UI does nothing more than removing the reference in the table of the corresponding layout. I consider this as a bug because:

  • applicative code might be confused by the mere existence of the remaining content in the object's datamodel
  • that makes potentially for a few megs of useless data

Change History

03/11/07 19:54:29 changed by fguillaume

You must be mistaken, FlexibleTypeInformation?._flexibleDelSimpleWidgets has this code:

                if field_id in ob.objectIds():
                    ob.manage_delObjects([field_id])
                else:
                    # Other fields such as string Fields are stored as
                    # non-object attributes
                    delattr(ob, field_id)

03/14/07 01:15:51 changed by gracinet

I've seen it again. One one hand, this might be a non standard setup. On the other, the more precise symptom that I didin't notice before: This is a Compound widget, and it looks as if the sub widgets had not been wiped.

03/14/07 01:27:33 changed by gracinet

  • summary changed from Flexible widgets destruction doesn't delete them to Flexible compound widgets destruction doesn't recurse.

I've no time to test a fix right now, but this must be the culprit

            if widget.meta_type == 'CPS Compound Widget':
                new_widget_ids.extend(widget.widget_ids)

Nowadays, the meta_types are "Compound Widget" and "Code Compound Widget". In general, widgets meta_types don't start with "CPS". Lookup by meta_type is in any case weak.

03/17/07 14:57:01 changed by gracinet

Fixed [51387] There is no unit test at all for those features. No time to write a full one, sorry. Side remark: it sometimes looks as if only subwidgets had been deleted but actually the compound itself has been changed to a flexible template (fields=??).

03/17/07 14:58:39 changed by gracinet

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone changed from CPS 3.4.5 to CPS 3.4.4.