2

In previous versions of Plone, QuickInstaller took care of automagically removing some stuff on uninstall time; that was the case of browser layers and resource registry resources. Now in Plone 5 is a best practice to include a GenericSetup profile to explicitly uninstall those thins.

I folowed up Keul's blog post on uninstalls and added a browserlayer.xml file to my package uninstall profile as follows:

<?xml version="1.0"?>
<layers>
  <layer name="collective.fingerpointing" remove="true" />
</layers>

but my package is not removing it.

any hints?

code is in: https://github.com/collective/collective.fingerpointing/pull/6

test results are in: https://travis-ci.org/collective/collective.fingerpointing/jobs/110195902

I'm just one test away of accomplish compatibility of my add-on!

hvelarde
  • 2,875
  • 14
  • 34
  • I can confirm a similar issue, with a generic uninstall test (simply makes genericsetup snapshots before install and after uninstall) -.- – Mathias Feb 18 '16 at 19:38
  • I'm assuming a bug them right? – hvelarde Feb 18 '16 at 22:13
  • well I guess so. I did no dig into, since I choos to use plone 4.3.x so far. – Mathias Feb 18 '16 at 22:15
  • 1
    If I can add a note: in my experience also on Plone 4 the uninstall of browserlayer was need. Sometimes it seems you don't need it, but sometimes if you don't provide the uninstall step the interface stay hidden somewhere, then suddenly came back when you are doing some important thing like Plone version migration. So my suggestion is: add the GS uninstall also on Plone 4. – keul Feb 19 '16 at 08:46

2 Answers2

1

For unregistering browser layers, the interface is ignored. Only the browser layer name is important. That has to match the name, under which the browser layer was registered before.

thet
  • 697
  • 12
  • 14
1

The problem was in the test: I was testing against the name of the interface and another package (in my case, plone.app.event) had a browser layer with the same name (IBrowserLayer):

(Pdb) registered_layers()[4]
<InterfaceClass plone.app.event.interfaces.IBrowserLayer>

I was using this:

def test_addon_layer_removed(self):
    from plone.browserlayer.utils import registered_layers
    layers = [l.getName() for l in registered_layers()]
    self.assertNotIn('IBrowserLayer', layers)

I change it to the following:

def test_addon_layer_removed(self):
    from collective.fingerpointing.interfaces import IBrowserLayer
    from plone.browserlayer.utils import registered_layers
    self.assertNotIn(IBrowserLayer, registered_layers())

That's why is important to have the right tests in place.

hvelarde
  • 2,875
  • 14
  • 34