Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

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

Enumerable is not defined


Go to End
Reply


14 Posts   3722 Views

Avatar
dacar

Community Member, 168 Posts

5 November 2010 at 10:32pm

Edited: 05/11/2010 10:33pm

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
Avatar
Willr

Forum Moderator, 5513 Posts

6 November 2010 at 5:15pm

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.

Avatar
dacar

Community Member, 168 Posts

7 November 2010 at 2:18am

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.

Avatar
Gene

Community Member, 41 Posts

23 January 2011 at 11:44am

Edited: 23/01/2011 12:04pm

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.

Avatar
Gene

Community Member, 41 Posts

24 January 2011 at 12:50am

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");
   }

Avatar
dacar

Community Member, 168 Posts

24 January 2011 at 12:09pm

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

Avatar
moloko_man

Community Member, 72 Posts

8 April 2011 at 6:37am

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.

Avatar
banal

Community Member, 901 Posts

1 June 2011 at 8:12pm

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

Go to Top