Ticket #13144 (closed Bug: fixed)

Opened 4 years ago

Last modified 4 years ago

archetypes.querywidget raw get returns persistent querystring on .get(context, raw=True)

Reported by: jensens Owned by:
Priority: minor Milestone: 4.x
Component: General Version: 4.2
Keywords: collection, querystring Cc:

Description

While using plone.app.collection we were need to get the raw querystring, modify it and pass it then to the QueryBuilder.

After adding a row to the raw querystring the addition was persisted. So each time the code was called the query grew and grew longer and stored in the DB.

To avoid it we used

rawquery = deepcopy(context.getQuery(raw=True))

As far as I understand modification must happen only on set of a field. A field must not return data which one can not modify without harm.

So I'd propose to return a deepcopy at  https://github.com/plone/archetypes.querywidget/blob/master/archetypes/querywidget/field.py#L25

Change History

comment:2 Changed 4 years ago by kleist

  • Status changed from new to closed
  • Resolution set to fixed
  • Component changed from Unknown to General

obviously fixed

Note: See TracTickets for help on using tickets.