Plone 5.2.2 soft released

I'm sorry, haven't seen this yet

reading this https://github.com/plone/Products.CMFPlone/issues/3135#issuecomment-652022081 I don't think this is mosaic related at all ...

Correct. I have found the error in a custom template. This no longer works with Chameleon/zope.tales in Zope 4.4:

tal:omit-tag="True"

It should be:

tal:omit-tag="python:True"

Also, in a different template I used

tal:repeat="slide slides"

and then in a Python expression I used:

repeat.slide.start()

That gives RuntimeError: 'bool' object is not callable.
Solution is to use repeat.slide.start, but that probably fails with earlier chameleon. So I rewrote it to a path expression repeat/slide/start.

So likely various templates in add-on code need changes, as others have already seen. And maybe some core code where tests are missing.

So we might need to revert to Zope 4.3. But in the 4.4 changelog I see: " * Fix incompatiblities with Archetypes". Ah, but I reported those incompatibilities in March, and they were caused by the tales/chameleon/engine changes in 4.4. So for that part, 4.3 should be fine.

I am on the fence on this one: revert to Zope 4.3, or wait until the incompatibilities have been solved in a newer Zope 4.4 / chameleon release.
Note: individual templates are probably easy to fix, but for the first example in this comment it took me a long time to find which template it was. (Caching, even in development mode, and a jbot override did not help...)

5 Likes

At this point, I don't feel comfortable making 5.2.2 final with Zope 4.4.4. There are too many reports of template problems.
Going back to 4.3 is on the table as option for this release.
But I will sleep now, and then go on vacation for a week, so a decision will have to wait. Sorry about that!

4 Likes

Correct. Such breaking changes and incompatibilities are not acceptable for a minor Plone upgrade. Customers will ask why they would have to pay for a minor upgrade..things must not break.

1 Like

This is true for Zope 4 too and in my opinion this need to be fixed in Zope 4.4.4
cc @icemac @dataflake - what do you think?

2 Likes

I have a good news: https://github.com/zopefoundation/Zope/pull/861 seems to solve the attrs issue (thanks a lot @dieter)
Unluckily I have spotted another template related issue: https://github.com/zopefoundation/Zope/issues/862.

I guess I am one of the few to use tal:switch/tal:case and luckily the solution is pretty easy.

Anyway the positive news about that is that it seems I have a pretty good test coverage for page template edge cases :slight_smile:

4 Likes

Not sure if this a real bug: as mentioned earlier, we have this JS issue after upgrading from 5.2.1 to 5.2.2

This error is raised on a browser view where we include DataTables.net directly from within the template.
Clearly, jQuery is missing here in 5.2.2. Adding jQuery manually inside the template resolves the issue.
The question is why jQuery was available in Plone 5.2.1 and no longer in 5.2.2? Is this an issue with the bundles between both versions?

AFAIK nothing changed for jquery between Plone 5.2.1 and Plone 5.2.2
On a fresh 5.2.2, when I type jQuery or $ in the console, I have it. It is loaded from
http://0.0.0.0:8080/Plone/++plone++static/components/jquery/dist/jquery.min.js
version 1.12.4 included from plone.staticresources/src/plone/staticresources/static/components/jquery/dist/jquery.min.js
Are you sure your version of DataTables is not loaded before the Plone jQuery?
Maybe some upgrade step changed the resources order somewhat?

The DT JS is loaded within the content-core slot of the template. Nothing changed here.

Source of a fresh Plone 5.2.2:

I fhink I am fine with 5.2.2
Tested with three projects...

I wonder it was working before. To me, it looks like a side-effect of RequireJS wanting to register it as a module. For scripts outside the RequireJS toolchain in Plone you should normally register them as "legacy bundle" - that is setting the "compile" flag of the bundle to false. Then the bundle is wrapped within a de- and re-registration of requirejs, like here: https://github.com/plone/Products.CMFPlone/blob/009f785e450430ee7b143624480aef9268491c0b/Products/CMFPlone/resources/browser/scripts.pt#L6

Try:

<script>
      var _old_define = define;
      var _old_require = require;
      define = undefined;
      require = undefined;
</script>
<script src="YOURSCRIPT"/>
<script>
      define = _old_define;
      require = _old_require;
</script>

I myself know many swearwords about this. This will change in Plone 6 by getting rid of RequireJS and simplifying the resource registry.

I am using this approach usually everywhere when I need a particular JS functionality only in one template. This worked and still works on Plone 4 and Plone 5. Except for the jQuery issue between 5.2.1 and 5.2.2...so I justed added jQuery locally here...but my issue might be related to some trickery in the theming ...but no time to hunt this down...case closed with the mentioned workaround.

Nitpicking here, but I'd like to test if I understand what's happening here.

Requirejs is not registering anything, right? It might be in this situation that the datatables js file is wrapped in AMD boilerplate, which detects the global require object and then tries to register datatables into the requirejs registry.
If you hide the require object temporarily, this cannot happen.

1 Like

Exactly. I looked into the datatables source code and it is registering as a AMD module if it can find requirejs:

@zopyx is using its own version of datatables (1.0.15) in his package, not the one in Plone (1.0.16).

I am really glad to say that using Plone 5.2.2-pending and adding the following pins that I extracted diffing the versions.cfg between Zope 4.5 and Zope 4.4.4 all my test pass!

Zope = 4.5
BTrees = 4.7.2
Chameleon = 3.8.1
Products.ZCatalog = 5.1
ZODB = 5.6.0
persistent = 4.6.4
pytz = 2020.1
six = 1.15.0
zope.configuration = 4.4.0
zope.container = 4.4.0
zope.filerepresentation = 5.0.0
zope.formlib = 4.7.1
zope.interface = 5.1.0
zope.publisher = 5.2.1
zope.schema = 6.0.0
zope.site = 4.3.0
zope.tales = 5.1
zope.traversing = 4.4.1

Really impressive!
Thanks a lot to all the people involved!

3 Likes

The automatic wrapping by just setting compile to false is not working as expected.
I was debuggin this this week to find out why, but so far the code is still a bit confusing and does not make sense to me in all cases.

The expectation is, that hen i register only a bundle without extra resources and set compile to False, that 1. it will not be compiled and 2. it should be wrapped to deactivated/activate requirejs. The last step is not happening. First of all, the code tells me that it can't work without an extra resource. Than when there is not resource defined for the bundle it skips the wrapping at all. But even with a resource, it want work for me. Need more digging. Maybe @thet we could have a look together on this soon.

1 Like

I'm not sure if this was intended, we talked about these changes and said that it should go into Plone 6, not 5.2. As small as they are, these are features. But I'm ok if it stays, compared to the changes on the zope level, the risks are small.

plone.app.theming: 4.0.4 → 4.1.1

New features:

Insert diazo bundle without rules.
[santonelli] (#176)

Add custom CSS settings and view to theming control panel.
Ddepends on https://github.com/plone/Products.CMFPlone/pull/3089
[MrTango] (#178)
1 Like