Unable to delete or replace diazo theme (Plone 5) added as .zip

Hi,
on Plone 5.0.8 (I did not try any other Plone 5.0.x versions) I is impossible to remove or replace themes which were added as zip files.

Steps to reproduce:

  1. Add e.g. the plonetheme.booster theme (https://github.com/collective/plonetheme.booster/blob/master/plonetheme.booster.zip)
  2. try deleting (you get a buttonless pop-up – as described here: https://github.com/collective/plonetheme.business_casual/issues/2)

Replacing the theme with a modified version also does not work.

Loading @@theming-controlpanel gives this output in the browser console:

Usage of the mockup-patterns-base pattern is deprecated and it will eventually be removed.Instead, use pat-base and explicitly set parser to 'mockup' when calling extend.  default.js:2471:4177
patterns.pat.formunloadalert: Failed while initializing 'formunloadalert' pattern. TypeError: c.data(...) is undefined
Stack trace:
init@http://my.server.com:8080/test_site/++plone++production/++unique++2017-09-06T10:01:41.553929/default.js:2475:3913
g@http://my.server.com:8080/test_site/++plone++production/++unique++2017-09-06T10:01:41.553929/default.js:2471:3078
g.extend/d<@http://my.server.com:8080/test_site/++plone++production/++unique++2017-09-06T10:01:41.553929/default.js:2471:3482
f@http://my.server.com:8080/test_site/++plone++production/++unique++2017-09-06T10:01:41.553929/default.js:2471:2873
initPattern@http://my.server.com:8080/test_site/++plone++production/++unique++2017-09-06T10:01:41.553929/default.js:2471:756
D@http://my.server.com:8080/test_site/++plone++production/++unique++2017-09-06T10:01:41.553929/default.js:2470:7243
c@http://my.server.com:8080/test_site/++plone++production/++unique++2017-09-06T10:01:41.553929/default.js:2470:7766
scan/<@http://my.server.com:8080/test_site/++plone++production/++unique++2017-09-06T10:01:41.553929/default.js:2471:1378
scan@http://my.server.com:8080/test_site/++plone++production/++unique++2017-09-06T10:01:41.553929/default.js:2471:1340
init/<@http://my.server.com:8080/test_site/++plone++production/++unique++2017-09-06T10:01:41.553929/default.js:2471:285
j@http://my.server.com:8080/test_site/++plone++production/++unique++2017-09-06T10:01:41.553929/default.js:2:27304
fireWith@http://my.server.com:8080/test_site/++plone++production/++unique++2017-09-06T10:01:41.553929/default.js:2:28122
ready@http://my.server.com:8080/test_site/++plone++production/++unique++2017-09-06T10:01:41.553929/default.js:2:29954
J@http://my.server.com:8080/test_site/++plone++production/++unique++2017-09-06T10:01:41.553929/default.js:2:30320
  default.js:2470:17453
patterns.Patternslib Base: This pattern without a name attribute will not be registered! default.js:2470:17423
Usage of the mockup-patterns-base pattern is deprecated and it will eventually be removed.Instead, use pat-base and explicitly set parser to 'mockup' when calling extend.

Firing the delete button does not give any additional info, neither via the browser console, nor via the cli when I run plone in the foreground. I tried this both with a minimal build (https://docs.plone.org/manage/installing/requirements.html#minimal-build) and the unified installer on CentOS 7. Same result.

Where should I report this?

Cheers,
Olav

Probably in the same issue, at https://github.com/collective/plonetheme.business_casual/issues/2

Thanks for raising the problem here; the author of that theme was a student who participated in Google Summer of Code, and so it is up to us as a community to maintain it.

You can usually safely ignore any deprecation warnings.

Maybe someone else here has ideas?

What happens when you try to modify the theme?

Through the web I can alter themes as expected, file by file. But I cannot remove or replace themes which were added as .zip (I tried different themes - same result - this is not a plonetheme.business_casual only problem). I prefer having my themes under version control and uploading/replacing via zip archives. This worked fine under Plone 4.x. But with Plone 5(.0.8) this workflow is bugged.

See https://github.com/plone/plone.app.theming/issues/126

1 Like

see also

1 Like

This bug will affect all themes uploaded as zip file which have a "." dot in the theme id, like "plonetheme.business_casual".

When creating a new theme (or copying one) TTW, all dots will be replaced by underscores.

I don't have the time right now to look into the p.a.theming code, but regarding the business_casual theme I would suggest to change the theme declaration in https://github.com/collective/plonetheme.business_casual/blob/master/src/plonetheme/business_casual/configure.zcml#L17 from:

  <plone:static
      directory="theme"
      type="theme"
      name="plonetheme.business_casual"
      />

to:

  <plone:static
      directory="theme"
      type="theme"
      name="business_casual"
      />

This needs to be done in the theme.xml for GS as well. I didn't find any other occurrences of the dotted name which would influence the diazo theme rendering.

1 Like

You people are awesome :slight_smile:

@opeeters maybe you can modify the contents of the ZIP to follow @tmassman's suggestions then re-zip them and try upload that new zip to your Plone site. That will hopefully avoid the problem going forward.

Maybe someone else can come up with a handcrafted URL or other procedure to delete the other themes. Might be possible to do it via bin/instance debug

You can delete uploaded themes using the ZMI:

  1. Go to portal_resources within you Plone site
  2. Select theme and click on Edit
  3. Select your theme and click Delete
2 Likes

Removing themes via portal_resources does indeed work. Changing the theme to something without a dot (".") works fine, incl. replacing the theme with a new version..

Thanks to all for the detailed help!

Cheers,
Olav

1 Like