|
|
[FIX] JavaScript error cbshowtabs array undefined
|
|
Date: 2007/08/17 00:39
|
By: nicowolf
|
Status: User
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 10 |   | |
|
Hi everyone,
I recently upgraded from cb 1.0.2 to cb 1.1 using the expert upgrade instructions.
I did everything that was instructed in the readme file.
CB works without any problems except for a javascript error in the bottom left corner of IE7 that reads: 'cbshowtabsArray' is undefined.
I looked in the files that got copied over and all looks fine to me. The object does get created in comprofiler.class.php
But when I look at the source code that gets generated in the html format I see this:
| Code: | <script type="text/javascript"><!--//--><![CDATA[//><!--
var tabPanecb_head;
cbshowtabsArray.push( [['portrait','20','getportraittab'],'tabPanecb_head.setSelectedIndex( 0 );'] );
|
and after a few lines, the object is created:
| Code: | <script type="text/javascript"><!--//--><![CDATA[//><!--
var tabPanecb_tabmain;
var cbshowtabsArray = new Array();
function showCBTab( sName ) {
if ( typeof(sName) == 'string' ) {
sName = sName.toLowerCase();
}
for (var i=0;i<cbshowtabsArray.length;i++) {
for (var j=0;j<cbshowtabsArray[i][0].length;j++) {
if (cbshowtabsArray[i][0][j] == sName) {
eval(cbshowtabsArray[i][1]);
return;
}
}
}
}
cbshowtabsArray.push( [['contact info','11','getcontacttab'],'tabPanecb_tabmain.setSelectedIndex( 0 );'] );
cbshowtabsArray.push( [['my blogs','14','getblogtab'],'tabPanecb_tabmain.setSelectedIndex( 1 );'] );
cbshowtabsArray.push( [['connections','15','getconnectiontab'],'tabPanecb_tabmain.setSelectedIndex( 2 );'] );
cbshowtabsArray.push( [['my photos','24','getprofilegallerytab'],'tabPanecb_tabmain.setSelectedIndex( 3 );'] );
cbshowtabsArray.push( [['events','29','getattendeventstab'],'tabPanecb_tabmain.setSelectedIndex( 4 );'] );
cbshowtabsArray.push( [['ads','31','getadstab'],'tabPanecb_tabmain.setSelectedIndex( 5 );'] );
|
So basically, the error occurs because the call to the object occurs before the object gets created (for the getportrait tab). Does anyone know where in the code we could fix this so that the javascript object gets created before any tabs are loaded?
Thanks in advance...
Post edited by: nicowolf, at: 2007/08/17 01:48
Post edited by: beat, at: 2007/08/17 02:11
Post edited by: beat, at: 2007/11/15 01:37
|
|
The administrator has disabled public write access. |
|
|
|
Re:JavaScript error cbshowtabs array undefined
|
|
Date: 2007/08/17 02:11
|
By: beat
|
Status: Admin
|
|
|
Karma: 238  
|
|
Admin  | Posts: 3998 |   | |
|
Confirming as bug:
Could reproduce by changing portrait display tab from raw to tab.
Moving to bugs and changing title.
No quick fix yet. Fix proposals welcome Beat - Developer on Community Builder core Team - If you like CB and this forum, you will love Nick's CB 1.1 reference manual ! : Click here to Get it now  - Would like to help us move faster ? Get it, and/or help us spend more time coding by helping others in this forum, many thanks
|
|
The administrator has disabled public write access. |
|
|
|
Re:[CONF] JavaScript error cbshowtabs array undefined
|
|
Date: 2007/08/17 07:30
|
By: nicowolf
|
Status: User
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 10 |   | |
|
Hey Beat,
Thanks for the update, I will work on it to come up with a solution. I think it should be pretty straight forward, just need to find how we create the object before any other tab is written out. I am still trying to familiarize myself with the CB code...
Nico
|
|
The administrator has disabled public write access. |
|
|
|
Re:[CONF] JavaScript error cbshowtabs array undefined
|
|
Date: 2007/08/18 04:43
|
By: beat
|
Status: Admin
|
|
|
Karma: 238  
|
|
Admin  | Posts: 3998 |   | |
|
Thanks 
Problem is probably in comprofiler.class.php . Beat - Developer on Community Builder core Team - If you like CB and this forum, you will love Nick's CB 1.1 reference manual ! : Click here to Get it now  - Would like to help us move faster ? Get it, and/or help us spend more time coding by helping others in this forum, many thanks
|
|
The administrator has disabled public write access. |
|
|
|
Re:[CONF] JavaScript error cbshowtabs array undefined
|
|
Date: 2007/08/19 20:24
|
By: joomlas
|
Status: User
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 6 |   | |
|
Try to change parameter under cb.menu under plug-in management! I have solved similar issue! http://www.mrkonjicgrad.com/korisnici/userslist/
Post edited by: joomlas, at: 2007/08/19 20:26
|
|
The administrator has disabled public write access. |
|
|
|
Re:[CONF] JavaScript error cbshowtabs array undefined
|
|
Date: 2007/08/19 20:36
|
By: nicowolf
|
Status: User
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 10 |   | |
|
Thank you for your suggestion. I will try and apply this solution while I try to fix the code, that would be a more perminent solution for the rest of the community, incase they still wanted to have the flexibility of choice in the plugin parameters... Thanks again...
|
|
The administrator has disabled public write access. |
|
|