Ticket #1880 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

Some CPSPortlets code duplicates CPSCore.URLTool.getBreadCrumbsInfo

Reported by: madarche Assigned to: jmorliaguet
Priority: P1 Milestone: CPS 3.4.8
Component: CPSPortlets Version: TRUNK
Severity: blocker Keywords:
Cc:

Description

source:CPS3/products/CPSPortlets/trunk/skins/cpsportlets_widgets/getBreadcrumbsItems.py duplicates source:CPS3/products/CPSCore/trunk/URLTool.py

This makes it harder and less simpler to work (fix and/or customize) the behavior of the breadcrumbs all over a portal.

To achieve this URLTool.getBreadCrumbsInfo must be made a little more powerful and be able to access and process the options getBreadCrumbsInfo and first_item.

Change History

01/12/08 22:59:35 changed by madarche

  • status changed from new to closed.
  • type changed from enhancement to task.
  • resolution set to fixed.

Fixed by changeset [52402].

02/01/09 11:08:05 changed by jmorliaguet

  • status changed from closed to reopened.
  • severity changed from normal to blocker.
  • resolution deleted.
  • priority changed from P2 to P1.
  • milestone changed from CPS 3.4.6 to CPS 3.4.8.
  • type changed from task to defect.

there is an infinite loop case in URLTool.getBreadCrumbs() when hidden folders are on the path and show_hidden_folders is False:

while True:

parent = aq_parent(aq_inner(current)) if parent not in (vr, portal, root):

if not show_hidden_folders:

content = parent.getContent() if getattr(content.aq_inner.aq_explicit, 'hidden_folder', False):

continue # 'current' never changes

if not restricted or _checkPermission(View, parent):

parents.append(parent)

current = parent

else:

break

patch follows...

Then the "display_site_root" option is taken into account.

02/01/09 11:51:20 changed by jmorliaguet

"first_item" has a different meaning: it is the level of the physical first item being displayed right after the site root, for instance:

Root > A > B > C 0 1 2 3

if first_item is 2, you will get:

Root > B > C 0 1 2 3

first_item is 1 by default I would say, and ignored if 0, anyway it is relative to the physical path starting from root, not relative to path being displayed.

I've added the missing "display_site_root" option too.

02/01/09 13:19:13 changed by jmorliaguet

fixes done in [53375], [53376], [53377] and [53378]

03/05/09 16:06:21 changed by madarche

Test has been added with changeset [53379].

03/05/09 16:13:14 changed by madarche

Tests has been added in trunk with changesets [53379], [53380], [53381].

03/05/09 16:15:22 changed by madarche

  • status changed from reopened to closed.
  • resolution set to fixed.

Everything has been backported to the CPS-3.4 branch with changeset [53382].