Ticket #8480 (closed Bug: fixed)

Opened 8 years ago

Last modified 7 years ago

renameAfterCreation breaks on portal_type with namespace '.' (dot)

Reported by: pbugni Owned by: dunlapm
Priority: minor Milestone: 3.3
Component: Unknown Version:
Keywords: Cc:


Using namespace conventions, a portal_type with a dotted name, such as 'namespace.contenttype' will not be renamed after creation (regardless of the value of _at_rename_after_creation. The problem is due to the assumptions made in CMFPlone.utils.isIDAutoGenerated()

This modification to CMFPlone/utils.py will fix the problem:

114c114 < if id.count('.') != 2: ---

if id.count('.') < 2:

122c122,125 < obj_type, date_created, random_number = id.split('.') ---

parts = id.split('.') random_number = parts.pop() date_created = parts.pop() obj_type = '.'.join(parts)

Given the move towards namespace packages, I would expect this will become a more common issue.

NB - This was originally reported on the zope-cmf tracker  https://bugs.launchpad.net/bugs/268299 - re-filed here on request.

Change History

comment:1 Changed 8 years ago by dunlapm

  • Status changed from new to assigned
  • Owner set to dunlapm

comment:2 Changed 8 years ago by dunlapm

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

(In [22581]) Changed isIDAutoGenerated to work with types that have .'s in them in the case that namespaces are included in the type's portal_type. For example: collective.types.ExternalSearch (to pick one from the collective). This closes #8480.

comment:3 Changed 7 years ago by hannosch

  • Milestone changed from 3.x to 3.3
Note: See TracTickets for help on using tickets.