CMS Editor problem with Uploadcare script HELP ლ(ಠ_ಠლ) [SOLVED]

Hi all Webflow users!

I have a serious problem with CMS editor.

I need ability to upload files through the form so I’m using Uploadcare and everything works fine unless we are using CMS editor. Webflow support team told me that it’s caused by Uploadcare script and I checked it. After I erased it from custom code, editor works fine and I can change anything I want. The problem is a need both. The second problem is, I have no idea what to do. I believe that there is a hero who could help me solve it quick.

Here are some information that might be helpful.

The script:

<script>
  UPLOADCARE_LOCALE = "pl";
  UPLOADCARE_TABS = "file";
  UPLOADCARE_PUBLIC_KEY = "80dba48470bea7427e6d";
</script>
<script charset="utf-8" src="//ucarecdn.com/widget/2.9.0/uploadcare/uploadcare.full.min.js"></script>
<script>
    UPLOADCARE_PUBLIC_KEY = "80dba48470bea7427e6d";
    $ = uploadcare.jQuery;
    $(function() {
      var widget = uploadcare.SingleWidget('[key=CV]');
      widget.onUploadComplete(function(info) {
        console.log(info);
        $('.uploaded-url').html(info.cdnUrl);
      });
    });
</script>
<script>
    UPLOADCARE_PUBLIC_KEY = "80dba48470bea7427e6d";
    $ = uploadcare.jQuery;
    $(function() {
      var widget = uploadcare.SingleWidget('[key=List]');
      widget.onUploadComplete(function(info) {
        console.log(info);
        $('.uploaded-url').html(info.cdnUrl);
      });
    });
</script>
<script>
    UPLOADCARE_PUBLIC_KEY = "80dba48470bea7427e6d";
    $ = uploadcare.jQuery;
    $(function() {
      var widget = uploadcare.SingleWidget('[key=Referencje]');
      widget.onUploadComplete(function(info) {
        console.log(info);
        $('.uploaded-url').html(info.cdnUrl);
      });
    });
</script>

The site: http://otpsa.webflow.io

hmmmm… this:

Thank you. I believe that @bartekkustra is the right person I need to call :smiley:

Ok, here is simple solution for all those people who uses Uploadcare and CMS. Put the script to the head section, not the body.

2 Likes

In addition to moving scripts to the HEAD, you have several redundant strings in your example:

UPLOADCARE_PUBLIC_KEY = "xxx";
$ = uploadcare.jQuery;

can be declared only once.