plone / plone.app.theming

Integrates the Diazo theming engine with Plone
https://docs.plone.org/external/plone.app.theming/docs/index.html
Other
21 stars 30 forks source link

After click on Delete button empty modal window #126

Open VerSooSet opened 7 years ago

VerSooSet commented 7 years ago

What I did:

Trying delete theme plonetheme.business.casual screenshot

What I expect to happen

deleting modal dialog

What actually happened:

the script was partially executed. Perhaps something was wrong and istead off message_text returns empty string. Besides if the dialog is closed on 'x', then the window disappears and the dark background remains. I have it only at new uploaded theme except copy of barcelonetta.

What version of Plone/ Addons I am using:

Plone 5.0.4.

VerSooSet commented 7 years ago

The problem is described in more detail on #115. And that is a same another view only. Happened to solve it manually as the same way which described.

gp54321 commented 7 years ago

Well, I changed controlpanel.pt so:

--- controlpanel.pt 2017-03-16 22:10:31.000000000 +0000
+++ controlpanel.pt.new 2017-05-24 09:40:54.031135337 +0000
@@ -280,12 +280,11 @@

                             <a href="#" class="plone-btn plone-btn-danger pat-plone-modal"
                                 tal:condition="theme/editable"
-                                tal:attributes="href string:#modal-delete-${theme/name}"
+                                tal:attributes="href python:'#modal-delete-{0}'.format(theme['name'].replace('.', '-'))"
                                 i18n:translate="">Delete</a>
                                 <!-- Delete confirmation overlay -->
                             <div class="plone-modal"
-                                tal:attributes="id string:modal-delete-${theme/name}"
-                                tal:condition="theme/editable">
+                                tal:attributes="id python:'modal-delete-{0}'.format(theme['name'].replace('.', '-'))">
                                 <h1 class="documentFirstHeading" i18n:translate="theming_controlpanel_delete_confirm">
                                     Are you sure you want to delete <span
                                         tal:content="string:${theme/name}"

Result attached looks better

after

VerSooSet commented 7 years ago

I checked your fix and confirmed it. Great!

tkimnguyen commented 7 years ago

See discussion in https://community.plone.org/t/unable-to-delete-or-replace-diazo-theme-plone-5-added-as-zip/4818/8 and related issue https://github.com/collective/plonetheme.business_casual/issues/2

philipsahli commented 5 years ago

The issue is still around in 5.1.2. Thanks @tkimnguyen for the link to the workaround by deleting or renaming the theme under portal_resources in the management interface. Would the fix by @gp54321 be accepted or are there any concerns?

tkimnguyen commented 4 years ago

@philipsahli I just ran into a similar problem because a theme had a space in its name or ID. If @gp54321 could make this a pull request?