Skip to content

Commit

Permalink
[fc] Repository: plone.app.linkintegrity
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2021-12-12T01:50:42Z
Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com>
Commit: plone/plone.app.linkintegrity@bd797b7

Track links from &lt;source src=&gt; tag attributes as well

This alerts the user to deletion of videos and sound recordings that are used somewhere else in the portal.

Files changed:
M plone/app/linkintegrity/parser.py
Repository: plone.app.linkintegrity

Branch: refs/heads/master
Date: 2021-12-12T01:55:33Z
Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com>
Commit: plone/plone.app.linkintegrity@3dcbc3b

Add changelog entry

Files changed:
A news/77.feature
Repository: plone.app.linkintegrity

Branch: refs/heads/master
Date: 2021-12-13T18:49:59Z
Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com>
Commit: plone/plone.app.linkintegrity@238e0e2

Add srcset= to the attributes for which linkintegrity must be used

Files changed:
M plone/app/linkintegrity/parser.py
Repository: plone.app.linkintegrity

Branch: refs/heads/master
Date: 2021-12-16T01:24:09+01:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: plone/plone.app.linkintegrity@9dd2e42

Merge pull request #83 from Rudd-O/master

Track links from &lt;source src=&gt; tag attributes as well

Files changed:
A news/77.feature
M plone/app/linkintegrity/parser.py
  • Loading branch information
jensens committed Dec 16, 2021
1 parent 8bef219 commit 7cbc1c0
Showing 1 changed file with 57 additions and 13 deletions.
70 changes: 57 additions & 13 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,65 @@
Repository: plone.app.layout
Repository: plone.app.linkintegrity


Branch: refs/heads/3.4.x
Date: 2021-12-06T09:20:02+01:00
Author: Johannes Raggam (thet) <thetetet@gmail.com>
Commit: https://github.com/plone/plone.app.layout/commit/0804caafb325fe2e994c0636e327aec1f36455bb
Branch: refs/heads/master
Date: 2021-12-12T01:50:42Z
Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com>
Commit: https://github.com/plone/plone.app.linkintegrity/commit/bd797b7f2c1e9e0de6d17a8ad9bd7caf30e56ff2

Global sections viewlet performance optimizations:
Track links from &lt;source src=&gt; tag attributes as well

- Remove pointless caching on types_using_view,
- Store settings in variable for multiple access, bypassing cache checks,
- Remove now pointless caching on settings property,
- Deprecate now unused navtree_depth property.
This alerts the user to deletion of videos and sound recordings that are used somewhere else in the portal.

Files changed:
A news/275.feature
M plone/app/layout/viewlets/common.py
M plone/app/linkintegrity/parser.py

b'diff --git a/news/275.feature b/news/275.feature\nnew file mode 100644\nindex 00000000..dd427e5b\n--- /dev/null\n+++ b/news/275.feature\n@@ -0,0 +1,7 @@\n+Global sections viewlet performance optimizations:\n+\n+- Remove pointless caching on types_using_view,\n+- Store settings in variable for multiple access, bypassing cache checks,\n+- Remove now pointless caching on settings property,\n+- Deprecate now unused navtree_depth property.\n+[thet]\ndiff --git a/plone/app/layout/viewlets/common.py b/plone/app/layout/viewlets/common.py\nindex ded67d1b..136a621d 100644\n--- a/plone/app/layout/viewlets/common.py\n+++ b/plone/app/layout/viewlets/common.py\n@@ -10,7 +10,6 @@\n from plone.app.layout.navigation.root import getNavigationRootObject\n from plone.i18n.interfaces import ILanguageSchema\n from plone.memoize.view import memoize\n-from plone.memoize.view import memoize_contextless\n from plone.protect.utils import addTokenToUrl\n from plone.registry.interfaces import IRegistry\n from Products.CMFCore.utils import getToolByName\n@@ -243,7 +242,6 @@ class GlobalSectionsViewlet(ViewletBase):\n _subtree_markup_wrapper = u\'<ul class="has_subtree dropdown">{out}</ul>\'\n \n @property\n- @memoize_contextless\n def settings(self):\n registry = getUtility(IRegistry)\n settings = registry.forInterface(INavigationSchema, prefix="plone")\n@@ -260,6 +258,7 @@ def navtree_path(self):\n return getNavigationRoot(self.context)\n \n @property\n+ @deprecate("This property will be removed in Plone 6")\n def navtree_depth(self):\n return self.settings.navigation_depth\n \n@@ -272,7 +271,6 @@ def current_language(self):\n )\n \n @property\n- @memoize_contextless\n def types_using_view(self):\n registry = getUtility(IRegistry)\n types_using_view = registry.get("plone.types_use_view_action_in_listings", [])\n@@ -282,12 +280,16 @@ def types_using_view(self):\n @memoize\n def navtree(self):\n ret = defaultdict(list)\n+ settings = self.settings\n navtree_path = self.navtree_path\n portal_tabs = self.portal_tabs\n for tab in portal_tabs:\n entry = tab.copy()\n entry.update(\n- {"path": "/".join((navtree_path, tab["id"])), "uid": tab["id"],}\n+ {\n+ "path": "/".join((navtree_path, tab["id"])),\n+ "uid": tab["id"],\n+ }\n )\n if "review_state" not in entry:\n entry["review_state"] = None\n@@ -304,27 +306,30 @@ def navtree(self):\n self.customize_tab(entry, tab)\n ret[navtree_path].append(entry)\n \n- if not self.settings.generate_tabs:\n+ if not settings.generate_tabs:\n return ret\n \n query = {\n- "path": {"query": self.navtree_path, "depth": self.navtree_depth,},\n- "portal_type": {"query": self.settings.displayed_types},\n+ "path": {\n+ "query": self.navtree_path,\n+ "depth": settings.navigation_depth,\n+ },\n+ "portal_type": {"query": settings.displayed_types},\n "Language": self.current_language,\n- "sort_on": self.settings.sort_tabs_on,\n+ "sort_on": settings.sort_tabs_on,\n "is_default_page": False,\n }\n \n- if self.settings.sort_tabs_reversed:\n+ if settings.sort_tabs_reversed:\n query["sort_order"] = "reverse"\n \n- if not self.settings.nonfolderish_tabs:\n+ if not settings.nonfolderish_tabs:\n query["is_folderish"] = True\n \n- if self.settings.filter_on_workflow:\n- query["review_state"] = list(self.settings.workflow_states_to_show or ())\n+ if settings.filter_on_workflow:\n+ query["review_state"] = list(settings.workflow_states_to_show or ())\n \n- if not self.settings.show_excluded_items:\n+ if not settings.show_excluded_items:\n query["exclude_from_nav"] = False\n \n context_path = "/".join(self.context.getPhysicalPath())\n'
b"diff --git a/plone/app/linkintegrity/parser.py b/plone/app/linkintegrity/parser.py\nindex 2a756c4..ccd1627 100644\n--- a/plone/app/linkintegrity/parser.py\n+++ b/plone/app/linkintegrity/parser.py\n@@ -30,6 +30,8 @@ def handle_starttag(self, tag, attrs):\n self.links.extend(search_attr('href', attrs))\n if tag == 'img':\n self.links.extend(search_attr('src', attrs))\n+ if tag == 'source':\n+ self.links.extend(search_attr('src', attrs))\n \n \n def search_attr(name, attrs):\n"

Repository: plone.app.linkintegrity


Branch: refs/heads/master
Date: 2021-12-12T01:55:33Z
Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com>
Commit: https://github.com/plone/plone.app.linkintegrity/commit/3dcbc3b56de4e5a7f9cb21a09bcc13d9589a03a7

Add changelog entry

Files changed:
A news/77.feature

b'diff --git a/news/77.feature b/news/77.feature\nnew file mode 100644\nindex 0000000..d8be745\n--- /dev/null\n+++ b/news/77.feature\n@@ -0,0 +1 @@\n+* Track integrity of video and audio files in HTML source tags.\n'

Repository: plone.app.linkintegrity


Branch: refs/heads/master
Date: 2021-12-13T18:49:59Z
Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com>
Commit: https://github.com/plone/plone.app.linkintegrity/commit/238e0e2af97d9aa96efe511c7c3dc7502aa7b6bb

Add srcset= to the attributes for which linkintegrity must be used

Files changed:
M plone/app/linkintegrity/parser.py

b"diff --git a/plone/app/linkintegrity/parser.py b/plone/app/linkintegrity/parser.py\nindex ccd1627..c0de8e4 100644\n--- a/plone/app/linkintegrity/parser.py\n+++ b/plone/app/linkintegrity/parser.py\n@@ -32,6 +32,7 @@ def handle_starttag(self, tag, attrs):\n self.links.extend(search_attr('src', attrs))\n if tag == 'source':\n self.links.extend(search_attr('src', attrs))\n+ self.links.extend(search_attr('srcset', attrs))\n \n \n def search_attr(name, attrs):\n"

Repository: plone.app.linkintegrity


Branch: refs/heads/master
Date: 2021-12-16T01:24:09+01:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: https://github.com/plone/plone.app.linkintegrity/commit/9dd2e4219d5c932926d5f86388437c2a16616d45

Merge pull request #83 from Rudd-O/master

Track links from &lt;source src=&gt; tag attributes as well

Files changed:
A news/77.feature
M plone/app/linkintegrity/parser.py

b"diff --git a/news/77.feature b/news/77.feature\nnew file mode 100644\nindex 0000000..d8be745\n--- /dev/null\n+++ b/news/77.feature\n@@ -0,0 +1 @@\n+* Track integrity of video and audio files in HTML source tags.\ndiff --git a/plone/app/linkintegrity/parser.py b/plone/app/linkintegrity/parser.py\nindex 2a756c4..c0de8e4 100644\n--- a/plone/app/linkintegrity/parser.py\n+++ b/plone/app/linkintegrity/parser.py\n@@ -30,6 +30,9 @@ def handle_starttag(self, tag, attrs):\n self.links.extend(search_attr('href', attrs))\n if tag == 'img':\n self.links.extend(search_attr('src', attrs))\n+ if tag == 'source':\n+ self.links.extend(search_attr('src', attrs))\n+ self.links.extend(search_attr('srcset', attrs))\n \n \n def search_attr(name, attrs):\n"

0 comments on commit 7cbc1c0

Please sign in to comment.