Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Upload tab in TinyMCE Image showing [object Object] #986

Merged
merged 4 commits into from
Jun 24, 2020

Conversation

vincentfretin
Copy link
Member

See the screenshot of the issue at
plone/Products.CMFPlone#3120 (comment)

@mister-roboto
Copy link

@vincentfretin thanks for creating this Pull Request and help improve Plone!

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass.

Whenever you feel that the pull request is ready to be tested, either start all jenkins jobs pull requests by yourself, or simply add a comment in this pull request stating:

@jenkins-plone-org please run jobs

With this simple comment all the jobs will be started automatically.

Happy hacking!

@vincentfretin
Copy link
Member Author

@jenkins-plone-org please run jobs

@vincentfretin
Copy link
Member Author

:-( The tests are failing on travis, and I can't run the tests on my machine ubuntu 18.04 either.

I get

$ make test
NODE_PATH=./mockup/node_modules ./mockup/node_modules/grunt-cli/bin/grunt test   --gruntfile=mockup/Gruntfile.js --pattern=
Running "jshint:all" (jshint) task
>> 60 files lint free.

Running "karma:test" (karma) task
22 06 2020 16:19:17.817:WARN [filelist]: All files matched by "/home/vincentfretin/workspace/buildout.coredev-5.2/src/mockup/mockup/node_modules/mocha/mocha.js" were excluded or matched by prior matchers.
22 06 2020 16:19:17.858:WARN [filelist]: All files matched by "/home/vincentfretin/workspace/buildout.coredev-5.2/src/mockup/mockup/node_modules/karma-mocha/lib/adapter.js" were excluded or matched by prior matchers.
22 06 2020 16:19:17.858:WARN [filelist]: All files matched by "/home/vincentfretin/workspace/buildout.coredev-5.2/src/mockup/mockup/js/bundles/widgets.js" were excluded or matched by prior matchers.
22 06 2020 16:19:18.014:WARN [karma]: No captured browser, open http://localhost:9876/
22 06 2020 16:19:18.063:INFO [karma-server]: Karma v4.1.0 server started at http://0.0.0.0:9876/
22 06 2020 16:19:18.063:INFO [launcher]: Launching browsers PhantomJS with concurrency unlimited
22 06 2020 16:19:18.216:INFO [launcher]: Starting browser PhantomJS
22 06 2020 16:19:18.878:INFO [PhantomJS 2.1.1 (Linux 0.0.0)]: Connected on socket a3ThXOTEe5w0VwISAAAA with id 35856079
PhantomJS 2.1.1 (Linux 0.0.0) WARN: '%s: %s', 'MaxListenersExceededWarning', 'Possible EventEmitter memory leak detected. 11 "pre-require" listeners added. Use emitter.setMaxListeners() to increase limit.'
PhantomJS 2.1.1 (Linux 0.0.0) WARN: '%s: %s', 'MaxListenersExceededWarning', 'Possible EventEmitter memory leak detected. 11 "pre-require" listeners added. Use emitter.setMaxListeners() to increase limit.'

PhantomJS 2.1.1 (Linux 0.0.0) WARN LOG: '%s: %s', 'MaxListenersExceededWarning', 'Possible EventEmitter memory leak detected. 11 "pre-require" listeners added. Use emitter.setMaxListeners() to increase limit.'
PhantomJS 2.1.1 (Linux 0.0.0) ERROR
  ReferenceError: Can't find variable: _
  at node_modules/backbone.paginator/lib/backbone.paginator.js:1047:15
PhantomJS 2.1.1 (Linux 0.0.0) ERROR
  ReferenceError: Can't find variable: _
  at node_modules/backbone.paginator/lib/backbone.paginator.js:1047:15

PhantomJS 2.1.1 (Linux 0.0.0) ERROR
  ReferenceError: Can't find variable: _
  at node_modules/backbone.paginator/lib/backbone.paginator.js:1047:15
PhantomJS 2.1.1 (Linux 0.0.0) ERROR
  TypeError: undefined is not an object (evaluating 'Backbone.Paginator.requestPager')
  at patterns/structure/js/collections/result.js:11:44
PhantomJS 2.1.1 (Linux 0.0.0) ERROR
  TypeError: undefined is not an object (evaluating 'Backbone.Paginator.requestPager')
  at patterns/structure/js/collections/result.js:11:44

PhantomJS 2.1.1 (Linux 0.0.0) ERROR
  TypeError: undefined is not an object (evaluating 'Backbone.Paginator.requestPager')
  at patterns/structure/js/collections/result.js:11:44

and nothing happen.

Anyone got the tests working recently at least on their machine? @ale-rt ?

@vincentfretin
Copy link
Member Author

Same with chrome testing with make test-dev

$ make test-dev
NODE_PATH=./mockup/node_modules ./mockup/node_modules/grunt-cli/bin/grunt test_dev   --gruntfile=mockup/Gruntfile.js --pattern=
Running "karma:testDev" (karma) task
22 06 2020 16:23:45.882:WARN [filelist]: All files matched by "/home/vincentfretin/workspace/buildout.coredev-5.2/src/mockup/mockup/node_modules/mocha/mocha.js" were excluded or matched by prior matchers.
22 06 2020 16:23:45.896:WARN [filelist]: All files matched by "/home/vincentfretin/workspace/buildout.coredev-5.2/src/mockup/mockup/node_modules/karma-mocha/lib/adapter.js" were excluded or matched by prior matchers.
22 06 2020 16:23:45.896:WARN [filelist]: All files matched by "/home/vincentfretin/workspace/buildout.coredev-5.2/src/mockup/mockup/js/bundles/widgets.js" were excluded or matched by prior matchers.
22 06 2020 16:23:46.029:WARN [karma]: No captured browser, open http://localhost:9876/
22 06 2020 16:23:46.068:INFO [karma-server]: Karma v4.1.0 server started at http://0.0.0.0:9876/
22 06 2020 16:23:46.069:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
22 06 2020 16:23:46.212:INFO [launcher]: Starting browser Chrome
22 06 2020 16:23:47.031:INFO [Chrome 83.0.4103 (Linux 0.0.0)]: Connected on socket OcAp_g5Ye22QCf3vAAAA with id 44447726
Chrome 83.0.4103 (Linux 0.0.0) WARN: '%s: %s', 'MaxListenersExceededWarning', 'Possible EventEmitter memory leak detected. 11 "pre-require" listeners added. Use emitter.setMaxListeners() to increase limit.'
Chrome 83.0.4103 (Linux 0.0.0) WARN: '%s: %s', 'MaxListenersExceededWarning', 'Possible EventEmitter memory leak detected. 11 "pre-require" listeners added. Use emitter.setMaxListeners() to increase limit.'

Chrome 83.0.4103 (Linux 0.0.0) WARN LOG: '%s: %s', 'MaxListenersExceededWarning', 'Possible EventEmitter memory leak detected. 11 "pre-require" listeners added. Use emitter.setMaxListeners() to increase limit.'
Chrome 83.0.4103 (Linux 0.0.0) ERROR
  Uncaught ReferenceError: _ is not defined
  at node_modules/backbone.paginator/lib/backbone.paginator.js:1047:14
  
  ReferenceError: _ is not defined
      at node_modules/backbone.paginator/lib/backbone.paginator.js:1047:14
Chrome 83.0.4103 (Linux 0.0.0) ERROR
  Uncaught ReferenceError: _ is not defined
  at node_modules/backbone.paginator/lib/backbone.paginator.js:1047:14
  
  ReferenceError: _ is not defined
      at node_modules/backbone.paginator/lib/backbone.paginator.js:1047:14

Chrome 83.0.4103 (Linux 0.0.0) ERROR
  Uncaught ReferenceError: _ is not defined
  at node_modules/backbone.paginator/lib/backbone.paginator.js:1047:14
  
  ReferenceError: _ is not defined
      at node_modules/backbone.paginator/lib/backbone.paginator.js:1047:14
Chrome 83.0.4103 (Linux 0.0.0) ERROR
  Uncaught TypeError: Cannot read property 'requestPager' of undefined
  at patterns/structure/js/collections/result.js:11:45
  
  TypeError: Cannot read property 'requestPager' of undefined
      at patterns/structure/js/collections/result.js:11:45
      at Object.execCb (node_modules/requirejs/require.js:1693:33)
      at Module.check (node_modules/requirejs/require.js:881:51)
      at Module.<anonymous> (node_modules/requirejs/require.js:1136:34)
      at node_modules/requirejs/require.js:134:23
      at node_modules/requirejs/require.js:1186:21
      at each (node_modules/requirejs/require.js:59:31)
      at Module.emit (node_modules/requirejs/require.js:1185:17)
      at Module.check (node_modules/requirejs/require.js:936:30)
      at Module.enable (node_modules/requirejs/require.js:1173:22)
Chrome 83.0.4103 (Linux 0.0.0) ERROR
  Uncaught TypeError: Cannot read property 'requestPager' of undefined
  at patterns/structure/js/collections/result.js:11:45
  
  TypeError: Cannot read property 'requestPager' of undefined
      at patterns/structure/js/collections/result.js:11:45
      at Object.execCb (node_modules/requirejs/require.js:1693:33)
      at Module.check (node_modules/requirejs/require.js:881:51)
      at Module.<anonymous> (node_modules/requirejs/require.js:1136:34)
      at node_modules/requirejs/require.js:134:23
      at node_modules/requirejs/require.js:1186:21
      at each (node_modules/requirejs/require.js:59:31)
      at Module.emit (node_modules/requirejs/require.js:1185:17)
      at Module.check (node_modules/requirejs/require.js:936:30)
      at Module.enable (node_modules/requirejs/require.js:1173:22)

Chrome 83.0.4103 (Linux 0.0.0) ERROR
  Uncaught TypeError: Cannot read property 'requestPager' of undefined
  at patterns/structure/js/collections/result.js:11:45
  
  TypeError: Cannot read property 'requestPager' of undefined
      at patterns/structure/js/collections/result.js:11:45
      at Object.execCb (node_modules/requirejs/require.js:1693:33)
      at Module.check (node_modules/requirejs/require.js:881:51)
      at Module.<anonymous> (node_modules/requirejs/require.js:1136:34)
      at node_modules/requirejs/require.js:134:23
      at node_modules/requirejs/require.js:1186:21
      at each (node_modules/requirejs/require.js:59:31)
      at Module.emit (node_modules/requirejs/require.js:1185:17)
      at Module.check (node_modules/requirejs/require.js:936:30)
      at Module.enable (node_modules/requirejs/require.js:1173:22)

* Restore translations of 'Remove link'

* Add missing translationa in tinymce pattern by...

    copying generateModalHtml function from master branch,
    also some backported xml changes from 71ddf6f

* Add 2 further missing translations in tinymce pattern
@vincentfretin
Copy link
Member Author

@mauritsvanrees Not a good practice, but I propose to just merge this even with the tests failing... to not block the Plone release further.

@vincentfretin
Copy link
Member Author

For the tests failing, this is as if requirejs didn't read properly mockup/js/config.js and underscore ("_") wasn't loaded before Backbone.Paginator. But it should because Backbone.Paginator depends on Backbone which depends on underscore.

@vincentfretin
Copy link
Member Author

Note I'm not having issues running the tests on my machine for the 2.7.x branch

PhantomJS 2.1.1 (Linux 0.0.0): Executed 297 of 300 (skipped 3) SUCCESS (10.82 secs / 9.63 secs)
TOTAL: 297 SUCCESS

@vincentfretin
Copy link
Member Author

@thet @ale-rt This is actually since e6bd197 that the tests are failing on travis. I tried to revert the commit, ran yarn and make test passed. So one of the upgrade of a test dependency is wrong.

…core upgrade make the tests passed again
@vincentfretin
Copy link
Member Author

I've been lucky to found out this was the version of underscore. I'm merging this.

@vincentfretin vincentfretin merged commit a6cbe28 into master Jun 24, 2020
@vincentfretin vincentfretin deleted the fix-upload-tab branch June 24, 2020 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants