Closed petschki closed 7 years ago
Hm ... one more problem of the new unset/reset scripts is, that wildcard.foldercontents
resource hack isn't working anymore ... see https://github.com/collective/wildcard.foldercontents/blob/master/wildcard/foldercontents/views.py#L944 ... @thet is this unset/reset thing really needed? I never ran into those Mismatched anonymous define
errors ...
@petschki - i just got this error with the plone.app.event 2.x javascript, which register itself as requirejs module, if it's available. It's probably also needed for scritps like datatables. Unset/reset requirejs is done the same way in Plone 5.
I recommend to fix wildcard.foldercontents.
LGTM
@petschki
Hm. Your code did not work for me.
When require
and define
aren't defined before they are unset, then the mockup widgets bundle will set them they won't be set to undefined
afterwards as _old_define
and _old_require
are undefined.
But I need require and define to be undefined. I think that it's a rare case that require
and define
are defined before the mockup script.
I'll come back to this later. But now, it's weekend!
@thet you're right ... if they aren't define, they aren't reset. So the reset-script needs fallback:
define = typeof(_old_define) !== 'undefined' ? _old_define : undefined;
require = typeof(_old_require) !== 'undefined' ? _old_require : undefined;
this should do the trick ...
the wildcard.foldercontents
hack should be fixed there ... I'll create an issue ...
Introduced in 5c75aa8d2a1637b80b461200afd5b2b51fd74f88 it might happen, that there is no
define
orrequire
defined. handle this gracefully.