Ticket #1060 (assigned defect)

Opened 14 years ago

Last modified 14 years ago

Allowed content types reset after update

Reported by: sschintu Owned by: rspivak
Priority: P2 Milestone: CPS 3.5.7
Component: CPSDocument Version: 3.3.6
Severity: normal Keywords: setup


The allowed content types in sections and workspaces inside portal_types get reset after an update. All the document types that I have created and selected as allowed before appeared as not selected after a cps update.

Change History

comment:1 Changed 14 years ago by fguillaume

  • Priority changed from P3 to P2
  • Severity changed from minor to normal

comment:2 Changed 14 years ago by janguenot

  • Component changed from CPSDefault to CPSInstaller

comment:3 Changed 14 years ago by rspivak

  • Owner changed from trac to rspivak
  • Component changed from CPSInstaller to CPSDocument

It's a CPSDocument's installer which doesn't take into account possible consequent runs, thus call to verifyFlexibleTypes destroys all types info first and then puts into allowed_content_types of Section and Workspace names of stock content types.

comment:4 Changed 14 years ago by rspivak

Straightforward way would be to save values of allowed_content_types for Workspace and Section before call to verifyFlexibleTypes in setupPortalTypes method(CPSDocument/Extension/install.py) and after that call assign to Workspace and Section allowed_content_types previous saved values. So far so good, but this works ok only when doing site update.

On site creation values of allowed_content_types before call to verifyFlexibleTypes for Section and Workspace have only couple of values, so simple replacing will not set all allowed content types as it is currently.

Possible solution: Setup always stock content types as allowed_content_types + previously saved ones if they are not already present in stock types.

Drawbacks: Actually it's only partial solution - it will handle OK install/update when custom types were added or later removed from allowed_content_types for Section and Workspace, but if user unchecked one of stock types it will be restored after 'cpsupdate'.

Dunno if this should be implemented, we are moving to CMFSetup. Interesting how CMFSetup will handle this situation.

comment:5 Changed 14 years ago by fguillaume

  • Keywords setup added

Yes allowed_content_types should be merged more intelligently by installers.

This will be reworked for CMFSetup.

comment:6 Changed 14 years ago by rspivak

  • Status changed from new to assigned
  • Milestone changed from CPS 3.4.0 to CPS 3.4.1

#586 should obsolete this ticket, but for the moment i retarget it.

comment:7 Changed 14 years ago by sfermigier

  • Milestone changed from CPS 3.4.1 to CPS 3.4.2
Note: See TracTickets for help on using tickets.