From f39a7551f697494fc3e99edd1c6583db0b1b79d9 Mon Sep 17 00:00:00 2001 From: Philip Bauer Date: Mon, 24 Jun 2019 08:43:27 +0200 Subject: [PATCH 1/4] Registrr old js in legacy bundle (same as in p.a.event) --- .../app/discussion/profiles/default/jsregistry.xml | 7 ------- plone/app/discussion/profiles/default/registry.xml | 13 +++++++++++++ 2 files changed, 13 insertions(+), 7 deletions(-) delete mode 100644 plone/app/discussion/profiles/default/jsregistry.xml diff --git a/plone/app/discussion/profiles/default/jsregistry.xml b/plone/app/discussion/profiles/default/jsregistry.xml deleted file mode 100644 index db55b25..0000000 --- a/plone/app/discussion/profiles/default/jsregistry.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/plone/app/discussion/profiles/default/registry.xml b/plone/app/discussion/profiles/default/registry.xml index 1e0d535..5c046f4 100644 --- a/plone/app/discussion/profiles/default/registry.xml +++ b/plone/app/discussion/profiles/default/registry.xml @@ -4,4 +4,17 @@ False False + + + ++resource++plone.app.discussion.javascripts/comments.js + + + + plone-app-discussion + + + + From 9b02d2b2fcc97119cc148de273d78e2dff4a0980 Mon Sep 17 00:00:00 2001 From: Philip Bauer Date: Mon, 24 Jun 2019 16:57:11 +0200 Subject: [PATCH 2/4] add changenote --- news/157.bugfix | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 news/157.bugfix diff --git a/news/157.bugfix b/news/157.bugfix new file mode 100644 index 0000000..0b13d04 --- /dev/null +++ b/news/157.bugfix @@ -0,0 +1,2 @@ +Fix reply to comment by adding old-school js-resources to legacy-bundle. Fix #157 +[pbauer] \ No newline at end of file From 4966d8388e7d10e768ee7d5037cf19dcb06bfb93 Mon Sep 17 00:00:00 2001 From: Philip Bauer Date: Thu, 27 Jun 2019 19:43:27 +0200 Subject: [PATCH 3/4] add plone.resource dependency and change to plone:static --- .../howto_override_comments_viewlet.txt | 34 +------------------ plone/app/discussion/browser/configure.zcml | 5 +-- plone/app/discussion/browser/controlpanel.pt | 2 +- plone/app/discussion/browser/moderation.pt | 2 +- .../discussion/profiles/default/metadata.xml | 1 + .../discussion/profiles/default/registry.xml | 2 +- 6 files changed, 8 insertions(+), 38 deletions(-) diff --git a/docs/source/howtos/howto_override_comments_viewlet.txt b/docs/source/howtos/howto_override_comments_viewlet.txt index 11c0248..b45aba4 100644 --- a/docs/source/howtos/howto_override_comments_viewlet.txt +++ b/docs/source/howtos/howto_override_comments_viewlet.txt @@ -135,36 +135,4 @@ comments.py file with our custom version of the comments viewlet:: return "%s/memberhome/%s" % (self.context.portal_url(), username) To override the comments viewlet template, we create a comment.pt file in the -same directory and copy the contents from:: - - ... - - -Override the comments viewlet Javascript ----------------------------------------- - -Overriding the comments viewlet javascript works just like overriding the -comments viewlet. We register the javascript file for our custom browser -layer and remove the existing javascript file in -profiles/default/jsregistry.xml:: - - - - - - - - - -browser/configure.zcml:: - - - +same directory and copy the contents from the original. diff --git a/plone/app/discussion/browser/configure.zcml b/plone/app/discussion/browser/configure.zcml index 6a0efa2..7bb5aac 100644 --- a/plone/app/discussion/browser/configure.zcml +++ b/plone/app/discussion/browser/configure.zcml @@ -1,6 +1,7 @@ @@ -129,10 +130,10 @@ /> - diff --git a/plone/app/discussion/browser/controlpanel.pt b/plone/app/discussion/browser/controlpanel.pt index b62a447..d525fcb 100644 --- a/plone/app/discussion/browser/controlpanel.pt +++ b/plone/app/discussion/browser/controlpanel.pt @@ -70,7 +70,7 @@ diff --git a/plone/app/discussion/browser/moderation.pt b/plone/app/discussion/browser/moderation.pt index 797c18a..073d4d2 100644 --- a/plone/app/discussion/browser/moderation.pt +++ b/plone/app/discussion/browser/moderation.pt @@ -18,7 +18,7 @@ b_start request/b_start | b_start; moderation_enabled view/moderation_enabled;">

diff --git a/plone/app/discussion/profiles/default/metadata.xml b/plone/app/discussion/profiles/default/metadata.xml index f14a707..6557251 100644 --- a/plone/app/discussion/profiles/default/metadata.xml +++ b/plone/app/discussion/profiles/default/metadata.xml @@ -1,6 +1,7 @@ 1000 + profile-plone.resource:default profile-plone.app.registry:default diff --git a/plone/app/discussion/profiles/default/registry.xml b/plone/app/discussion/profiles/default/registry.xml index 5c046f4..ba7fe98 100644 --- a/plone/app/discussion/profiles/default/registry.xml +++ b/plone/app/discussion/profiles/default/registry.xml @@ -7,7 +7,7 @@ - ++resource++plone.app.discussion.javascripts/comments.js + ++plone++plone.app.discussion.javascripts/comments.js From c229e516903215f250c38a8269a41f76308eaecb Mon Sep 17 00:00:00 2001 From: Philip Bauer Date: Thu, 27 Jun 2019 19:59:20 +0200 Subject: [PATCH 4/4] add upgrade-step to re-enable comments.js --- plone/app/discussion/profiles/default/metadata.xml | 2 +- plone/app/discussion/upgrades.py | 4 ++++ plone/app/discussion/upgrades.zcml | 11 +++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/plone/app/discussion/profiles/default/metadata.xml b/plone/app/discussion/profiles/default/metadata.xml index 6557251..c779e86 100644 --- a/plone/app/discussion/profiles/default/metadata.xml +++ b/plone/app/discussion/profiles/default/metadata.xml @@ -1,5 +1,5 @@ - 1000 + 1001 profile-plone.resource:default profile-plone.app.registry:default diff --git a/plone/app/discussion/upgrades.py b/plone/app/discussion/upgrades.py index d9114f4..7a0e30c 100644 --- a/plone/app/discussion/upgrades.py +++ b/plone/app/discussion/upgrades.py @@ -61,3 +61,7 @@ def upgrade_comment_workflows(context): comment.reindexObjectSecurity() except (AttributeError, KeyError): logger.info('Could not reindex comment {0}'.format(brain.getURL())) + + +def add_js_to_plone_legacy(context): + context.runImportStepFromProfile(default_profile, 'plone.app.registry') diff --git a/plone/app/discussion/upgrades.zcml b/plone/app/discussion/upgrades.zcml index 9fa258c..02a7e54 100644 --- a/plone/app/discussion/upgrades.zcml +++ b/plone/app/discussion/upgrades.zcml @@ -51,4 +51,15 @@ /> + + + +