Jump to:

22992 Posts in 11842 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » Enumerable is not defined

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 3062 Views
  • dacar
    Avatar
    Community Member
    168 Posts

    Enumerable is not defined Link to this post

    Hi,
    if i try to edit a user, the admin interface is broken and there is a javascript error:

    Fehler: Enumerable is not defined
    Quelldatei: /assets/_combinedfiles/leftandmain.js?m=1282828384
    Zeile: 71

    Here is the code from line 71:

    Object.extend(Effect.Queue,Enumerable);
    Effect.Base=function(){};
    Effect.Base.prototype={
          position:null,setOptions:function(options){
          this.options=Object.extend({
    transition:Effect.Transitions.sinoidal,duration:1.0,fps:25.0,sync:false,from:0.0,to:1.0,delay:0.0,queue:'parallel'
    },
    options||{});
    }
    ,start:function(options){this.setOptions(options||{});
    this.currentFrame=0;this.state='idle';
    this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.event('beforeStart');
    if(!this.options.sync)Effect.Queue.add(this);
       },loop:function(timePos){
       if(timePos>=this.startOn){
       if(timePos>=this.finishOn){
       this.render(1.0);
    this.cancel();
    this.event('beforeFinish');
    if(this.finish)this.finish();
    this.event('afterFinish');
    return;
    }

    All fields are in the first tab and i can not switch between the tabs.

    A screenshot is attached. Can anybody help or give a hint?

    Attached Files
  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: Enumerable is not defined Link to this post

    Does this happen if you view the admin with a ?flush=all. I wonder if its an issue with the combined file so try with a ?flush=all and if that fixes it then delete the assets/_combinedfiles folder, let it regenerate and see if that fixes it.

  • dacar
    Avatar
    Community Member
    168 Posts

    Re: Enumerable is not defined Link to this post

    Hi Willr,

    i have already tried that one. i am not sure, if enumerable is used by jquery or by prototype? Is it becaues prototype is not used in 2.4.x anymore?

    Greetings, Carsten.

  • Gene
    Avatar
    Community Member
    41 Posts

    Re: Enumerable is not defined Link to this post

    I've had the same issue on SS 2.4.4 on live sites (when the javascript files are automatically combined). It doesn't happen in dev mode. For some reason when the popup is called, the javascript is included in the wrong order. First leftandmain.js is included and then base.js. base.js contains Prototype so effectively Scriptaculous is being included before Prototype which is causing the issue. I'm going to dig through the code and see if I can find where it's happening and hopefully come up with a solution.

  • Gene
    Avatar
    Community Member
    41 Posts

    Re: Enumerable is not defined Link to this post

    Ugh, that was painful but I finally tracked it down. It's due to the fact that in the FieldHolder method of TabSet.php, loader.js is being included before prototype.js. Usually that would be fine but loader.js is part of the combined file for leftandmain.js and this is causing it to be included before base.js. The solution is to change the order of the Requirements calls in TabSet.php to this...

    public function FieldHolder() {
          // old position of loader.js
          Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
          Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
          Requirements::javascript(SAPPHIRE_DIR . "/javascript/prototype_improvements.js");
          Requirements::javascript(THIRDPARTY_DIR . "/jquery/jquery.js");
          Requirements::javascript(SAPPHIRE_DIR . "/javascript/jquery_improvements.js");
          Requirements::javascript(SAPPHIRE_DIR . '/javascript/loader.js'); // new position of loader.js
          Requirements::javascript(THIRDPARTY_DIR . "/tabstrip/tabstrip.js");
          Requirements::css(THIRDPARTY_DIR . "/tabstrip/tabstrip.css");
          
          return $this->renderWith("TabSetFieldHolder");
       }

  • dacar
    Avatar
    Community Member
    168 Posts

    Re: Enumerable is not defined Link to this post

    Hey Gene, well done. Thanks for spending your time on it!

  • moloko_man
    Avatar
    Community Member
    72 Posts

    Re: Enumerable is not defined Link to this post

    Has this bug been submitted and should we see a fix in the next 2.4.x release? I'm using 2.4.5 and still had this issue. Thanks to Gene, I was able to fix it, but every time I upgrade I have to fix it and that is getting old.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Enumerable is not defined Link to this post

    Thanks Gene. Just encountered the very same issue.
    Did anybody submit a bug for this?

    3062 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.