Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ on:
jobs:
qa:
uses: plone/meta/.github/workflows/qa.yml@2.x
test:
uses: plone/meta/.github/workflows/test.yml@2.x
coverage:
uses: plone/meta/.github/workflows/coverage.yml@2.x
dependencies:
Expand Down
3 changes: 1 addition & 2 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
# See the inline comments on how to expand/tweak this configuration file
[meta]
template = "default"
commit-id = "2.2.0"
commit-id = "2.3.0"

[tox]
test_matrix = {"6.2" = ["*"]}

[github]
jobs = [
"qa",
"test",
"coverage",
"dependencies",
"release_ready",
Expand Down
3 changes: 3 additions & 0 deletions news/+4c4064a8.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Update reviewlist to use ``is_default_page`` from ``plone.base`` rather than the ``plone_utils`` tool.
Also, check if an item is a default page in its own container, instead of on the context where we see the reviewlist.
@mauritsvanrees
1 change: 1 addition & 0 deletions news/+ignore.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update content status history page to use ``is_default_page`` from ``plone.base`` rather than a plone skin. @gforcada
5 changes: 5 additions & 0 deletions src/plone/app/content/browser/content_status_history.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from Acquisition import aq_parent
from plone.base import PloneMessageFactory as _
from plone.base.defaultpage import is_default_page
from plone.base.utils import human_readable_size
from plone.base.utils import is_expired
from Products.CMFCore.utils import getToolByName
Expand Down Expand Up @@ -135,6 +137,9 @@ def redirect_to_referrer(self):
def isExpired(self, content):
return is_expired(content)

def is_default_page(self, obj):
return is_default_page(aq_parent(self.context), obj)

@deprecate(
"This method is deprecated since Plone 6, "
"use the @@plone/human_readable_size method instead"
Expand Down
10 changes: 4 additions & 6 deletions src/plone/app/content/browser/reviewlist.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from Acquisition import aq_inner
from Acquisition import aq_parent
from plone.app.content.browser.tableview import Table
from plone.app.content.browser.tableview import TableBrowserView
from plone.base.defaultpage import is_default_page
from plone.base.utils import human_readable_size
from plone.base.utils import is_expired
from plone.base.utils import safe_text
Expand Down Expand Up @@ -54,11 +56,8 @@ def items(self):
portal_workflow = getToolByName(self.context, "portal_workflow")
portal_types = getToolByName(self.context, "portal_types")
portal_membership = getToolByName(self.context, "portal_membership")
plone_utils = getToolByName(self.context, "plone_utils")

registry = getUtility(IRegistry)
use_view_action = registry.get("plone.types_use_view_action_in_listings", ())
browser_default = plone_utils.browserDefault(self.context)

results = []
if portal_membership.isAnonymousUser():
Expand Down Expand Up @@ -117,9 +116,8 @@ def items(self):
else:
view_url = url

is_browser_default = len(browser_default[1]) == 1 and (
obj.id == browser_default[1][0]
)
# Is this object the default page of its container?
is_browser_default = is_default_page(aq_parent(aq_inner(obj)), obj)

results.append(
dict(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@
item_use_view python:item_type in use_view_action;
hasGetUrl python:hasattr(item.aq_explicit, 'getURL');
item_rel_url python:hasGetUrl and item.getURL(relative=1) or getRelativeContentURL(item);
browserDefaultResult context/browserDefault;
isBrowserDefault python:len(browserDefaultResult[1]) == 1 and item.id == context.browserDefault()[1][0];
isBrowserDefault python:view.is_default_page(item);
item_folderish item/is_folderish|nothing;
item_has_image python:item.getIcon;
"
Expand Down