Ticket #11289 (closed Bug: fixed)

Opened 3 years ago

Last modified 3 years ago

archetypes.referencebrowserwidget: startup_dir_method not honoured

Reported by: uschwarz Owned by: tom_gross
Priority: minor Milestone: 4.x
Component: Archetypes Version:
Keywords: Cc:

Description (last modified by kleist) (diff)

In archetypes.referencebrowserwidget 2.0, restrict_browsing_to_startup_directory will always use the value of startup_directory, even if startup_directory_method is given. (In the normal use case, this means the user is only prevented from going all the way to the root.)

As a stopgap fix, amending view.ReferenceBrowserHelperView's getStartupDirectory as follows:

[...]
    if method:
        # Then get the method again, but with acquisition context this

        # time:

        method = getattr(self.context,
                         widget.startup_directory_method,
                         False)
        if callable(method):
            method = method()
        widget.startup_directory = method # XXX BUGFIX schwarz

        return method
[...]

appears to work, but is ugly, and a proper solution would amend popup.pt l.118p:

        <tal:crumbs tal:repeat="
            crumb python:view.breadcrumbs(widget.startup_directory)">

Change History

comment:1 follow-up: ↓ 2 Changed 3 years ago by kleist

  • Description modified (diff)

Which Plone version, please?

comment:2 in reply to: ↑ 1 Changed 3 years ago by uschwarz

Replying to kleist:

Which Plone version, please?

Plone 4.0.1, a.rbw 2.0, sorry.

comment:3 follow-up: ↓ 4 Changed 3 years ago by tom_gross

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

can someone please verify [13322] fixes the bug? thanks!

comment:4 in reply to: ↑ 3 Changed 3 years ago by tom_gross

Replying to tom_gross:

can someone please verify [13322] fixes the bug? thanks!

sorry. I mean  http://dev.plone.org/archetypes/changeset/13322/MoreFieldsAndWidgets/archetypes.referencebrowserwidget of course.

comment:5 Changed 3 years ago by uschwarz

Yes, that appears to work, thank you!

comment:6 Changed 3 years ago by tom_gross

  • Status changed from assigned to closed
  • Resolution set to fixed
  • Milestone set to 4.x

will be included in next archetypes.referencebrowserwidget release (2.1)

Note: See TracTickets for help on using tickets.