Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Some javascript conflict, i think  (Read 9671 times)

0 Members and 1 Guest are viewing this topic.

federico.violante

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Some javascript conflict, i think
« on: February 05, 2011, 02:23:10 pm »

Hello, I use a Coppermine Gallery 1.5.12 (migrated from 1.4.24) bridged to Joomla 1.5.22 with +25k pictures
I ran older versions, 1.4.24 and Joomla 1.0.17 or so, without problema.
After upgrading both, I have a strange behavior

The most stringent issue is that I can't add a new album, giving me the error "Albums need to have a name".
I browsed through the code and i cant find the section that receives the form action.
 
Also, when I modify a config section and save, I miss immediately all the others, except when i explode and fill all options.

This seems to me a conflict between javascript libraries.
The "board" is at http://www.corrilabruzzo.it/copper
User test password test
Thank you in advance
Fred
Logged

federico.violante

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Some javascript conflict, i think
« Reply #1 on: February 05, 2011, 02:51:33 pm »

Hello, I use a Coppermine Gallery 1.5.12 (migrated from 1.4.24) bridged to Joomla 1.5.22 with +25k pictures
I ran older versions, 1.4.24 and Joomla 1.0.17 or so, without problema.
After upgrading both, I have a strange behavior

This seems to me a conflict between javascript libraries.
The "board" is at http://www.corrilabruzzo.it/copper
User test password test
Thank you in advance
Fred

I have unbridged the gallery and seems to work fine, or almost better.
At this point i am almost sure that is some conflicting javascript library, or maybe alternate version of jquery loaded by a plugin o component. Joomla uses seems to have mootools included by default. 
Logged

federico.violante

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Some javascript conflict, i think
« Reply #2 on: February 06, 2011, 09:03:01 am »

I have unbridged the gallery and seems to work fine, or almost better.
At this point i am almost sure that is some conflicting javascript library, or maybe alternate version of jquery loaded by a plugin o component. Joomla uses seems to have mootools included by default. 


Seems more a problem with bridging. I have inspected the page source and seen that included javascript is almost the same. Also temporarily removed mootools. Same issue.
Tried disabling joomla->coppermine visual integration, no change.
At this point the remaining candidate is joomla15.inc.php.
I am trying to automatically disable the bridge, may be through session variables or url params, to leave browsing fully integrated and allow managing of albums. The only place where i can do it is in init.inc.php.
Should never touch core files, but there is a choice ?
Logged

federico.violante

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Some javascript conflict, i think
« Reply #3 on: February 06, 2011, 09:05:07 pm »

Seems more a problem with bridging.
....
Should never touch core files, but there is a choice ?

Partially solved with:

<when the user is a joomla admin, unbridge for him (must repeat logon also on coppermine)>

that fit my case and may be useful for others. I am sorry but, i have not found better ways, the problem should come from handling of POST variables coming from albmgr.js
 
changed three lines in init.inc.php

-- original code --

if ($CONFIG['bridge_enable'] == 1 && !defined('BRIDGEMGR_PHP')) {
    $BRIDGE = cpg_get_bridge_db_values();
} else {
    $BRIDGE['short_name']              = 'coppermine';
    $BRIDGE['recovery_logon_failures'] = 0;
    $BRIDGE['use_post_based_groups']   = false;
}

-- modified code --

user_get_profile();
$isadmin=($USER['am']>0);

if ($CONFIG['bridge_enable'] == 1 && !defined('BRIDGEMGR_PHP') && !($isadmin==1)) {
    $BRIDGE = cpg_get_bridge_db_values();
} else {
    $BRIDGE['short_name']              = 'coppermine';
    $BRIDGE['recovery_logon_failures'] = 0;
    $BRIDGE['use_post_based_groups']   = false;
}
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Some javascript conflict, i think
« Reply #4 on: February 08, 2011, 10:00:41 am »

Phill also had some trouble with mootools: http://forum.coppermine-gallery.net/index.php/topic,70174.0.html

Unfortunately there's no solution in that thread yet.
Logged

federico.violante

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Some javascript conflict, i think
« Reply #5 on: February 08, 2011, 05:22:34 pm »

Thank you for the suggestion, André

I am thinking that is not a problem with mootools (I also temporarily removed it, no change), but a conflict between ajax/jquery and the bridging logic. I don't know from which version was introduced jquery, (i jumped from 1.14.24 to 1.5.12). If not recently, should be strange if I am the first to hit the question.

Sadly I don't have a strong background in each of the parties involved jquery, coppermine core, themes and bridge, because until now they worked remarkably well, with the exception for me of batch adding (may be too many folders or pictures), that in the new version runs without a glitch.

At this moment I could survive with automatic unbridging, may be I could go back to cpg 1.4 if I need, but I think we should look ahead and solve problems when we found one on our way.
Also cpg 1.5 has new interesting functionalities well worth some head scraping.

I think this thread could be moved to the bridging section.
Fred
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Some javascript conflict, i think
« Reply #6 on: February 08, 2011, 06:56:19 pm »

jQuery has been introduced in an early development stage of cpg1.5.x, so it has been in all cpg1.5.x releases. Maybe Phill can confirm that your code change works for him, too.
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4862
    • Windsurf.me
Re: Some javascript conflict, i think
« Reply #7 on: February 08, 2011, 09:37:28 pm »

I've seen this on quite a few installs. I have a lot of hacks involved in getting my own site to work but I hesitate to do this for others. To do things correctly we need to separate the different libraries using the jquery no-conflict mode but I am yet to find a way to do this properly. My interim fix is to cycle through all the coppermine jquery files and replace $ with jQuery. It works but is not pretty - http://www.windsurf.me.uk

In my case the above code would not work as the coppermine code conflicts with the menu system in place on the Joomla template. I've now seen over 20 sites where people have similar issues and a couple would help with the code you detail so thanks for that.
Logged
It is a mistake to think you can solve any major problems just with potatoes.
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.