8000 Fix django-cms#7710 (#7717) · django-cms/django-cms@9a7fe85 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9a7fe85

Browse files
authored
Fix #7710 (#7717)
1 parent d021a26 commit 9a7fe85

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

cms/extensions/extension_pool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ def _copy_page_extensions(self, source_page, target_page, language):
5757
instance.copy(target_page, language)
5858

5959
def _copy_content_extensions(self, source_page, target_page, language):
60-
source_content = source_page.pagecontent_set(manager="admin_manager").get(language=language)
61-
target_title = target_page.pagecontent_set(manager="admin_manager").get(language=language)
60+
source_content = source_page.pagecontent_set(manager="admin_manager").current_content(language=language).get()
61+
target_content = target_page.pagecontent_set(manager="admin_manager").current_content(language=language).get()
6262
for extension in self.page_content_extensions:
6363
for instance in extension.objects.filter(extended_object=source_content):
64-
instance.copy(target_title, language)
64+
instance.copy(target_content, language)
6565

6666
def copy_extensions(self, source_page, target_page, languages=None):
6767
if not languages:

cms/toolbar/items.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def add_item(self, item, position=None):
115115
return item
116116

117117
def find_items(self, item_type, **attributes):
118-
"""Returns a list of :class:`ItemSearchResult` objects matching all items of ``item_type``
118+
"""Returns a list of :class:`~cms.toolbar.items.ItemSearchResult` objects matching all items of ``item_type``
119119
(e.g. ``LinkItem``)."""
120120
results = []
121121
attr_items = attributes.items()
@@ -126,8 +126,8 @@ def find_items(self, item_type, **attributes):
126126
return results
127127

128128
def find_first(self, item_type, **attributes):
129-
"""Returns the first :class:`ItemSearchResult` that matches the search, or ``None``. The
130-
search strategy is the same as in :meth:`find_items`. The return value of this method is
129+
"""Returns the first :class:`~cms.toolbar.items.ItemSearchResult` that matches the search, or ``None``.
130+
The search strategy is the same as in :meth:`find_items`. The return value of this method is
131131
safe to use as the :option:`position` argument of the various APIs to add items."""
132132
try:
133133
return self.find_items(item_type, **attributes)[0]
@@ -163,7 +163,7 @@ def remove_item(self, item):
163163

164164
def add_sideframe_item(self, name, url, active=False, disabled=False,
165165
extra_classes=None, on_close=None, side=LEFT, position=None):
166-
"""Adds a :class:`SideframeItem` that opens ``url`` in the sideframe and returns it."""
166+
"""Adds a :class:`~cms.toolbar.items.SideframeItem` that opens ``url`` in the sideframe and returns it."""
167167

168168
item = SideframeItem(
169169
name, url,
@@ -178,7 +178,7 @@ def add_sideframe_item(self, name, url, active=False, disabled=False,
178178

179179
def add_modal_item(self, name, url, active=False, disabled=False,
180180
extra_classes=None, on_close=REFRESH_PAGE, side=LEFT, position=None):
181-
"""Similar to :meth:`add_sideframe_item`, but adds a :class:`ModalItem` that opens the
181+
"""Similar to :meth:`add_sideframe_item`, but adds a :class:`~cms.toolbar.items.ModalItem` that opens the
182182
``url`` in a modal dialog instead of the sideframe, and returns it."""
183183

184184
item = ModalItem(
@@ -194,7 +194,7 @@ def add_modal_item(self, name, url, active=False, disabled=False,
194194

195195
def add_link_item(self, name, url, active=False, disabled=False,
196196
extra_classes=None, side=LEFT, position=None):
197-
"""Adds a :class:`LinkItem` that opens ``url``, and returns it."""
197+
"""Adds a :class:`~cms.toolbar.items.LinkItem` that opens ``url``, and returns it."""
198198

199199
item = LinkItem(
200200
name, url,
@@ -209,7 +209,7 @@ def add_link_item(self, name, url, active=False, disabled=False,
209209
def add_ajax_item(self, name, action, active=False, disabled=False,
210210
extra_classes=None, data=None, question=None,
211211
side=LEFT, position=None, on_success=None, method='POST'):
212-
"""Adds :class:`AjaxItem` that sends a POST request to ``action`` with ``data``, and returns
212+
"""Adds :class:`~cms.toolbar.items.AjaxItem` that sends a POST request to ``action`` with ``data``, and returns
213213
it. ``data`` should be ``None`` or a dictionary. The CSRF token will automatically be added
214214
to the item.
215215
@@ -370,6 +370,11 @@ def get_context(self):
370370

371371

372372
class FrameItem(BaseItem):
373+
"""
374+
Base class for :class:`~cms.toolbar.items.ModalItem` and :class:`~cms.toolbar.items.SideframeItem`.
375+
Frame items have three dots besides their name indicating that some frame or dialog will open
376+
when selected.
377+
"""
373378
# Be sure to define the correct template
374379

375380
def __init__(self, name, url, active=False, disabled=False,

0 commit comments

Comments
 (0)
0